[Piglit] [PATCH 15/15] glsl-es-3.00: Add sanity.shader_test

Chad Versace chad.versace at linux.intel.com
Fri Dec 7 12:54:01 PST 2012


The test fills the window with red, then green, then blue.

Tested against mesa-gles3-412a815 with Intel Sandybridge.

Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 tests/all.tests                                    |  4 ++
 .../spec/glsl-es-3.00/execution/sanity.shader_test | 44 ++++++++++++++++++++++
 2 files changed, 48 insertions(+)
 create mode 100644 tests/spec/glsl-es-3.00/execution/sanity.shader_test

diff --git a/tests/all.tests b/tests/all.tests
index c09e5ae..43d6c41 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -814,6 +814,10 @@ spec['glsl-es-3.00'] = Group()
 import_glsl_parser_tests(spec['glsl-es-3.00'],
 			 os.path.join(testsDir, 'spec', 'glsl-es-3.00'),
 			 ['compiler'])
+add_shader_test_dir(spec['glsl-es-3.00'],
+		    os.path.join(testsDir, 'spec', 'glsl-es-3.00'),
+		    recursive=True)
+
 
 
 # Group AMD_conservative_depth
diff --git a/tests/spec/glsl-es-3.00/execution/sanity.shader_test b/tests/spec/glsl-es-3.00/execution/sanity.shader_test
new file mode 100644
index 0000000..e7e6ded
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/execution/sanity.shader_test
@@ -0,0 +1,44 @@
+# Fill the window with red, then green, then blue.
+
+[require]
+GL >= 3.0 es
+GLSL >= 3.00 es
+
+[vertex shader]
+#version 300 es
+
+in vec4 vertex;
+
+void main() {
+    gl_Position = vertex;
+}
+
+[fragment shader]
+#version 300 es
+
+uniform vec4 u_color;
+out vec4 color;
+
+void main() {
+    color = u_color;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+uniform vec4 u_color 1.0 0.0 0.0 1.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 1.0 0.0 0.0 1.0
+
+uniform vec4 u_color 0.0 1.0 0.0 1.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform vec4 u_color 0.0 0.0 1.0 1.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 0.0 1.0 1.0
-- 
1.7.11.7



More information about the Piglit mailing list