[Piglit] [PATCH 1/7] glsl-vs-deadcode-*: New tests for changes to Mesa's opt_dead_code_local.cpp.

Eric Anholt eric at anholt.net
Tue Feb 28 13:32:35 PST 2012


The second test is a slight strip-down of a glean test that regressed.
The first was just what I wrote to first look at the implementation.
---
 tests/shaders/glsl-vs-deadcode-1.shader_test |   37 ++++++++++++++++++++++++++
 tests/shaders/glsl-vs-deadcode-2.shader_test |   34 +++++++++++++++++++++++
 2 files changed, 71 insertions(+), 0 deletions(-)
 create mode 100644 tests/shaders/glsl-vs-deadcode-1.shader_test
 create mode 100644 tests/shaders/glsl-vs-deadcode-2.shader_test

diff --git a/tests/shaders/glsl-vs-deadcode-1.shader_test b/tests/shaders/glsl-vs-deadcode-1.shader_test
new file mode 100644
index 0000000..134ade3
--- /dev/null
+++ b/tests/shaders/glsl-vs-deadcode-1.shader_test
@@ -0,0 +1,37 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+varying vec4 color;
+uniform vec4 v4;
+uniform vec3 v3;
+uniform vec2 v2;
+uniform float v1;
+
+void main()
+{
+        gl_Position = gl_Vertex;
+
+	color.xyzw = v4;
+	color.xyz = v3;
+	color.xy = v2;
+	color.x = v1;
+}
+
+[fragment shader]
+varying vec4 color;
+
+void main()
+{
+        gl_FragColor = color;
+}
+
+[test]
+uniform vec4  v4 0.9 0.9 0.9 0.4
+uniform vec3  v3 0.9 0.9 0.3
+uniform vec2  v2 0.9 0.2
+uniform float v1 0.1
+
+draw rect -1 -1 2 2
+
+probe all rgba 0.1 0.2 0.3 0.4
diff --git a/tests/shaders/glsl-vs-deadcode-2.shader_test b/tests/shaders/glsl-vs-deadcode-2.shader_test
new file mode 100644
index 0000000..47d5e9d
--- /dev/null
+++ b/tests/shaders/glsl-vs-deadcode-2.shader_test
@@ -0,0 +1,34 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+varying vec3 color;
+uniform vec4 v1;
+uniform float v2;
+uniform float v3;
+
+void main()
+{
+        gl_Position = gl_Vertex;
+
+	color.xyz = v1.xyz;
+	color.y = v2;
+	color.z = v3;
+}
+
+[fragment shader]
+varying vec3 color;
+
+void main()
+{
+        gl_FragColor = vec4(color, 0.4);
+}
+
+[test]
+uniform vec4  v1 0.1 0.9 0.9
+uniform float v2 0.2
+uniform float v3 0.3
+
+draw rect -1 -1 2 2
+
+probe all rgba 0.1 0.2 0.3 0.4
-- 
1.7.9.1



More information about the Piglit mailing list