[Piglit] [PATCH] Test multiple inout parameters with arrays of arrays

Ilia Mirkin imirkin at alum.mit.edu
Mon May 9 13:56:49 UTC 2016


While these tests are good, they are not testing arrays of arrays. I'm
thinking of vec4[5][5].
On May 9, 2016 7:09 AM, "Juan A. Suarez Romero" <jasuarez at igalia.com> wrote:

> ---
>  ...vs-inout-index-inout-mat2-col-array.shader_test | 35
> +++++++++++++++++++++
>  ...ndex-inout-vec4-array-element-array.shader_test | 36
> ++++++++++++++++++++++
>  2 files changed, 71 insertions(+)
>  create mode 100644
> tests/shaders/out-parameter-indexing/vs-inout-index-inout-mat2-col-array.shader_test
>  create mode 100644
> tests/shaders/out-parameter-indexing/vs-inout-index-inout-vec4-array-element-array.shader_test
>
> diff --git
> a/tests/shaders/out-parameter-indexing/vs-inout-index-inout-mat2-col-array.shader_test
> b/tests/shaders/out-parameter-indexing/vs-inout-index-inout-mat2-col-array.shader_test
> new file mode 100644
> index 0000000..14c5142
> --- /dev/null
> +++
> b/tests/shaders/out-parameter-indexing/vs-inout-index-inout-mat2-col-array.shader_test
> @@ -0,0 +1,35 @@
> +[require]
> +GLSL >= 1.20
> +
> +[vertex shader]
> +uniform int u = 1;
> +varying vec4 color;
> +
> +void func(inout int i, inout float f)
> +{
> +  i = 0;
> +  f = 1.;
> +}
> +
> +void main()
> +{
> +  mat2 m = mat2(0.);
> +  ivec4[] n = ivec4[](ivec4(0, 1, 1, 1), ivec4(1, 0, 0, 0));
> +  int i = u;
> +
> +  func(i, m[n[i].x][1]);
> +  color = vec4(m[1].x, m[1].y, m[0].x, m[0].y);
> +  gl_Position = gl_Vertex;
> +}
> +
> +[fragment shader]
> +varying vec4 color;
> +
> +void main()
> +{
> +  gl_FragColor = color;
> +}
> +
> +[test]
> +draw rect -1 -1 2 2
> +probe all rgb 0. 1. 0.
> diff --git
> a/tests/shaders/out-parameter-indexing/vs-inout-index-inout-vec4-array-element-array.shader_test
> b/tests/shaders/out-parameter-indexing/vs-inout-index-inout-vec4-array-element-array.shader_test
> new file mode 100644
> index 0000000..162ed51
> --- /dev/null
> +++
> b/tests/shaders/out-parameter-indexing/vs-inout-index-inout-vec4-array-element-array.shader_test
> @@ -0,0 +1,36 @@
> +[require]
> +GLSL >= 1.20
> +
> +[vertex shader]
> +
> +uniform int u = 1;
> +varying vec4 color;
> +
> +void func(inout int i, inout float f)
> +{
> +  i = 0;
> +  f = 1.;
> +}
> +
> +void main()
> +{
> +  vec4 v[] = vec4[](vec4(0.), vec4(0.));
> +  int w[] = int[](1, 0, 0, 0);
> +  int i = u;
> +
> +  func(i, v[1][w[i]]);
> +  color = v[1];
> +  gl_Position = gl_Vertex;
> +}
> +
> +[fragment shader]
> +varying vec4 color;
> +
> +void main()
> +{
> +  gl_FragColor = color;
> +}
> +
> +[test]
> +draw rect -1 -1 2 2
> +probe all rgb 1. 0. 0.
> --
> 2.5.5
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20160509/27f9b6bc/attachment.html>


More information about the Piglit mailing list