summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJuan A. Suarez Romero <jasuarez@igalia.com>2017-01-20 12:20:19 +0100
committerJuan A. Suarez Romero <jasuarez@igalia.com>2017-01-20 12:32:16 +0100
commit8a6d6f50fd1d3e2e69f5846b4cae30fbc82a0877 (patch)
tree65b131a30316139af6fbac2469453cd1141eec33 /tests
parent9861294a9d1a98338782998a03ae2c8a687f06da (diff)
Test multiple inout parameters with indirect array indexing
v2: Include component 'w' in the check (Eduardo Lima) Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/shaders/out-parameter-indexing/vs-inout-index-inout-mat2-col-array.shader_test35
-rw-r--r--tests/shaders/out-parameter-indexing/vs-inout-index-inout-vec4-array-element-array.shader_test36
2 files changed, 71 insertions, 0 deletions
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 000000000..840c6c5ff
--- /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 rgba 0. 1. 0. 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 000000000..8c3a9d2ee
--- /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 rgba 1. 0. 0. 0.