[Piglit] [PATCH] glsl: test a switch statement where default is last

Tapani Pälli tapani.palli at intel.com
Fri Jul 25 00:15:01 PDT 2014


This test is copy paste of fs-default_notlast.shader_test with
the cases rearranged.

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 .../execution/switch/fs-default_last.shader_test   | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 tests/spec/glsl-1.30/execution/switch/fs-default_last.shader_test

diff --git a/tests/spec/glsl-1.30/execution/switch/fs-default_last.shader_test b/tests/spec/glsl-1.30/execution/switch/fs-default_last.shader_test
new file mode 100644
index 0000000..17db675
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/switch/fs-default_last.shader_test
@@ -0,0 +1,43 @@
+[require]
+GLSL >= 1.30
+
+[vertex shader]
+#version 130
+void main()
+{
+	gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 130
+
+uniform int i;
+
+void main()
+{
+	gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
+	vec4 tmp = vec4(0.0, 0.0, 0.0, 0.0);
+	switch (i) {
+	case 0:
+		gl_FragColor.x = 1.0;
+		break;
+	case 1:
+		gl_FragColor.y = 1.0;
+		break;
+	default:
+		gl_FragColor.z = 1.0;
+		break;
+	}
+}
+
+[test]
+uniform int i 0
+draw rect -1 -1 1 1
+uniform int i 1
+draw rect 0 -1 1 1
+uniform int i 2
+draw rect -1 0 1 1
+
+relative probe rgba (0, 0) (1, 0, 0, 0)
+relative probe rgba (1, 0) (0, 1, 0, 0)
+relative probe rgba (0, 1) (0, 0, 1, 0)
-- 
1.8.3.1



More information about the Piglit mailing list