Commit 9bfd7de5 authored by Chad Versace's avatar Chad Versace

dispatch: Use piglit-dispatch for GLES1

After having migrated piglit-dispatch to the Khronos XML,
moving GLES1 to piglit-dispatch was easy. This patch:

  1. Fixes gl_wrap.h to include piglit-dispatch-gen.h instead of
     <GLES/*.h>.
  2. Deletes some ugly macro workarounds for GLES1 that piglit-dispatch
     obsoletes.
  3. Add piglit-dispatch*.c to libpiglitutil_gles1 in the CMake.
  4. Call piglit_dispatch_init(PIGLIT_DISPATCH_ES1).
Signed-off-by: 's avatarChad Versace <chad.versace@linux.intel.com>
parent a3b67e2c
/*
* Copyright (c) 2010 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Authors:
* Chad Versace <chad.versace@intel.com>
*/
/**
* \file gl_wrap.h
* \brief Convenience header that includes the actual OpenGL headers.
*
* The actual OpenGL headers are chosen according to the macro definitions
* PIGLIT_USE_OPENGL, PIGLIT_USE_OPENGL_ES1, and PIGLIT_USE_OPENGL_ES2.
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WIN32
#include <windows.h>
#endif
#if (defined(PIGLIT_USE_OPENGL) || \
defined(PIGLIT_USE_OPENGL_ES2) || \
defined(PIGLIT_USE_OPENGL_ES3))
# include "piglit-dispatch.h"
#elif defined(PIGLIT_USE_OPENGL_ES1)
# define GL_GLEXT_PROTOTYPES
# include <GLES/gl.h>
# include <GLES/glext.h>
/* for source level compatibility */
# define GL_TEXTURE_CUBE_MAP_POSITIVE_X GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES
# define GL_TEXTURE_CUBE_MAP_POSITIVE_Y GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES
# define GL_TEXTURE_CUBE_MAP_POSITIVE_Z GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES
# define GL_TEXTURE_CUBE_MAP_NEGATIVE_X GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES
# define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES
# define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES
#endif
#ifdef __cplusplus
} /* end extern "C" */
#endif
#include "piglit-dispatch.h"
......@@ -56,15 +56,6 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
PIGLIT_GL_TEST_CONFIG_END
#if defined PIGLIT_USE_OPENGL_ES1
#define GL_TEXTURE_CUBE_MAP GL_TEXTURE_CUBE_MAP_OES
#define GL_DEPTH_STENCIL GL_DEPTH_STENCIL_OES
#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
#define GL_UNSIGNED_INT_24_8 GL_UNSIGNED_INT_24_8_OES
#define GL_TEXTURE_3D 0x806F
#define glTexStorage2D glTexStorage2DEXT
#endif
static bool has_texture_3d = false;
static bool has_texture_cube_map = false;
static bool has_depth_texture_cube_map = false;
......
set(UTIL_GL_SOURCES
${UTIL_GL_SOURCES}
piglit-dispatch.c
piglit-dispatch-init.c
piglit-matrix.c
piglit-shader.c
piglit-shader-gl.c
......
......@@ -29,6 +29,8 @@ set(UTIL_GL_INCLUDES
set(UTIL_GL_SOURCES
fdo-bitmap.c
piglit-dispatch.c
piglit-dispatch-init.c
piglit-util-gl-common.c
piglit-framework-gl/piglit_gl_framework.c
piglit-framework-gl.c
......
......@@ -516,8 +516,12 @@ make_context_current_singlepass(struct piglit_wfl_framework *wfl_fw,
#ifdef PIGLIT_USE_OPENGL
piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
#elif defined(PIGLIT_USE_OPENGL_ES1)
piglit_dispatch_default_init(PIGLIT_DISPATCH_ES1);
#elif defined(PIGLIT_USE_OPENGL_ES2) || defined(PIGLIT_USE_OPENGL_ES3)
piglit_dispatch_default_init(PIGLIT_DISPATCH_ES2);
#else
# error
#endif
ok = check_gl_version(test_config, flavor, ctx_desc);
......
......@@ -52,51 +52,6 @@ GLint piglit_build_simple_program_multiple_shaders(GLenum target1,
extern GLboolean piglit_program_pipeline_check_status(GLuint pipeline);
extern GLboolean piglit_program_pipeline_check_status_quiet(GLuint pipeline);
#if defined(PIGLIT_USE_OPENGL_ES1)
#define glAttachShader assert(!"glAttachShader does not exist in ES1")
#define glBindAttribLocation assert(!"glBindAttribLocation does not exist in ES1")
#define glCompileShader assert(!"glCompileShader does not exist in ES1")
#define glCreateProgram assert(!"glCreateProgram does not exist in ES1")
#define glCreateShader assert(!"glCreateShader does not exist in ES1")
#define glDeleteProgram assert(!"glDeleteProgram does not exist in ES1")
#define glDeleteShader assert(!"glDeleteShader does not exist in ES1")
#define glGetActiveUniform assert(!"glGetActiveUniform does not exist in ES1")
#define glGetAttribLocation assert(!"glGetAttribLocation does not exist in ES1")
#define glGetProgramInfoLog assert(!"glGetProgramInfoLog does not exist in ES1")
#define glGetProgramiv assert(!"glGetProgramiv does not exist in ES1")
#define glGetShaderInfoLog assert(!"glGetShaderInfoLog does not exist in ES1")
#define glGetShaderiv assert(!"glGetShaderiv does not exist in ES1")
#define glGetUniformLocation assert(!"glGetUniformLocation does not exist in ES1")
#define glLinkProgram assert(!"glLinkProgram does not exist in ES1")
#define glShaderSource assert(!"glShaderSource does not exist in ES1")
#define glUseProgram assert(!"glUseProgram does not exist in ES1")
#define glUniform1f assert(!"glUniform1f does not exist in ES1")
#define glUniform2f assert(!"glUniform2f does not exist in ES1")
#define glUniform3f assert(!"glUniform3f does not exist in ES1")
#define glUniform4f assert(!"glUniform4f does not exist in ES1")
#define glUniform1fv assert(!"glUniform1fv does not exist in ES1")
#define glUniform2fv assert(!"glUniform2fv does not exist in ES1")
#define glUniform3fv assert(!"glUniform3fv does not exist in ES1")
#define glUniform4fv assert(!"glUniform4fv does not exist in ES1")
#define glUniform1i assert(!"glUniform1i does not exist in ES1")
#define glUniform2iv assert(!"glUniform2iv does not exist in ES1")
#define glUniform3iv assert(!"glUniform3iv does not exist in ES1")
#define glUniform4iv assert(!"glUniform4iv does not exist in ES1")
#define glUniformMatrix2fv assert(!"glUniformMatrix2fv does not exist in ES1")
#define glUniformMatrix3fv assert(!"glUniformMatrix3fv does not exist in ES1")
#define glUniformMatrix4fv assert(!"glUniformMatrix4fv does not exist in ES1")
#define glGetUniformfv assert(!"glGetUniformfv does not exist in ES1")
#define glVertexAttribPointer assert(!"glVertexAttribPointer does not exist in ES1")
#define glEnableVertexAttribArray assert(!"glEnableVertexAttribArray does not exist in ES1")
#define glDisableVertexAttribArray assert(!"glDisableVertexAttribArray does not exist in ES1")
#define glUniformMatrix2x3fv assert(!"glUniformMatrix2x3fv does not exist in ES1")
#define glUniformMatrix2x4fv assert(!"glUniformMatrix2x4fv does not exist in ES1")
#define glUniformMatrix3x2fv assert(!"glUniformMatrix3x2fv does not exist in ES1")
#define glUniformMatrix3x4fv assert(!"glUniformMatrix3x4fv does not exist in ES1")
#define glUniformMatrix4x2fv assert(!"glUniformMatrix4x2fv does not exist in ES1")
#define glUniformMatrix4x3fv assert(!"glUniformMatrix4x3fv does not exist in ES1")
#endif
/**
* Require a specific version of GLSL.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment