[Piglit] [PATCH 6/6] dispatch: Use piglit-dispatch for GLES1

Chad Versace chad.versace at linux.intel.com
Fri Jun 13 07:44:37 PDT 2014


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

  1. Fixes gl_wrap.h to stop 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.

Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 src/piglit/gl_wrap.h                               | 68 +---------------------
 .../depth-stencil-texture.c                        |  9 ---
 tests/util/CMakeLists.gl.txt                       |  2 -
 tests/util/CMakeLists.txt                          |  2 +
 tests/util/piglit-shader.h                         | 45 --------------
 5 files changed, 3 insertions(+), 123 deletions(-)

diff --git a/src/piglit/gl_wrap.h b/src/piglit/gl_wrap.h
index e8bbbcd..56492a7 100644
--- a/src/piglit/gl_wrap.h
+++ b/src/piglit/gl_wrap.h
@@ -1,67 +1 @@
-/*
- * 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 at 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"
diff --git a/tests/spec/ext_packed_depth_stencil/depth-stencil-texture.c b/tests/spec/ext_packed_depth_stencil/depth-stencil-texture.c
index 688bbbd..a87dd12 100644
--- a/tests/spec/ext_packed_depth_stencil/depth-stencil-texture.c
+++ b/tests/spec/ext_packed_depth_stencil/depth-stencil-texture.c
@@ -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;
diff --git a/tests/util/CMakeLists.gl.txt b/tests/util/CMakeLists.gl.txt
index d414dd9..67833c9 100644
--- a/tests/util/CMakeLists.gl.txt
+++ b/tests/util/CMakeLists.gl.txt
@@ -1,7 +1,5 @@
 set(UTIL_GL_SOURCES
 	${UTIL_GL_SOURCES}
-	piglit-dispatch.c
-	piglit-dispatch-init.c
 	piglit-matrix.c
 	piglit-shader.c
 	piglit-shader-gl.c
diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt
index cf0aa6b..c2a5cee 100644
--- a/tests/util/CMakeLists.txt
+++ b/tests/util/CMakeLists.txt
@@ -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
diff --git a/tests/util/piglit-shader.h b/tests/util/piglit-shader.h
index e0503e6..e2eef03 100644
--- a/tests/util/piglit-shader.h
+++ b/tests/util/piglit-shader.h
@@ -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.
  *
-- 
2.0.0.rc1



More information about the Piglit mailing list