[Piglit] [PATCH] glsl-1.10: Try ternary operator with void expressions
Ian Romanick
idr at freedesktop.org
Mon Oct 20 10:54:05 PDT 2014
From: Ian Romanick <ian.d.romanick at intel.com>
As far as I can tell from the GLSL spec, this should work. However,
on both Mesa 9.2 and master (10.4-devel), it segfaults.
NOTE: This test currently fails on Mesa.
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
.../glsl-1.10/execution/void-ternary.shader_test | 48 ++++++++++++++++++++++
1 file changed, 48 insertions(+)
create mode 100644 tests/spec/glsl-1.10/execution/void-ternary.shader_test
diff --git a/tests/spec/glsl-1.10/execution/void-ternary.shader_test b/tests/spec/glsl-1.10/execution/void-ternary.shader_test
new file mode 100644
index 0000000..157090f
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/void-ternary.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+
+varying vec4 c;
+uniform bool b;
+
+void good(void)
+{
+ c = vec4(0, 1, 0, 1);
+}
+
+void bad(void)
+{
+ c = vec4(1, 0, 0, 1);
+}
+
+void main()
+{
+ b ? good() : bad();
+}
+
+[fragment shader]
+
+varying vec4 c;
+uniform bool b;
+
+void good(void)
+{
+ gl_FragColor = c;
+}
+
+void bad(void)
+{
+ gl_FragColor = c + vec4(0, 0, 1, 0);
+}
+
+void main()
+{
+ b ? good() : bad();
+}
+
+[test]
+uniform int b 1
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
--
1.8.1.4
More information about the Piglit
mailing list