[Piglit] [PATCH] gles-3.0: Add support to use shader utility functions in test cases

Anuj Phogat anuj.phogat at gmail.com
Fri Nov 30 16:13:40 PST 2012


Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
 tests/util/CMakeLists.gles3.txt  |    2 ++
 tests/util/piglit-shader-gles3.c |   32 ++++++++++++++++++++++++++++++++
 tests/util/piglit-shader.h       |    2 +-
 3 files changed, 35 insertions(+), 1 deletions(-)
 create mode 100644 tests/util/piglit-shader-gles3.c

diff --git a/tests/util/CMakeLists.gles3.txt b/tests/util/CMakeLists.gles3.txt
index d9b78c6..2047ac3 100644
--- a/tests/util/CMakeLists.gles3.txt
+++ b/tests/util/CMakeLists.gles3.txt
@@ -1,5 +1,7 @@
 list(APPEND UTIL_GL_SOURCES
 	minmax-test.c
+	piglit-shader.c
+	piglit-shader-gles3.c
 	piglit-util-gles.c
 	piglit-util-gles3-enum.c
 	)
diff --git a/tests/util/piglit-shader-gles3.c b/tests/util/piglit-shader-gles3.c
new file mode 100644
index 0000000..00deb34
--- /dev/null
+++ b/tests/util/piglit-shader-gles3.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright © 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.
+ */
+
+#ifndef PIGLIT_USE_OPENGL_ES3
+#	error PIGLIT_USE_OPENGL_ES3 is undefined
+#endif
+
+#include "piglit-util-gl-common.h"
+
+void piglit_require_GLSL(void) {}
+void piglit_require_vertex_shader(void) {}
+void piglit_require_fragment_shader(void) {}
diff --git a/tests/util/piglit-shader.h b/tests/util/piglit-shader.h
index 50bd4af..d915352 100644
--- a/tests/util/piglit-shader.h
+++ b/tests/util/piglit-shader.h
@@ -88,7 +88,7 @@ GLint piglit_link_simple_program(GLint vs, GLint fs);
 #define piglit_UniformMatrix3x4fv assert(!"glUniformMatrix3x4fv does not exist in ES1")
 #define piglit_UniformMatrix4x2fv assert(!"glUniformMatrix4x2fv does not exist in ES1")
 #define piglit_UniformMatrix4x3fv assert(!"glUniformMatrix4x3fv does not exist in ES1")
-#elif defined(PIGLIT_USE_OPENGL_ES2)
+#elif defined(PIGLIT_USE_OPENGL_ES2) || defined(PIGLIT_USE_OPENGL_ES3)
 #define piglit_AttachShader glAttachShader
 #define piglit_BindAttribLocation glBindAttribLocation
 #define piglit_CompileShader glCompileShader
-- 
1.7.7.6



More information about the Piglit mailing list