diff options
author | Timothy Arceri <tarceri@itsqueeze.com> | 2017-04-07 09:03:35 +1000 |
---|---|---|
committer | Timothy Arceri <tarceri@itsqueeze.com> | 2017-04-08 11:27:12 +1000 |
commit | ae996f5bea1160a9c14e88343a37dcd5bfa9daa0 (patch) | |
tree | 6c7d51d88f7a179aa6e7cf0a5ecfa2b227dd2620 | |
parent | 17993128e1a54bf143290c2fd8de155ae8e5af85 (diff) |
glsl-1.10: tests return lowering for a loop nested in an if
V2: add bugzilla link to the tests comment, fixed w component of the return value.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100303
-rw-r--r-- | tests/spec/glsl-1.10/execution/fs-nested-return-in-loop-nested_in_if.shader_test | 33 |
1 files changed, 33 insertions, 0 deletions
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 000000000..5486ca9f4 --- /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 |