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

Juan A. Suarez Romero jasuarez at igalia.com
Mon May 9 11:09:34 UTC 2016


---
 ...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



More information about the Piglit mailing list