[Piglit] [PATCH 3/4] glsl-1.30: Add test for broken "break" behavior in switch statements.
Eric Anholt
eric at anholt.net
Fri Jan 27 10:11:50 PST 2012
---
.../switch/fs-exec-after-break.shader_test | 34 ++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
create mode 100644 tests/spec/glsl-1.30/execution/switch/fs-exec-after-break.shader_test
diff --git a/tests/spec/glsl-1.30/execution/switch/fs-exec-after-break.shader_test b/tests/spec/glsl-1.30/execution/switch/fs-exec-after-break.shader_test
new file mode 100644
index 0000000..d58eae8
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/switch/fs-exec-after-break.shader_test
@@ -0,0 +1,34 @@
+[require]
+GLSL >= 1.30
+
+[vertex shader]
+#version 130
+void main()
+{
+ gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 130
+
+uniform int i;
+
+void main()
+{
+ switch (i) {
+ case 0:
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0);
+ break;
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0);
+
+ default:
+ gl_FragColor = vec4(1.0, 0.0, 1.0, 0.0);
+ break;
+ }
+}
+
+[test]
+uniform int i 0
+draw rect -1 -1 2 2
+
+probe all rgba 0 1 0 0
--
1.7.7.3
More information about the Piglit
mailing list