[Piglit] [PATCH] shaders: add test for recursive variable indexing into arrays

Timothy Arceri timothy.arceri at collabora.com
Thu Mar 3 22:20:13 UTC 2016


On Thu, 2016-03-03 at 09:31 +0100, Iago Toral Quiroga wrote:
> ---
>  ...l-recursive-variable-array-indexing.shader_test | 45
> ++++++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 tests/shaders/glsl-recursive-variable-array-
> indexing.shader_test
> 
> diff --git a/tests/shaders/glsl-recursive-variable-array-
> indexing.shader_test b/tests/shaders/glsl-recursive-variable-array-
> indexing.shader_test
> new file mode 100644
> index 0000000..40c838c
> --- /dev/null
> +++ b/tests/shaders/glsl-recursive-variable-array-
> indexing.shader_test

Please move the test to somewhere in test/spec/glsl-1.30 rather than
putting it in shaders. I believe shaders is a legacy folder from before
things were organised, its really hard to find anything in here when
looking for existing tests.

Otherwise - Reviewed-by: Timothy Arceri <timothy.arceri at collabora.com>

> @@ -0,0 +1,45 @@
> +# Tests recursive variable indexing into arrays
> +# See https://bugs.freedesktop.org/show_bug.cgi?id=89607
> +
> +[require]
> +GLSL >= 1.30
> +
> +[vertex shader]
> +#version 130
> +
> +in vec4 piglit_vertex;
> +out vec4 color;
> +
> +vec4 temps[3];
> +vec4 temps3[3];
> +
> +void main()
> +{
> +	temps[0]  = vec4(1 , 0.50, 0.60, 0.90);
> +	temps[1]  = vec4(2 , 0.30, 0.70, 0.90);
> +	temps[2]  = vec4(0 , 0.15, 0.25, 0.90);
> +
> +	temps3[0] = vec4(1, 0.30, 0.40, 0.50);
> +	temps3[1] = vec4(2, 0.40, 0.50 ,0.60);
> +	temps3[2] = vec4(0, 0.50, 0.60, 0.70);
> +
> +        color =
> temps[int(temps3[int(temps[int(temps3[0].x)].x)].x)];
> +
> +	gl_Position = piglit_vertex;
> +}
> +
> +[fragment shader]
> +#version 130
> +in vec4 color;
> +void main()
> +{
> +	gl_FragColor = color;
> +}
> +
> +[test]
> +clear color 0.0 0.0 0.0 0.0
> +clear
> +ortho
> +draw rect -1 -1 2 2
> +probe rgba  2 2  1.0 0.5 0.6 0.9
> +


More information about the Piglit mailing list