[Piglit] [PATCH] glsl-1.10: tests return lowering for a loop nested in an if

Timothy Arceri tarceri at itsqueeze.com
Thu Apr 6 23:03:35 UTC 2017


V2: add bugzilla link to the tests comment, fixed w component of the return value.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100303
---
 ...-nested-return-in-loop-nested_in_if.shader_test | 33 ++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 tests/spec/glsl-1.10/execution/fs-nested-return-in-loop-nested_in_if.shader_test

diff --git a/tests/spec/glsl-1.10/execution/fs-nested-return-in-loop-nested_in_if.shader_test b/tests/spec/glsl-1.10/execution/fs-nested-return-in-loop-nested_in_if.shader_test
new file mode 100644
index 0000000..5486ca9
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/fs-nested-return-in-loop-nested_in_if.shader_test
@@ -0,0 +1,33 @@
+# Test return lowering when nested in a loop thats nested in an if.
+#
+# Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100303
+[require]
+GLSL >= 1.10
+
+[vertex shader passthrough]
+
+[fragment shader]
+uniform int a;
+
+vec4 func1()
+{
+   if(a >= 1) {
+      for(int i = 0; i < a; i++) {
+         return vec4(0.0, 1.0, 0.0, 1.0);
+      }
+   }
+   return vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+void main(void)
+{
+    gl_FragColor = func1();
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+
+uniform int a 1
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.9.3



More information about the Piglit mailing list