[Piglit] [PATCH 10/13] util/gl: Extend cpp #if's for PIGLIT_USE_OPENGL_ES3

Chad Versace chad.versace at linux.intel.com
Tue Nov 27 17:52:08 PST 2012


For each preprocessor directive that examines the PIGLIT_USE_OPENGL*
feature macros, extend the directive to support building with
PIGLIT_USE_OPENGL_ES3.

Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 tests/util/piglit-framework-gl/piglit_gl_framework.c  | 4 +++-
 tests/util/piglit-framework-gl/piglit_wfl_framework.c | 4 +++-
 tests/util/piglit-shader.h                            | 2 +-
 tests/util/piglit-util-gl-common.c                    | 4 +++-
 tests/util/piglit-util-gles.c                         | 2 +-
 5 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/tests/util/piglit-framework-gl/piglit_gl_framework.c b/tests/util/piglit-framework-gl/piglit_gl_framework.c
index aa24dd7..156cacc 100644
--- a/tests/util/piglit-framework-gl/piglit_gl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_gl_framework.c
@@ -79,7 +79,9 @@ validate_supported_apis(const struct piglit_gl_test_config *test_config)
 	    && !test_config->supports_gl_compat_version) {
 		piglit_report_result(PIGLIT_SKIP);
 	}
-#elif defined(PIGLIT_USE_OPENGL_ES1) || defined(PIGLIT_USE_OPENGL_ES2)
+#elif defined(PIGLIT_USE_OPENGL_ES1) || \
+      defined(PIGLIT_USE_OPENGL_ES2) || \
+      defined(PIGLIT_USE_OPENGL_ES3)
 	if (!test_config->supports_gl_es_version) {
 		piglit_report_result(PIGLIT_SKIP);
 	}
diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index f143670..6e59544 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -371,7 +371,9 @@ make_context_current(struct piglit_wfl_framework *wfl_fw,
 		}
 	}
 
-#elif defined(PIGLIT_USE_OPENGL_ES1) || defined(PIGLIT_USE_OPENGL_ES2)
+#elif defined(PIGLIT_USE_OPENGL_ES1) || \
+      defined(PIGLIT_USE_OPENGL_ES2) || \
+      defined(PIGLIT_USE_OPENGL_ES3)
 	ok = make_context_current_singlepass(wfl_fw, test_config,
 	                                     CONTEXT_GL_ES,
 	                                     partial_config_attrib_list);
diff --git a/tests/util/piglit-shader.h b/tests/util/piglit-shader.h
index d2bcdeb..50bd4af 100644
--- a/tests/util/piglit-shader.h
+++ b/tests/util/piglit-shader.h
@@ -131,7 +131,7 @@ GLint piglit_link_simple_program(GLint vs, GLint fs);
 #define piglit_UniformMatrix3x4fv assert(!"glUniformMatrix3x4fv does not exist in ES")
 #define piglit_UniformMatrix4x2fv assert(!"glUniformMatrix4x2fv does not exist in ES")
 #define piglit_UniformMatrix4x3fv assert(!"glUniformMatrix4x3fv does not exist in ES")
-#else
+#elif defined(PIGLIT_USE_OPENGL) || defined(PIGLIT_USE_OPENGL_ES2)
 extern PFNGLATTACHSHADERPROC piglit_AttachShader;
 extern PFNGLBINDATTRIBLOCATIONPROC piglit_BindAttribLocation;
 extern PFNGLCOMPILESHADERPROC piglit_CompileShader;
diff --git a/tests/util/piglit-util-gl-common.c b/tests/util/piglit-util-gl-common.c
index 9000673..b431815 100644
--- a/tests/util/piglit-util-gl-common.c
+++ b/tests/util/piglit-util-gl-common.c
@@ -116,7 +116,9 @@ static void initialize_piglit_extension_support(void)
 		return;
 	}
 
-#if defined(PIGLIT_USE_OPENGL_ES1) || defined(PIGLIT_USE_OPENGL_ES2)
+#if defined(PIGLIT_USE_OPENGL_ES1) || \
+    defined(PIGLIT_USE_OPENGL_ES2) || \
+    defined(PIGLIT_USE_OPENGL_ES3)
 	gl_extensions = gl_extension_array_from_getstring();
 #elif defined(PIGLIT_USE_OPENGL)
 	if (piglit_get_gl_version() < 30) {
diff --git a/tests/util/piglit-util-gles.c b/tests/util/piglit-util-gles.c
index f83d373..c7f86a1 100644
--- a/tests/util/piglit-util-gles.c
+++ b/tests/util/piglit-util-gles.c
@@ -205,7 +205,7 @@ draw_arrays(const GLvoid *verts, const GLvoid *tex)
 		glDisableClientState(GL_VERTEX_ARRAY);
 	if (tex)
 		glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-#elif defined(PIGLIT_USE_OPENGL_ES2)
+#elif defined(PIGLIT_USE_OPENGL_ES2) ||defined(PIGLIT_USE_OPENGL_ES3)
 	if (verts) {
 		glVertexAttribPointer(PIGLIT_ATTRIB_POS, 4, GL_FLOAT, GL_FALSE, 0, verts);
 		glEnableVertexAttribArray(PIGLIT_ATTRIB_POS);
-- 
1.7.11.7



More information about the Piglit mailing list