[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 22:55:26 UTC 2017


Can you add "# Bugzilla: 
https://bugs.freedesktop.org/show_bug.cgi?id=100303" directly in the test?

Except this, this patch is:

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

On 04/07/2017 12:44 AM, Timothy Arceri wrote:
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100303
> ---
>   ...-nested-return-in-loop-nested_in_if.shader_test | 31 ++++++++++++++++++++++
>   1 file changed, 31 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..aae3e47
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/execution/fs-nested-return-in-loop-nested_in_if.shader_test
> @@ -0,0 +1,31 @@
> +# Test return lowering when nested in a loop thats nested in an if.
> +[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, 0.0);
> +      }
> +   }
> +   return vec4(1.0, 0.0, 0.0, 0.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