[Piglit] [PATCH] glsl-1.10: tests return lowering for a loop nested in an if
Samuel Pitoiset
samuel.pitoiset at gmail.com
Thu Apr 6 23:08:29 UTC 2017
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
On 04/07/2017 01:03 AM, Timothy Arceri wrote:
> 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
>
More information about the Piglit
mailing list