Catches this mesa failure:

ir_validate.cpp:360: virtual ir_visitor_status
ir_validate::visit_leave(ir_expression*): Assertion
`ir->operands[0]->type == ir->operands[1]->type' failed.
---
 .../glsl-1.30/execution/switch/fs-uint.shader_test |   33 ++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 tests/spec/glsl-1.30/execution/switch/fs-uint.shader_test

diff --git a/tests/spec/glsl-1.30/execution/switch/fs-uint.shader_test 
b/tests/spec/glsl-1.30/execution/switch/fs-uint.shader_test
new file mode 100644
index 0000000..f32e384
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/switch/fs-uint.shader_test
@@ -0,0 +1,33 @@
+[require]
+GLSL >= 1.30
+
+[vertex shader]
+#version 130
+void main()
+{
+       gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 130
+
+uniform uint i;
+
+void main()
+{
+       gl_FragColor = vec4(0.0);
+
+       switch (i) {
+       case 0u:
+               gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0);
+               break;
+       default:
+               gl_FragColor += vec4(1.0, 0.0, 0.0, 0.0);
+               break;
+       }
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgb 0 1 0 0
+
-- 
1.7.10

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to