Test multiple inout parameters with arrays of arrays

Submitted by Juan A. Suarez Romero on May 9, 2016, 11:09 a.m.

Details

Message ID 1462792174-29196-1-git-send-email-jasuarez@igalia.com
State New
Headers show
Series "Test multiple inout parameters with arrays of arrays" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Juan A. Suarez Romero May 9, 2016, 11:09 a.m.
---
 ...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

Patch hide | download patch | download mbox

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.

Comments

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@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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
>
These tests cover two use cases:

- Indirect arrays (arrays indexed from other arrays)
- Arrays of arrays (requires GL_ARB_arrays_of_arrays)


Juan A. Suarez Romero (2):
  Test multiple inout parameters with indirect array indexing
  Test multiple inout parameters with arrays of arrays

 ...vs-inout-index-inout-mat2-col-array.shader_test | 35 ++++++++++++++++++++
 ...ndex-inout-vec4-array-element-array.shader_test | 36 ++++++++++++++++++++
 ...nout-index-inout-vec4-array-element.shader_test | 38 ++++++++++++++++++++++
 3 files changed, 109 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
 create mode 100644 tests/spec/arb_arrays_of_arrays/execution/inout/vs-inout-index-inout-vec4-array-element.shader_test
On Mon, 2016-05-09 at 09:56 -0400, Ilia Mirkin wrote:
> While these tests are good, they are not testing arrays of arrays.
> I'm thinking of vec4[5][5].

Thanks for the clarification!

Submitted a new version that contains a test for arrays of arrays.

Note that this requires GL_ARB_array_of_arrays extension. So I've added
the test under that extension.


	J.A.
On Mon, 2016-05-09 at 16:51 +0200, Juan A. Suarez Romero wrote:
> These tests cover two use cases:
> 
> - Indirect arrays (arrays indexed from other arrays)
> - Arrays of arrays (requires GL_ARB_arrays_of_arrays)
> 
> 
> Juan A. Suarez Romero (2):
>   Test multiple inout parameters with indirect array indexing
>   Test multiple inout parameters with arrays of arrays
> 


Gently pinging someone that could take a look.


	J.A.