diff options
author | Tom Gall <tom.gall@linaro.org> | 2013-01-08 11:09:03 -0600 |
---|---|---|
committer | Tom Gall <tom.gall@linaro.org> | 2013-04-22 11:21:28 -0500 |
commit | 782bc7dea2f61fe54931d2bebb784ee9a6a1e74a (patch) | |
tree | ed1da1f708bd3c4ba63f4cdb8e93d7e04fef645f | |
parent | 7a2541940306d4b87da095a47442530be61185ef (diff) |
shader_runner: port glsl 1.20 versions of tests to glsl es 1.00
456 files changed, 34702 insertions, 0 deletions
diff --git a/tests/spec/glsl-es-1.00/execution/1.20/clipping/clipping.out b/tests/spec/glsl-es-1.00/execution/1.20/clipping/clipping.out new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/clipping/clipping.out diff --git a/tests/spec/glsl-es-1.00/execution/1.20/clipping/fixed-clip-enables.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/clipping/fixed-clip-enables.shader_test new file mode 100644 index 00000000..93995a5c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/clipping/fixed-clip-enables.shader_test @@ -0,0 +1,141 @@ +# This test reproduces bug 41603 +# (https://bugs.freedesktop.org/show_bug.cgi?id=41603). +# +# This test sets up 6 clipping planes using fixed vertex +# functionality, which clip a rectangle to a hexagon shape. Then it +# tests various combinations of enables for the 6 clipping planes, and +# verifies that they all create the correct shape. +# +# To verify that each enable works, the combinations of enables were +# chosen such that: +# - Every plane is enabled at least once and disbled at least once. +# - Every plane is enabled and disabled in a different pattern. +# +# Note: Some implementations have bugs related to improper coordinate +# transformations of clip planes (which are already adequately tested +# by the clip-plane-transformation test), so to avoid those bugs +# contaminating the results of this test, we don't do any coordinate +# transformation in this test. + +[require] +GLSL >= 1.20 + +[fragment shader] +#version 120 +void main(void) +{ + gl_FragColor = vec4(1, 1, 1, 1); +} + +[test] +clip plane 0 0 1 0 0.5 +clip plane 1 -1 1 0 0.8 +clip plane 2 -1 -1 0 0.8 +clip plane 3 0 -1 0 0.5 +clip plane 4 1 -1 0 0.8 +clip plane 5 1 1 0 0.8 +clear color 0.0 0.0 0.0 0.0 + +# Test with planes 0, 2, and 4 enabled. +enable GL_CLIP_PLANE0 +disable GL_CLIP_PLANE1 +enable GL_CLIP_PLANE2 +disable GL_CLIP_PLANE3 +enable GL_CLIP_PLANE4 +disable GL_CLIP_PLANE5 +clear +draw rect -1 -1 2 2 + +# Test points inside each hexagon edge +relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0) + +# Test points outside each hexagon edge +relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0) # clipped by plane 0 +relative probe rgba (0.8, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 1 +relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 2 +relative probe rgba (0.5, 0.8) (1.0, 1.0, 1.0, 1.0) # clipped by plane 3 +relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 4 +relative probe rgba (0.2, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 5 + +# Test with planes 0, 1, 4, and 5 enabled. +enable GL_CLIP_PLANE0 +enable GL_CLIP_PLANE1 +disable GL_CLIP_PLANE2 +disable GL_CLIP_PLANE3 +enable GL_CLIP_PLANE4 +enable GL_CLIP_PLANE5 +clear +draw rect -1 -1 2 2 + +# Test points inside each hexagon edge +relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0) + +# Test points outside each hexagon edge +relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0) # clipped by plane 0 +relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 1 +relative probe rgba (0.8, 0.7) (1.0, 1.0, 1.0, 1.0) # clipped by plane 2 +relative probe rgba (0.5, 0.8) (1.0, 1.0, 1.0, 1.0) # clipped by plane 3 +relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 4 +relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 5 + +# Test with planes 0, 1, 2, and 3 enabled. +enable GL_CLIP_PLANE0 +enable GL_CLIP_PLANE1 +enable GL_CLIP_PLANE2 +enable GL_CLIP_PLANE3 +disable GL_CLIP_PLANE4 +disable GL_CLIP_PLANE5 +clear +draw rect -1 -1 2 2 + +# Test points inside each hexagon edge +relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0) + +# Test points outside each hexagon edge +relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0) # clipped by plane 0 +relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 1 +relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 2 +relative probe rgba (0.5, 0.8) (0.0, 0.0, 0.0, 0.0) # clipped by plane 3 +relative probe rgba (0.2, 0.7) (1.0, 1.0, 1.0, 1.0) # clipped by plane 4 +relative probe rgba (0.2, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 5 + +# Test with planes 4 and 5 enabled. +disable GL_CLIP_PLANE0 +disable GL_CLIP_PLANE1 +disable GL_CLIP_PLANE2 +disable GL_CLIP_PLANE3 +enable GL_CLIP_PLANE4 +enable GL_CLIP_PLANE5 +clear +draw rect -1 -1 2 2 + +# Test points inside each hexagon edge +relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0) + +# Test points outside each hexagon edge +relative probe rgba (0.5, 0.2) (1.0, 1.0, 1.0, 1.0) # clipped by plane 0 +relative probe rgba (0.8, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 1 +relative probe rgba (0.8, 0.7) (1.0, 1.0, 1.0, 1.0) # clipped by plane 2 +relative probe rgba (0.5, 0.8) (1.0, 1.0, 1.0, 1.0) # clipped by plane 3 +relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 4 +relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 5 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-const-accept.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-const-accept.shader_test new file mode 100644 index 00000000..6c2b56cf --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-const-accept.shader_test @@ -0,0 +1,42 @@ +# From the GL 2.1 spec, section 2.17 (Clipping): +# +# All points with eye coordinates (x_e y_e z_e w_e)^T that satisfy +# +# (x_e) +# (p_1' p_2' p_3' p_4')(y_e) >= 0 +# (z_e) +# (w_e) +# +# lie in the half-space defined by the plane; points that do not +# satisfy this condition do not lie in the half-space. +# +# This test checks that gl_ClipVertex works properly for the trivial +# case where gl_ClipVertex is a constant value satisfying the above +# inequality. + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + gl_ClipVertex = vec4(1.0, 0.0, 0.0, 0.0); +} + +[fragment shader] +#version 120 +void main(void) +{ + gl_FragColor = vec4(1.0); +} + +[test] +clear color 0.0 0.0 0.0 0.0 +clear +clip plane 0 1.0 0.0 0.0 0.0 # accept points where gl_ClipVertex.x >= 0 +enable GL_CLIP_PLANE0 +draw rect -1 -1 2 2 +probe all rgba 1.0 1.0 1.0 1.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-const-reject.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-const-reject.shader_test new file mode 100644 index 00000000..0bb08ea0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-const-reject.shader_test @@ -0,0 +1,42 @@ +# From the GL 2.1 spec, section 2.17 (Clipping): +# +# All points with eye coordinates (x_e y_e z_e w_e)^T that satisfy +# +# (x_e) +# (p_1' p_2' p_3' p_4')(y_e) >= 0 +# (z_e) +# (w_e) +# +# lie in the half-space defined by the plane; points that do not +# satisfy this condition do not lie in the half-space. +# +# This test checks that gl_ClipVertex works properly for the trivial +# case where gl_ClipVertex is a constant value not satisfying the +# above inequality. + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + gl_ClipVertex = vec4(-1.0, 0.0, 0.0, 0.0); +} + +[fragment shader] +#version 120 +void main(void) +{ + gl_FragColor = vec4(1.0); +} + +[test] +clear color 0.0 0.0 0.0 0.0 +clear +clip plane 0 1.0 0.0 0.0 0.0 # accept points where gl_ClipVertex.x >= 0 +enable GL_CLIP_PLANE0 +draw rect -1 -1 2 2 +probe all rgba 0.0 0.0 0.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-different-from-position.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-different-from-position.shader_test new file mode 100644 index 00000000..c7dae897 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-different-from-position.shader_test @@ -0,0 +1,62 @@ +# [description] +# Use all 6 clip planes to clip a rectangle to a hexagon shape. +# +# In this test, gl_Position and gl_ClipVertex are different to verify +# that gl_Position determines screen position and gl_ClipVertex +# determines clipping. + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + // Transform gl_ClipVertex in an arbitrary way so that + // we can verify it is being used for clipping instead of + // gl_Position. + gl_ClipVertex = gl_Vertex * vec4(10.0, 10.0, 1.0, 1.0); +} + +[fragment shader] +#version 120 +void main(void) +{ + gl_FragColor = vec4(1, 1, 1, 1); +} + +[test] +clear color 0.0 0.0 0.0 0.0 +clear +ortho 0 1 0 1 +clip plane 0 0 1 0 -2.5 +clip plane 1 -1 1 0 4 +clip plane 2 -1 -1 0 14 +clip plane 3 0 -1 0 7.5 +clip plane 4 1 -1 0 4 +clip plane 5 1 1 0 -6 +enable GL_CLIP_PLANE0 +enable GL_CLIP_PLANE1 +enable GL_CLIP_PLANE2 +enable GL_CLIP_PLANE3 +enable GL_CLIP_PLANE4 +enable GL_CLIP_PLANE5 +draw rect 0.1 0.1 0.8 0.8 + +# Test points inside each hexagon edge +relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0) + +# Test points outside each hexagon edge +relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0) +relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0) +relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0) +relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0) +relative probe rgba (0.5, 0.8) (0.0, 0.0, 0.0, 0.0) +relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0) diff --git a/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-enables.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-enables.shader_test new file mode 100644 index 00000000..b93d16f3 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-enables.shader_test @@ -0,0 +1,147 @@ +# This test sets up 6 clipping planes using gl_ClipVertex, which clip +# a rectangle to a hexagon shape. Then it tests various combinations +# of enables for the 6 clipping planes, and verifies that they all +# create the correct shape. +# +# To verify that each enable works, the combinations of enables were +# chosen such that: +# - Every plane is enabled at least once and disbled at least once. +# - Every plane is enabled and disabled in a different pattern. +# +# Note: Some implementations have bugs related to improper coordinate +# transformations of clip planes (which are already adequately tested +# by the clip-plane-transformation test), so to avoid those bugs +# contaminating the results of this test, we don't do any coordinate +# transformation in this test. + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_Vertex; + + gl_ClipVertex = gl_Position; +} + +[fragment shader] +#version 120 +void main(void) +{ + gl_FragColor = vec4(1, 1, 1, 1); +} + +[test] +clip plane 0 0 1 0 0.5 +clip plane 1 -1 1 0 0.8 +clip plane 2 -1 -1 0 0.8 +clip plane 3 0 -1 0 0.5 +clip plane 4 1 -1 0 0.8 +clip plane 5 1 1 0 0.8 +clear color 0.0 0.0 0.0 0.0 + +# Test with planes 0, 2, and 4 enabled. +enable GL_CLIP_PLANE0 +disable GL_CLIP_PLANE1 +enable GL_CLIP_PLANE2 +disable GL_CLIP_PLANE3 +enable GL_CLIP_PLANE4 +disable GL_CLIP_PLANE5 +clear +draw rect -1 -1 2 2 + +# Test points inside each hexagon edge +relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0) + +# Test points outside each hexagon edge +relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0) # clipped by plane 0 +relative probe rgba (0.8, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 1 +relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 2 +relative probe rgba (0.5, 0.8) (1.0, 1.0, 1.0, 1.0) # clipped by plane 3 +relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 4 +relative probe rgba (0.2, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 5 + +# Test with planes 0, 1, 4, and 5 enabled. +enable GL_CLIP_PLANE0 +enable GL_CLIP_PLANE1 +disable GL_CLIP_PLANE2 +disable GL_CLIP_PLANE3 +enable GL_CLIP_PLANE4 +enable GL_CLIP_PLANE5 +clear +draw rect -1 -1 2 2 + +# Test points inside each hexagon edge +relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0) + +# Test points outside each hexagon edge +relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0) # clipped by plane 0 +relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 1 +relative probe rgba (0.8, 0.7) (1.0, 1.0, 1.0, 1.0) # clipped by plane 2 +relative probe rgba (0.5, 0.8) (1.0, 1.0, 1.0, 1.0) # clipped by plane 3 +relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 4 +relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 5 + +# Test with planes 0, 1, 2, and 3 enabled. +enable GL_CLIP_PLANE0 +enable GL_CLIP_PLANE1 +enable GL_CLIP_PLANE2 +enable GL_CLIP_PLANE3 +disable GL_CLIP_PLANE4 +disable GL_CLIP_PLANE5 +clear +draw rect -1 -1 2 2 + +# Test points inside each hexagon edge +relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0) + +# Test points outside each hexagon edge +relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0) # clipped by plane 0 +relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 1 +relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 2 +relative probe rgba (0.5, 0.8) (0.0, 0.0, 0.0, 0.0) # clipped by plane 3 +relative probe rgba (0.2, 0.7) (1.0, 1.0, 1.0, 1.0) # clipped by plane 4 +relative probe rgba (0.2, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 5 + +# Test with planes 4 and 5 enabled. +disable GL_CLIP_PLANE0 +disable GL_CLIP_PLANE1 +disable GL_CLIP_PLANE2 +disable GL_CLIP_PLANE3 +enable GL_CLIP_PLANE4 +enable GL_CLIP_PLANE5 +clear +draw rect -1 -1 2 2 + +# Test points inside each hexagon edge +relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0) + +# Test points outside each hexagon edge +relative probe rgba (0.5, 0.2) (1.0, 1.0, 1.0, 1.0) # clipped by plane 0 +relative probe rgba (0.8, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 1 +relative probe rgba (0.8, 0.7) (1.0, 1.0, 1.0, 1.0) # clipped by plane 2 +relative probe rgba (0.5, 0.8) (1.0, 1.0, 1.0, 1.0) # clipped by plane 3 +relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 4 +relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 5 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-equal-to-position.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-equal-to-position.shader_test new file mode 100644 index 00000000..50b4856f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-equal-to-position.shader_test @@ -0,0 +1,57 @@ +# [description] +# Use all 6 clip planes to clip a rectangle to a hexagon shape. +# +# In this test, gl_Position and gl_ClipVertex are the same. + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + gl_ClipVertex = gl_Position; +} + +[fragment shader] +#version 120 +void main(void) +{ + gl_FragColor = vec4(1, 1, 1, 1); +} + +[test] +clear color 0.0 0.0 0.0 0.0 +clear +ortho 0 1 0 1 +clip plane 0 0 1 0 0.5 +clip plane 1 -1 1 0 0.8 +clip plane 2 -1 -1 0 0.8 +clip plane 3 0 -1 0 0.5 +clip plane 4 1 -1 0 0.8 +clip plane 5 1 1 0 0.8 +enable GL_CLIP_PLANE0 +enable GL_CLIP_PLANE1 +enable GL_CLIP_PLANE2 +enable GL_CLIP_PLANE3 +enable GL_CLIP_PLANE4 +enable GL_CLIP_PLANE5 +draw rect 0.1 0.1 0.8 0.8 + +# Test points inside each hexagon edge +relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0) + +# Test points outside each hexagon edge +relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0) +relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0) +relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0) +relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0) +relative probe rgba (0.5, 0.8) (0.0, 0.0, 0.0, 0.0) +relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0) diff --git a/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-homogeneity.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-homogeneity.shader_test new file mode 100644 index 00000000..615ecf9e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-homogeneity.shader_test @@ -0,0 +1,69 @@ +# This test verifies that the homogeneous coordinate of gl_ClipVertex +# is properly respected, by doubling all the coordinates of +# gl_ClipVertex (including the homogeneous coordinate) and verifying +# that the clipped shape is still correct. +# +# In addition, this test: +# - uses all 6 clip planes to clip a rectangle to a hexagon shape. +# - sets gl_Position and gl_ClipVertex to different values, to verify +# that gl_Position determines screen position and gl_ClipVertex +# determines clipping. + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + // Transform gl_ClipVertex in an arbitrary way so that + // we can verify it is being used for clipping instead of + // gl_Position. The x and y coordinates are multiplied by 5, + // and the homogeneous coordinate is multiplied by 0.5, so the + // net result should be that x and y are scaled by a factor of + // 10. + gl_ClipVertex = gl_Vertex * vec4(5.0, 5.0, 1.0, 0.5); +} + +[fragment shader] +#version 120 +void main(void) +{ + gl_FragColor = vec4(1, 1, 1, 1); +} + +[test] +clear color 0.0 0.0 0.0 0.0 +clear +ortho 0 1 0 1 +clip plane 0 0 1 0 -2.5 +clip plane 1 -1 1 0 4 +clip plane 2 -1 -1 0 14 +clip plane 3 0 -1 0 7.5 +clip plane 4 1 -1 0 4 +clip plane 5 1 1 0 -6 +enable GL_CLIP_PLANE0 +enable GL_CLIP_PLANE1 +enable GL_CLIP_PLANE2 +enable GL_CLIP_PLANE3 +enable GL_CLIP_PLANE4 +enable GL_CLIP_PLANE5 +draw rect 0.1 0.1 0.8 0.8 + +# Test points inside each hexagon edge +relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0) +relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0) + +# Test points outside each hexagon edge +relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0) +relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0) +relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0) +relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0) +relative probe rgba (0.5, 0.8) (0.0, 0.0, 0.0, 0.0) +relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0) diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-assign-varied-struct.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-assign-varied-struct.shader_test new file mode 100644 index 00000000..f3ad3e84 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-assign-varied-struct.shader_test @@ -0,0 +1,36 @@ +# Test initialization of an array of structures where the elements of +# the structure do not all have the same vector size. + +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main(void) +{ + gl_Position = vertex; +} + +[fragment shader] + +void main(void) +{ + float x = 3.0; + struct s { float f; vec3 v; }; + s a[1]=s[](s(x,vec3(x))); + if (a[0].f==3.0) + gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); // green + else + gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); // red +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 1.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2-ivec.shader_test new file mode 100644 index 00000000..c6925f40 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2-ivec.shader_test @@ -0,0 +1,54 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec2 c = ivec2(2, 3); +const ivec2 r = ivec2(4, 5); +uniform mat2 expected = mat2(8, 12, 10, 15); + +void main() { + mat2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2.shader_test new file mode 100644 index 00000000..a8e91542 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2.shader_test @@ -0,0 +1,34 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + + +const vec2 c = vec2(2, 3); +const vec2 r = vec2(4, 5); +uniform mat2 expected = mat2(8, 12, 10, 15); + +void main() { + mat2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x2-ivec.shader_test new file mode 100644 index 00000000..dc392010 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x2-ivec.shader_test @@ -0,0 +1,54 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec2 c = ivec2(2, 3); +const ivec2 r = ivec2(4, 5); +uniform mat2x2 expected = mat2x2(8, 12, 10, 15); + +void main() { + mat2x2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x2.shader_test new file mode 100644 index 00000000..370c3c8b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x2.shader_test @@ -0,0 +1,34 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + + +const vec2 c = vec2(2, 3); +const vec2 r = vec2(4, 5); +uniform mat2x2 expected = mat2x2(8, 12, 10, 15); + +void main() { + mat2x2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x3-ivec.shader_test new file mode 100644 index 00000000..9cb881f7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x3-ivec.shader_test @@ -0,0 +1,56 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x3fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec3 c = ivec3(2, 3, 4); +const ivec2 r = ivec2(5, 6); +uniform mat2x3 expected = mat2x3(10, 15, 20, 12, 18, 24); + +void main() { + mat2x3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x3.shader_test new file mode 100644 index 00000000..925cc8d7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x3.shader_test @@ -0,0 +1,35 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x3fv only exists in OpenGL 2.1 or later. + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + + +const vec3 c = vec3(2, 3, 4); +const vec2 r = vec2(5, 6); +uniform mat2x3 expected = mat2x3(10, 15, 20, 12, 18, 24); + +void main() { + mat2x3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x4-ivec.shader_test new file mode 100644 index 00000000..a67c2051 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x4-ivec.shader_test @@ -0,0 +1,56 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec4 c = ivec4(2, 3, 4, 5); +const ivec2 r = ivec2(6, 7); +uniform mat2x4 expected = mat2x4(12, 18, 24, 30, 14, 21, 28, 35); + +void main() { + mat2x4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x4.shader_test new file mode 100644 index 00000000..214a1128 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2x4.shader_test @@ -0,0 +1,36 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + + +const vec4 c = vec4(2, 3, 4, 5); +const vec2 r = vec2(6, 7); +uniform mat2x4 expected = mat2x4(12, 18, 24, 30, 14, 21, 28, 35); + +void main() { + mat2x4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3-ivec.shader_test new file mode 100644 index 00000000..d2e11a6e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3-ivec.shader_test @@ -0,0 +1,54 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec3 c = ivec3(2, 3, 4); +const ivec3 r = ivec3(5, 6, 7); +uniform mat3 expected = mat3(10, 15, 20, 12, 18, 24, 14, 21, 28); + +void main() { + mat3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3.shader_test new file mode 100644 index 00000000..d5011152 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3.shader_test @@ -0,0 +1,34 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + + +const vec3 c = vec3(2, 3, 4); +const vec3 r = vec3(5, 6, 7); +uniform mat3 expected = mat3(10, 15, 20, 12, 18, 24, 14, 21, 28); + +void main() { + mat3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x2-ivec.shader_test new file mode 100644 index 00000000..99292140 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x2-ivec.shader_test @@ -0,0 +1,56 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec2 c = ivec2(2, 3); +const ivec3 r = ivec3(4, 5, 6); +uniform mat3x2 expected = mat3x2(8, 12, 10, 15, 12, 18); + +void main() { + mat3x2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x2.shader_test new file mode 100644 index 00000000..3e1ea9eb --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x2.shader_test @@ -0,0 +1,36 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + + +const vec2 c = vec2(2, 3); +const vec3 r = vec3(4, 5, 6); +uniform mat3x2 expected = mat3x2(8, 12, 10, 15, 12, 18); + +void main() { + mat3x2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x3-ivec.shader_test new file mode 100644 index 00000000..8ad24d4c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x3-ivec.shader_test @@ -0,0 +1,54 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec3 c = ivec3(2, 3, 4); +const ivec3 r = ivec3(5, 6, 7); +uniform mat3x3 expected = mat3x3(10, 15, 20, 12, 18, 24, 14, 21, 28); + +void main() { + mat3x3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x3.shader_test new file mode 100644 index 00000000..5371ac93 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x3.shader_test @@ -0,0 +1,34 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + + +const vec3 c = vec3(2, 3, 4); +const vec3 r = vec3(5, 6, 7); +uniform mat3x3 expected = mat3x3(10, 15, 20, 12, 18, 24, 14, 21, 28); + +void main() { + mat3x3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x4-ivec.shader_test new file mode 100644 index 00000000..ef994660 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x4-ivec.shader_test @@ -0,0 +1,56 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec4 c = ivec4(2, 3, 4, 5); +const ivec3 r = ivec3(6, 7, 8); +uniform mat3x4 expected = mat3x4(12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40); + +void main() { + mat3x4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x4.shader_test new file mode 100644 index 00000000..dd0d4185 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat3x4.shader_test @@ -0,0 +1,36 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + + +const vec4 c = vec4(2, 3, 4, 5); +const vec3 r = vec3(6, 7, 8); +uniform mat3x4 expected = mat3x4(12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40); + +void main() { + mat3x4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4-ivec.shader_test new file mode 100644 index 00000000..441ae99a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4-ivec.shader_test @@ -0,0 +1,54 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec4 c = ivec4(2, 3, 4, 5); +const ivec4 r = ivec4(6, 7, 8, 9); +uniform mat4 expected = mat4(12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40, 18, 27, 36, 45); + +void main() { + mat4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4.shader_test new file mode 100644 index 00000000..ac73bf6a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4.shader_test @@ -0,0 +1,34 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + + +const vec4 c = vec4(2, 3, 4, 5); +const vec4 r = vec4(6, 7, 8, 9); +uniform mat4 expected = mat4(12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40, 18, 27, 36, 45); + +void main() { + mat4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x2-ivec.shader_test new file mode 100644 index 00000000..0d13ff5a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x2-ivec.shader_test @@ -0,0 +1,56 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec2 c = ivec2(2, 3); +const ivec4 r = ivec4(4, 5, 6, 7); +uniform mat4x2 expected = mat4x2(8, 12, 10, 15, 12, 18, 14, 21); + +void main() { + mat4x2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x2.shader_test new file mode 100644 index 00000000..fe76b5dc --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x2.shader_test @@ -0,0 +1,36 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + + +const vec2 c = vec2(2, 3); +const vec4 r = vec4(4, 5, 6, 7); +uniform mat4x2 expected = mat4x2(8, 12, 10, 15, 12, 18, 14, 21); + +void main() { + mat4x2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x3-ivec.shader_test new file mode 100644 index 00000000..f46e29a4 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x3-ivec.shader_test @@ -0,0 +1,56 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x3fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec3 c = ivec3(2, 3, 4); +const ivec4 r = ivec4(5, 6, 7, 8); +uniform mat4x3 expected = mat4x3(10, 15, 20, 12, 18, 24, 14, 21, 28, 16, 24, 32); + +void main() { + mat4x3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x3.shader_test new file mode 100644 index 00000000..168957bf --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x3.shader_test @@ -0,0 +1,36 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x3fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + + +const vec3 c = vec3(2, 3, 4); +const vec4 r = vec4(5, 6, 7, 8); +uniform mat4x3 expected = mat4x3(10, 15, 20, 12, 18, 24, 14, 21, 28, 16, 24, 32); + +void main() { + mat4x3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x4-ivec.shader_test new file mode 100644 index 00000000..5fa7d9a3 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x4-ivec.shader_test @@ -0,0 +1,54 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec4 c = ivec4(2, 3, 4, 5); +const ivec4 r = ivec4(6, 7, 8, 9); +uniform mat4x4 expected = mat4x4(12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40, 18, 27, 36, 45); + +void main() { + mat4x4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x4.shader_test new file mode 100644 index 00000000..acabddc5 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat4x4.shader_test @@ -0,0 +1,34 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + + +const vec4 c = vec4(2, 3, 4, 5); +const vec4 r = vec4(6, 7, 8, 9); +uniform mat4x4 expected = mat4x4(12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40, 18, 27, 36, 45); + +void main() { + mat4x4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2-ivec.shader_test new file mode 100644 index 00000000..c1a8eb0c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2-ivec.shader_test @@ -0,0 +1,74 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec2 c; +uniform ivec2 r; +uniform mat2 expected; + +void main() { + mat2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec2 c 2 3 +uniform ivec2 r 4 5 +uniform mat2x2 expected 8 12 10 15 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec2 c 3 4 +uniform ivec2 r 5 6 +uniform mat2x2 expected 15 20 18 24 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec2 c 4 5 +uniform ivec2 r 6 7 +uniform mat2x2 expected 24 30 28 35 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec2 c 5 6 +uniform ivec2 r 7 8 +uniform mat2x2 expected 35 42 40 48 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2.shader_test new file mode 100644 index 00000000..393d36b4 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2.shader_test @@ -0,0 +1,54 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + +uniform vec2 c; +uniform vec2 r; +uniform mat2 expected; + +void main() { + mat2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec2 c 2 3 +uniform vec2 r 4 5 +uniform mat2x2 expected 8 12 10 15 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec2 c 3 4 +uniform vec2 r 5 6 +uniform mat2x2 expected 15 20 18 24 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec2 c 4 5 +uniform vec2 r 6 7 +uniform mat2x2 expected 24 30 28 35 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec2 c 5 6 +uniform vec2 r 7 8 +uniform mat2x2 expected 35 42 40 48 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x2-ivec.shader_test new file mode 100644 index 00000000..8b2a669e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x2-ivec.shader_test @@ -0,0 +1,74 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec2 c; +uniform ivec2 r; +uniform mat2x2 expected; + +void main() { + mat2x2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec2 c 2 3 +uniform ivec2 r 4 5 +uniform mat2x2 expected 8 12 10 15 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec2 c 3 4 +uniform ivec2 r 5 6 +uniform mat2x2 expected 15 20 18 24 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec2 c 4 5 +uniform ivec2 r 6 7 +uniform mat2x2 expected 24 30 28 35 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec2 c 5 6 +uniform ivec2 r 7 8 +uniform mat2x2 expected 35 42 40 48 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x2.shader_test new file mode 100644 index 00000000..e170e5fd --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x2.shader_test @@ -0,0 +1,54 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + +uniform vec2 c; +uniform vec2 r; +uniform mat2x2 expected; + +void main() { + mat2x2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec2 c 2 3 +uniform vec2 r 4 5 +uniform mat2x2 expected 8 12 10 15 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec2 c 3 4 +uniform vec2 r 5 6 +uniform mat2x2 expected 15 20 18 24 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec2 c 4 5 +uniform vec2 r 6 7 +uniform mat2x2 expected 24 30 28 35 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec2 c 5 6 +uniform vec2 r 7 8 +uniform mat2x2 expected 35 42 40 48 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x3-ivec.shader_test new file mode 100644 index 00000000..f384c372 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x3-ivec.shader_test @@ -0,0 +1,76 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x3fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec3 c; +uniform ivec2 r; +uniform mat2x3 expected; + +void main() { + mat2x3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec3 c 2 3 4 +uniform ivec2 r 5 6 +uniform mat2x3 expected 10 15 20 12 18 24 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec3 c 3 4 5 +uniform ivec2 r 6 7 +uniform mat2x3 expected 18 24 30 21 28 35 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec3 c 4 5 6 +uniform ivec2 r 7 8 +uniform mat2x3 expected 28 35 42 32 40 48 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec3 c 5 6 7 +uniform ivec2 r 8 9 +uniform mat2x3 expected 40 48 56 45 54 63 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x3.shader_test new file mode 100644 index 00000000..a9c343bc --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x3.shader_test @@ -0,0 +1,56 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x3fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + +uniform vec3 c; +uniform vec2 r; +uniform mat2x3 expected; + +void main() { + mat2x3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec3 c 2 3 4 +uniform vec2 r 5 6 +uniform mat2x3 expected 10 15 20 12 18 24 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec3 c 3 4 5 +uniform vec2 r 6 7 +uniform mat2x3 expected 18 24 30 21 28 35 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec3 c 4 5 6 +uniform vec2 r 7 8 +uniform mat2x3 expected 28 35 42 32 40 48 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec3 c 5 6 7 +uniform vec2 r 8 9 +uniform mat2x3 expected 40 48 56 45 54 63 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x4-ivec.shader_test new file mode 100644 index 00000000..7e1c74e1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x4-ivec.shader_test @@ -0,0 +1,76 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec4 c; +uniform ivec2 r; +uniform mat2x4 expected; + +void main() { + mat2x4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec4 c 2 3 4 5 +uniform ivec2 r 6 7 +uniform mat2x4 expected 12 18 24 30 14 21 28 35 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec4 c 3 4 5 6 +uniform ivec2 r 7 8 +uniform mat2x4 expected 21 28 35 42 24 32 40 48 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec4 c 4 5 6 7 +uniform ivec2 r 8 9 +uniform mat2x4 expected 32 40 48 56 36 45 54 63 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec4 c 5 6 7 8 +uniform ivec2 r 9 10 +uniform mat2x4 expected 45 54 63 72 50 60 70 80 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x4.shader_test new file mode 100644 index 00000000..0724371c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat2x4.shader_test @@ -0,0 +1,56 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + +uniform vec4 c; +uniform vec2 r; +uniform mat2x4 expected; + +void main() { + mat2x4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec4 c 2 3 4 5 +uniform vec2 r 6 7 +uniform mat2x4 expected 12 18 24 30 14 21 28 35 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec4 c 3 4 5 6 +uniform vec2 r 7 8 +uniform mat2x4 expected 21 28 35 42 24 32 40 48 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec4 c 4 5 6 7 +uniform vec2 r 8 9 +uniform mat2x4 expected 32 40 48 56 36 45 54 63 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec4 c 5 6 7 8 +uniform vec2 r 9 10 +uniform mat2x4 expected 45 54 63 72 50 60 70 80 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3-ivec.shader_test new file mode 100644 index 00000000..88a0f665 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3-ivec.shader_test @@ -0,0 +1,74 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec3 c; +uniform ivec3 r; +uniform mat3 expected; + +void main() { + mat3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec3 c 2 3 4 +uniform ivec3 r 5 6 7 +uniform mat3x3 expected 10 15 20 12 18 24 14 21 28 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec3 c 3 4 5 +uniform ivec3 r 6 7 8 +uniform mat3x3 expected 18 24 30 21 28 35 24 32 40 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec3 c 4 5 6 +uniform ivec3 r 7 8 9 +uniform mat3x3 expected 28 35 42 32 40 48 36 45 54 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec3 c 5 6 7 +uniform ivec3 r 8 9 10 +uniform mat3x3 expected 40 48 56 45 54 63 50 60 70 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3.shader_test new file mode 100644 index 00000000..250b5761 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3.shader_test @@ -0,0 +1,54 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + +uniform vec3 c; +uniform vec3 r; +uniform mat3 expected; + +void main() { + mat3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec3 c 2 3 4 +uniform vec3 r 5 6 7 +uniform mat3x3 expected 10 15 20 12 18 24 14 21 28 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec3 c 3 4 5 +uniform vec3 r 6 7 8 +uniform mat3x3 expected 18 24 30 21 28 35 24 32 40 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec3 c 4 5 6 +uniform vec3 r 7 8 9 +uniform mat3x3 expected 28 35 42 32 40 48 36 45 54 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec3 c 5 6 7 +uniform vec3 r 8 9 10 +uniform mat3x3 expected 40 48 56 45 54 63 50 60 70 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x2-ivec.shader_test new file mode 100644 index 00000000..531cc81a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x2-ivec.shader_test @@ -0,0 +1,76 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec2 c; +uniform ivec3 r; +uniform mat3x2 expected; + +void main() { + mat3x2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec2 c 2 3 +uniform ivec3 r 4 5 6 +uniform mat3x2 expected 8 12 10 15 12 18 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec2 c 3 4 +uniform ivec3 r 5 6 7 +uniform mat3x2 expected 15 20 18 24 21 28 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec2 c 4 5 +uniform ivec3 r 6 7 8 +uniform mat3x2 expected 24 30 28 35 32 40 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec2 c 5 6 +uniform ivec3 r 7 8 9 +uniform mat3x2 expected 35 42 40 48 45 54 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x2.shader_test new file mode 100644 index 00000000..56c0e9b8 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x2.shader_test @@ -0,0 +1,56 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + +uniform vec2 c; +uniform vec3 r; +uniform mat3x2 expected; + +void main() { + mat3x2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec2 c 2 3 +uniform vec3 r 4 5 6 +uniform mat3x2 expected 8 12 10 15 12 18 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec2 c 3 4 +uniform vec3 r 5 6 7 +uniform mat3x2 expected 15 20 18 24 21 28 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec2 c 4 5 +uniform vec3 r 6 7 8 +uniform mat3x2 expected 24 30 28 35 32 40 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec2 c 5 6 +uniform vec3 r 7 8 9 +uniform mat3x2 expected 35 42 40 48 45 54 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x3-ivec.shader_test new file mode 100644 index 00000000..940ecae7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x3-ivec.shader_test @@ -0,0 +1,74 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec3 c; +uniform ivec3 r; +uniform mat3x3 expected; + +void main() { + mat3x3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec3 c 2 3 4 +uniform ivec3 r 5 6 7 +uniform mat3x3 expected 10 15 20 12 18 24 14 21 28 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec3 c 3 4 5 +uniform ivec3 r 6 7 8 +uniform mat3x3 expected 18 24 30 21 28 35 24 32 40 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec3 c 4 5 6 +uniform ivec3 r 7 8 9 +uniform mat3x3 expected 28 35 42 32 40 48 36 45 54 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec3 c 5 6 7 +uniform ivec3 r 8 9 10 +uniform mat3x3 expected 40 48 56 45 54 63 50 60 70 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x3.shader_test new file mode 100644 index 00000000..8a9b2084 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x3.shader_test @@ -0,0 +1,54 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + +uniform vec3 c; +uniform vec3 r; +uniform mat3x3 expected; + +void main() { + mat3x3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec3 c 2 3 4 +uniform vec3 r 5 6 7 +uniform mat3x3 expected 10 15 20 12 18 24 14 21 28 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec3 c 3 4 5 +uniform vec3 r 6 7 8 +uniform mat3x3 expected 18 24 30 21 28 35 24 32 40 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec3 c 4 5 6 +uniform vec3 r 7 8 9 +uniform mat3x3 expected 28 35 42 32 40 48 36 45 54 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec3 c 5 6 7 +uniform vec3 r 8 9 10 +uniform mat3x3 expected 40 48 56 45 54 63 50 60 70 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x4-ivec.shader_test new file mode 100644 index 00000000..3e629dca --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x4-ivec.shader_test @@ -0,0 +1,76 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec4 c; +uniform ivec3 r; +uniform mat3x4 expected; + +void main() { + mat3x4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec4 c 2 3 4 5 +uniform ivec3 r 6 7 8 +uniform mat3x4 expected 12 18 24 30 14 21 28 35 16 24 32 40 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec4 c 3 4 5 6 +uniform ivec3 r 7 8 9 +uniform mat3x4 expected 21 28 35 42 24 32 40 48 27 36 45 54 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec4 c 4 5 6 7 +uniform ivec3 r 8 9 10 +uniform mat3x4 expected 32 40 48 56 36 45 54 63 40 50 60 70 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec4 c 5 6 7 8 +uniform ivec3 r 9 10 11 +uniform mat3x4 expected 45 54 63 72 50 60 70 80 55 66 77 88 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x4.shader_test new file mode 100644 index 00000000..a94040df --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat3x4.shader_test @@ -0,0 +1,56 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + +uniform vec4 c; +uniform vec3 r; +uniform mat3x4 expected; + +void main() { + mat3x4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec4 c 2 3 4 5 +uniform vec3 r 6 7 8 +uniform mat3x4 expected 12 18 24 30 14 21 28 35 16 24 32 40 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec4 c 3 4 5 6 +uniform vec3 r 7 8 9 +uniform mat3x4 expected 21 28 35 42 24 32 40 48 27 36 45 54 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec4 c 4 5 6 7 +uniform vec3 r 8 9 10 +uniform mat3x4 expected 32 40 48 56 36 45 54 63 40 50 60 70 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec4 c 5 6 7 8 +uniform vec3 r 9 10 11 +uniform mat3x4 expected 45 54 63 72 50 60 70 80 55 66 77 88 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4-ivec.shader_test new file mode 100644 index 00000000..4fcc7dfc --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4-ivec.shader_test @@ -0,0 +1,74 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec4 c; +uniform ivec4 r; +uniform mat4 expected; + +void main() { + mat4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec4 c 2 3 4 5 +uniform ivec4 r 6 7 8 9 +uniform mat4x4 expected 12 18 24 30 14 21 28 35 16 24 32 40 18 27 36 45 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec4 c 3 4 5 6 +uniform ivec4 r 7 8 9 10 +uniform mat4x4 expected 21 28 35 42 24 32 40 48 27 36 45 54 30 40 50 60 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec4 c 4 5 6 7 +uniform ivec4 r 8 9 10 11 +uniform mat4x4 expected 32 40 48 56 36 45 54 63 40 50 60 70 44 55 66 77 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec4 c 5 6 7 8 +uniform ivec4 r 9 10 11 12 +uniform mat4x4 expected 45 54 63 72 50 60 70 80 55 66 77 88 60 72 84 96 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4.shader_test new file mode 100644 index 00000000..1b5c7192 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4.shader_test @@ -0,0 +1,54 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + +uniform vec4 c; +uniform vec4 r; +uniform mat4 expected; + +void main() { + mat4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec4 c 2 3 4 5 +uniform vec4 r 6 7 8 9 +uniform mat4x4 expected 12 18 24 30 14 21 28 35 16 24 32 40 18 27 36 45 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec4 c 3 4 5 6 +uniform vec4 r 7 8 9 10 +uniform mat4x4 expected 21 28 35 42 24 32 40 48 27 36 45 54 30 40 50 60 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec4 c 4 5 6 7 +uniform vec4 r 8 9 10 11 +uniform mat4x4 expected 32 40 48 56 36 45 54 63 40 50 60 70 44 55 66 77 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec4 c 5 6 7 8 +uniform vec4 r 9 10 11 12 +uniform mat4x4 expected 45 54 63 72 50 60 70 80 55 66 77 88 60 72 84 96 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x2-ivec.shader_test new file mode 100644 index 00000000..b2208adc --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x2-ivec.shader_test @@ -0,0 +1,76 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec2 c; +uniform ivec4 r; +uniform mat4x2 expected; + +void main() { + mat4x2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec2 c 2 3 +uniform ivec4 r 4 5 6 7 +uniform mat4x2 expected 8 12 10 15 12 18 14 21 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec2 c 3 4 +uniform ivec4 r 5 6 7 8 +uniform mat4x2 expected 15 20 18 24 21 28 24 32 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec2 c 4 5 +uniform ivec4 r 6 7 8 9 +uniform mat4x2 expected 24 30 28 35 32 40 36 45 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec2 c 5 6 +uniform ivec4 r 7 8 9 10 +uniform mat4x2 expected 35 42 40 48 45 54 50 60 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x2.shader_test new file mode 100644 index 00000000..a7c36334 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x2.shader_test @@ -0,0 +1,56 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + +uniform vec2 c; +uniform vec4 r; +uniform mat4x2 expected; + +void main() { + mat4x2 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec2 c 2 3 +uniform vec4 r 4 5 6 7 +uniform mat4x2 expected 8 12 10 15 12 18 14 21 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec2 c 3 4 +uniform vec4 r 5 6 7 8 +uniform mat4x2 expected 15 20 18 24 21 28 24 32 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec2 c 4 5 +uniform vec4 r 6 7 8 9 +uniform mat4x2 expected 24 30 28 35 32 40 36 45 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec2 c 5 6 +uniform vec4 r 7 8 9 10 +uniform mat4x2 expected 35 42 40 48 45 54 50 60 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x3-ivec.shader_test new file mode 100644 index 00000000..c479724a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x3-ivec.shader_test @@ -0,0 +1,76 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x3fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec3 c; +uniform ivec4 r; +uniform mat4x3 expected; + +void main() { + mat4x3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec3 c 2 3 4 +uniform ivec4 r 5 6 7 8 +uniform mat4x3 expected 10 15 20 12 18 24 14 21 28 16 24 32 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec3 c 3 4 5 +uniform ivec4 r 6 7 8 9 +uniform mat4x3 expected 18 24 30 21 28 35 24 32 40 27 36 45 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec3 c 4 5 6 +uniform ivec4 r 7 8 9 10 +uniform mat4x3 expected 28 35 42 32 40 48 36 45 54 40 50 60 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec3 c 5 6 7 +uniform ivec4 r 8 9 10 11 +uniform mat4x3 expected 40 48 56 45 54 63 50 60 70 55 66 77 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x3.shader_test new file mode 100644 index 00000000..683d64d7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x3.shader_test @@ -0,0 +1,56 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x3fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + +uniform vec3 c; +uniform vec4 r; +uniform mat4x3 expected; + +void main() { + mat4x3 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec3 c 2 3 4 +uniform vec4 r 5 6 7 8 +uniform mat4x3 expected 10 15 20 12 18 24 14 21 28 16 24 32 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec3 c 3 4 5 +uniform vec4 r 6 7 8 9 +uniform mat4x3 expected 18 24 30 21 28 35 24 32 40 27 36 45 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec3 c 4 5 6 +uniform vec4 r 7 8 9 10 +uniform mat4x3 expected 28 35 42 32 40 48 36 45 54 40 50 60 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec3 c 5 6 7 +uniform vec4 r 8 9 10 11 +uniform mat4x3 expected 40 48 56 45 54 63 50 60 70 55 66 77 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x4-ivec.shader_test new file mode 100644 index 00000000..57ef99b0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x4-ivec.shader_test @@ -0,0 +1,74 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec4 c; +uniform ivec4 r; +uniform mat4x4 expected; + +void main() { + mat4x4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec4 c 2 3 4 5 +uniform ivec4 r 6 7 8 9 +uniform mat4x4 expected 12 18 24 30 14 21 28 35 16 24 32 40 18 27 36 45 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec4 c 3 4 5 6 +uniform ivec4 r 7 8 9 10 +uniform mat4x4 expected 21 28 35 42 24 32 40 48 27 36 45 54 30 40 50 60 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec4 c 4 5 6 7 +uniform ivec4 r 8 9 10 11 +uniform mat4x4 expected 32 40 48 56 36 45 54 63 40 50 60 70 44 55 66 77 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec4 c 5 6 7 8 +uniform ivec4 r 9 10 11 12 +uniform mat4x4 expected 45 54 63 72 50 60 70 80 55 66 77 88 60 72 84 96 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x4.shader_test new file mode 100644 index 00000000..01e79c7d --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x4.shader_test @@ -0,0 +1,54 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] + +uniform vec4 c; +uniform vec4 r; +uniform mat4x4 expected; + +void main() { + mat4x4 result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec4 c 2 3 4 5 +uniform vec4 r 6 7 8 9 +uniform mat4x4 expected 12 18 24 30 14 21 28 35 16 24 32 40 18 27 36 45 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec4 c 3 4 5 6 +uniform vec4 r 7 8 9 10 +uniform mat4x4 expected 21 28 35 42 24 32 40 48 27 36 45 54 30 40 50 60 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec4 c 4 5 6 7 +uniform vec4 r 8 9 10 11 +uniform mat4x4 expected 32 40 48 56 36 45 54 63 40 50 60 70 44 55 66 77 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec4 c 5 6 7 8 +uniform vec4 r 9 10 11 12 +uniform mat4x4 expected 45 54 63 72 50 60 70 80 55 66 77 88 60 72 84 96 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxClipPlanes.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxClipPlanes.shader_test new file mode 100644 index 00000000..16672930 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxClipPlanes.shader_test @@ -0,0 +1,28 @@ +# [description] +# Tests for GLSL 1.20 minimum maximums for the builtin constants. +# +# See the GLSL 1.20.8 specification, section 7.4, page 49 (page 55 of the PDF). + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +void main(void) +{ + if (gl_MaxClipPlanes >= 6) + gl_FragColor = vec4(0, 1, 0, 0); + else + gl_FragColor = vec4(1, 0, 0, 0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxCombinedTextureImageUnits.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxCombinedTextureImageUnits.shader_test new file mode 100644 index 00000000..a489be05 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxCombinedTextureImageUnits.shader_test @@ -0,0 +1,28 @@ +# [description] +# Tests for GLSL 1.20 minimum maximums for the builtin constants. +# +# See the GLSL 1.20.8 specification, section 7.4, page 49 (page 55 of the PDF). + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +void main(void) +{ + if (gl_MaxCombinedTextureImageUnits >= 2) + gl_FragColor = vec4(0, 1, 0, 0); + else + gl_FragColor = vec4(1, 0, 0, 0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxDrawBuffers.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxDrawBuffers.shader_test new file mode 100644 index 00000000..e450a1c4 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxDrawBuffers.shader_test @@ -0,0 +1,28 @@ +# [description] +# Tests for GLSL 1.20 minimum maximums for the builtin constants. +# +# See the GLSL 1.20.8 specification, section 7.4, page 49 (page 55 of the PDF). + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +void main(void) +{ + if (gl_MaxDrawBuffers >= 1) + gl_FragColor = vec4(0, 1, 0, 0); + else + gl_FragColor = vec4(1, 0, 0, 0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxFragmentUniformComponents.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxFragmentUniformComponents.shader_test new file mode 100644 index 00000000..3aefbf51 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxFragmentUniformComponents.shader_test @@ -0,0 +1,28 @@ +# [description] +# Tests for GLSL 1.20 minimum maximums for the builtin constants. +# +# See the GLSL 1.20.8 specification, section 7.4, page 49 (page 55 of the PDF). + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +void main(void) +{ + if (gl_MaxFragmentUniformComponents >= 64) + gl_FragColor = vec4(0, 1, 0, 0); + else + gl_FragColor = vec4(1, 0, 0, 0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxLights.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxLights.shader_test new file mode 100644 index 00000000..3c0fea5b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxLights.shader_test @@ -0,0 +1,28 @@ +# [description] +# Tests for GLSL 1.20 minimum maximums for the builtin constants. +# +# See the GLSL 1.20.8 specification, section 7.4, page 49 (page 55 of the PDF). + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +void main(void) +{ + if (gl_MaxLights >= 8) + gl_FragColor = vec4(0, 1, 0, 0); + else + gl_FragColor = vec4(1, 0, 0, 0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxTextureCoords.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxTextureCoords.shader_test new file mode 100644 index 00000000..4951ffd0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxTextureCoords.shader_test @@ -0,0 +1,28 @@ +# [description] +# Tests for GLSL 1.20 minimum maximums for the builtin constants. +# +# See the GLSL 1.20.8 specification, section 7.4, page 49 (page 55 of the PDF). + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +void main(void) +{ + if (gl_MaxTextureCoords >= 2) + gl_FragColor = vec4(0, 1, 0, 0); + else + gl_FragColor = vec4(1, 0, 0, 0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxTextureImageUnits.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxTextureImageUnits.shader_test new file mode 100644 index 00000000..e32faae1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxTextureImageUnits.shader_test @@ -0,0 +1,28 @@ +# [description] +# Tests for GLSL 1.20 minimum maximums for the builtin constants. +# +# See the GLSL 1.20.8 specification, section 7.4, page 49 (page 55 of the PDF). + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +void main(void) +{ + if (gl_MaxTextureImageUnits >= 2) + gl_FragColor = vec4(0, 1, 0, 0); + else + gl_FragColor = vec4(1, 0, 0, 0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxTextureUnits.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxTextureUnits.shader_test new file mode 100644 index 00000000..52bb5f60 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxTextureUnits.shader_test @@ -0,0 +1,28 @@ +# [description] +# Tests for GLSL 1.20 minimum maximums for the builtin constants. +# +# See the GLSL 1.20.8 specification, section 7.4, page 49 (page 55 of the PDF). + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +void main(void) +{ + if (gl_MaxTextureUnits >= 2) + gl_FragColor = vec4(0, 1, 0, 0); + else + gl_FragColor = vec4(1, 0, 0, 0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxVaryingFloats.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxVaryingFloats.shader_test new file mode 100644 index 00000000..2116faa0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxVaryingFloats.shader_test @@ -0,0 +1,28 @@ +# [description] +# Tests for GLSL 1.20 minimum maximums for the builtin constants. +# +# See the GLSL 1.20.8 specification, section 7.4, page 49 (page 55 of the PDF). + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +void main(void) +{ + if (gl_MaxVaryingFloats >= 32) + gl_FragColor = vec4(0, 1, 0, 0); + else + gl_FragColor = vec4(1, 0, 0, 0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxVertexAttribs.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxVertexAttribs.shader_test new file mode 100644 index 00000000..531fe71b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxVertexAttribs.shader_test @@ -0,0 +1,28 @@ +# [description] +# Tests for GLSL 1.20 minimum maximums for the builtin constants. +# +# See the GLSL 1.20.8 specification, section 7.4, page 49 (page 55 of the PDF). + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +void main(void) +{ + if (gl_MaxVertexAttribs >= 16) + gl_FragColor = vec4(0, 1, 0, 0); + else + gl_FragColor = vec4(1, 0, 0, 0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxVertexTextureImageUnits.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxVertexTextureImageUnits.shader_test new file mode 100644 index 00000000..38fa6475 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxVertexTextureImageUnits.shader_test @@ -0,0 +1,28 @@ +# [description] +# Tests for GLSL 1.20 minimum maximums for the builtin constants. +# +# See the GLSL 1.20.8 specification, section 7.4, page 49 (page 55 of the PDF). + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +void main(void) +{ + if (gl_MaxVertexTextureImageUnits >= 0) + gl_FragColor = vec4(0, 1, 0, 0); + else + gl_FragColor = vec4(1, 0, 0, 0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxVertexUniformComponents.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxVertexUniformComponents.shader_test new file mode 100644 index 00000000..ae3b7298 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/maximums/gl_MaxVertexUniformComponents.shader_test @@ -0,0 +1,28 @@ +# [description] +# Tests for GLSL 1.20 minimum maximums for the builtin constants. +# +# See the GLSL 1.20.8 specification, section 7.4, page 49 (page 55 of the PDF). + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void main(void) +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +void main(void) +{ + if (gl_MaxVertexUniformComponents >= 512) + gl_FragColor = vec4(0, 1, 0, 0); + else + gl_FragColor = vec4(1, 0, 0, 0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/maximums/maximums.out b/tests/spec/glsl-es-1.00/execution/1.20/maximums/maximums.out new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/maximums/maximums.out diff --git a/tests/spec/glsl-es-1.00/execution/1.20/outerProduct-const.sh b/tests/spec/glsl-es-1.00/execution/1.20/outerProduct-const.sh new file mode 100644 index 00000000..18ba5d03 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/outerProduct-const.sh @@ -0,0 +1,221 @@ +#!/bin/bash + +function emit_conversion_info +{ +cat <<EOF +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ +EOF +} + +function emit_outerProduct_const_data +{ + c=$1 + r=$2 + vtype=$3 + mtype=$4 + + cbase=$5 + cvec="" + for i in $(seq $c); do + v=$(($i + $cbase)) + if [ "x$cvec" == "x" ]; then + cvec="${v}" + else + cvec="${cvec}, ${v}" + fi + done + + rbase=$(($cbase + $c)) + rvec="" + for i in $(seq $r); do + v=$(($i + $rbase)) + if [ "x$rvec" == "x" ]; then + rvec="${v}" + else + rvec="${rvec}, ${v}" + fi + done + + expected="" + for i in $(seq $r); do + for j in $(seq $c); do + m=$((($i + $rbase) * ($j + $cbase))) + if [ "x$expected" == "x" ]; then + expected="${m}" + else + expected="${expected}, ${m}" + fi + done + done + + echo + echo "const ${vtype}${c} c = ${vtype}${c}(${cvec});" + echo "const ${vtype}${r} r = ${vtype}${r}(${rvec});" + echo "uniform ${mtype} expected = ${mtype}(${expected});" + +} + +function emit_vs_test +{ + c=$1 + r=$2 + vtype=$3 + mat=$4 + + if [ "$vtype" = "ivec" ]; then + name="vs-outerProduct-const-${mat}-ivec.shader_test" + else + name="vs-outerProduct-const-${mat}.shader_test" + fi + + if [ $c -ne $r ]; then + GL_require="# glUniformMatrix${r}x${c}fv only exists in OpenGL 2.1 or later. + +" + else + GL_require="" + fi + + cat > $name <<EOF +[require] +GLSL >= 1.00 es +GL >= 2.0 es +$GL_require +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +EOF + + if [ "$vtype" = "ivec" ]; then + emit_conversion_info >> $name + fi + + echo "" >> $name + emit_outerProduct_const_data $c $r $vtype $mat 1 >> $name + + cat >> $name <<EOF +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + ${mat} result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 +EOF +} + +function emit_fs_test +{ + c=$1 + r=$2 + vtype=$3 + mat=$4 + + if [ "$vtype" = "ivec" ]; then + name="fs-outerProduct-const-${mat}-ivec.shader_test" + else + name="fs-outerProduct-const-${mat}.shader_test" + fi + + if [ $c -ne $r ]; then + GL_require="# glUniformMatrix${r}x${c}fv only exists in OpenGL 2.1 or later. + +" + else + GL_require="" + fi + + cat > $name <<EOF +[require] +GLSL >= 1.00 es +GL >= 2.0 es +$GL_require +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +EOF + + if [ "$vtype" = "ivec" ]; then + emit_conversion_info >> $name + fi + + echo "" >> $name + emit_outerProduct_const_data $c $r $vtype $mat 1 >> $name + + cat >> $name <<EOF + +void main() { + ${mat} result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 +EOF +} + +for c in 2 3 4; do + for r in 2 3 4; do + emit_vs_test $c $r vec "mat${r}x${c}" + emit_vs_test $c $r ivec "mat${r}x${c}" + emit_fs_test $c $r vec "mat${r}x${c}" + emit_fs_test $c $r ivec "mat${r}x${c}" + if [ $c -eq $r ]; then + emit_vs_test $c $r vec "mat${r}" + emit_vs_test $c $r ivec "mat${r}" + emit_fs_test $c $r vec "mat${r}" + emit_fs_test $c $r ivec "mat${r}" + fi + done +done diff --git a/tests/spec/glsl-es-1.00/execution/1.20/outerProduct.sh b/tests/spec/glsl-es-1.00/execution/1.20/outerProduct.sh new file mode 100644 index 00000000..98d5d98c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/outerProduct.sh @@ -0,0 +1,217 @@ +#!/bin/bash + +function emit_conversion_info +{ +cat <<EOF +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ +EOF +} + +function emit_outerProduct_data +{ + c=$1 + r=$2 + vtype=$3 + + cbase=$4 + cvec="" + for i in $(seq $c); do + v=$(($i + $cbase)) + cvec="${cvec} ${v}" + done + + rbase=$(($cbase + $c)) + rvec="" + for i in $(seq $r); do + v=$(($i + $rbase)) + rvec="${rvec} ${v}" + done + + mat="" + for i in $(seq $r); do + for j in $(seq $c); do + m=$((($i + $rbase) * ($j + $cbase))) + mat="${mat} ${m}" + done + done + + echo + echo "uniform ${vtype}${c} c ${cvec}" + echo "uniform ${vtype}${r} r ${rvec}" + echo "uniform mat${r}x${c} expected ${mat}" + + x=$((20 * $4 - 10)) + echo "draw rect $x 10 10 10" + echo "probe rgb $(($x + 5)) 15 0.0 1.0 0.0" +} + +function emit_vs_test +{ + c=$1 + r=$2 + vtype=$3 + mat=$4 + + if [ "$vtype" = "ivec" ]; then + name="vs-outerProduct-${mat}-ivec.shader_test" + else + name="vs-outerProduct-${mat}.shader_test" + fi + + if [ $c -ne $r ]; then + GL_require="# glUniformMatrix${r}x${c}fv only exists in OpenGL 2.1 or later. + +" + else + GL_require="" + fi + + cat > $name <<EOF +[require] +GLSL >= 1.00 es +GL >= 2.0 es +$GL_require +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +EOF + + if [ "$vtype" = "ivec" ]; then + emit_conversion_info >> $name + fi + + cat >> $name <<EOF + +uniform ${vtype}${c} c; +uniform ${vtype}${r} r; +uniform ${mat} expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + ${mat} result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + +EOF + + emit_outerProduct_data $c $r $vtype 1 >> $name + emit_outerProduct_data $c $r $vtype 2 >> $name + emit_outerProduct_data $c $r $vtype 3 >> $name + emit_outerProduct_data $c $r $vtype 4 >> $name +} + +function emit_fs_test +{ + c=$1 + r=$2 + vtype=$3 + mat=$4 + + if [ "$vtype" = "ivec" ]; then + name="fs-outerProduct-${mat}-ivec.shader_test" + else + name="fs-outerProduct-${mat}.shader_test" + fi + + if [ $c -ne $r ]; then + GL_require="# glUniformMatrix${r}x${c}fv only exists in OpenGL 2.1 or later. + +" + else + GL_require="" + fi + + cat > $name <<EOF +[require] +GLSL >= 1.00 es +GL >= 2.0 es +$GL_require +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main() { gl_Position = vertex; + gl_Position *= proj; } + +[fragment shader] +EOF + + if [ "$vtype" = "ivec" ]; then + emit_conversion_info >> $name + fi + + cat >> $name <<EOF + +uniform ${vtype}${c} c; +uniform ${vtype}${r} r; +uniform ${mat} expected; + +void main() { + ${mat} result = outerProduct(c, r); + gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + +EOF + + emit_outerProduct_data $c $r $vtype 1 >> $name + emit_outerProduct_data $c $r $vtype 2 >> $name + emit_outerProduct_data $c $r $vtype 3 >> $name + emit_outerProduct_data $c $r $vtype 4 >> $name +} + +for c in 2 3 4; do + for r in 2 3 4; do + emit_vs_test $c $r vec "mat${r}x${c}" + emit_vs_test $c $r ivec "mat${r}x${c}" + emit_fs_test $c $r vec "mat${r}x${c}" + emit_fs_test $c $r ivec "mat${r}x${c}" + if [ $c -eq $r ]; then + emit_vs_test $c $r vec "mat${r}" + emit_vs_test $c $r ivec "mat${r}" + emit_fs_test $c $r vec "mat${r}" + emit_fs_test $c $r ivec "mat${r}" + fi + done +done diff --git a/tests/spec/glsl-es-1.00/execution/1.20/qualifiers/qualifiers.out b/tests/spec/glsl-es-1.00/execution/1.20/qualifiers/qualifiers.out new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/qualifiers/qualifiers.out diff --git a/tests/spec/glsl-es-1.00/execution/1.20/qualifiers/vs-out-conversion-int-int-float-to-float-float-float-return.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/qualifiers/vs-out-conversion-int-int-float-to-float-float-float-return.shader_test new file mode 100644 index 00000000..15743c53 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/qualifiers/vs-out-conversion-int-int-float-to-float-float-float-return.shader_test @@ -0,0 +1,46 @@ +# Test that implicit type conversion of out parameters works properly. +# +# From the GLSL 1.30 spec (which clarifies, but does not change, the +# rules for implicit type conversion in GLSL 1.20), section 6.1 +# (Function Definitions): +# +# Mismatched types on output parameters (out or inout) must have a +# conversion from the formal parameter type to the calling argument +# type. +# +# This test uses a complex function signature with three out +# parameters of various types, and a return value, to make sure the +# outputs aren't mixed up. + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +float f(out int x, out int y, out float z) +{ + x = 4; + y = 5; + z = 0.75; + return 0.5; +} + +void main() +{ + gl_Position = gl_Vertex; + float value1; + float value2; + float value3; + float value4 = f(value1, value2, value3); + gl_FrontColor = vec4(1.0/value1, 1.0/value2, value3, value4); +} + +[fragment shader] +void main() +{ + gl_FragColor = gl_Color; +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.25 0.2 0.75 0.5 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/qualifiers/vs-out-conversion-int-to-float-return.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/qualifiers/vs-out-conversion-int-to-float-return.shader_test new file mode 100644 index 00000000..cf7f2b9f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/qualifiers/vs-out-conversion-int-to-float-return.shader_test @@ -0,0 +1,41 @@ +# Test that implicit type conversion of out parameters works properly. +# +# From the GLSL 1.30 spec (which clarifies, but does not change, the +# rules for implicit type conversion in GLSL 1.20), section 6.1 +# (Function Definitions): +# +# Mismatched types on output parameters (out or inout) must have a +# conversion from the formal parameter type to the calling argument +# type. +# +# This test uses a simple function returning float and taking a single +# out parameter. + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +float f(out int x) +{ + x = 4; + return 0.5; +} + +void main() +{ + gl_Position = gl_Vertex; + float value1; + float value2 = f(value1); + gl_FrontColor = vec4(1.0/value1, value2, 0.0, 0.0); +} + +[fragment shader] +void main() +{ + gl_FragColor = gl_Color; +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.25 0.5 0.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/qualifiers/vs-out-conversion-int-to-float.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/qualifiers/vs-out-conversion-int-to-float.shader_test new file mode 100644 index 00000000..2c3a2ce7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/qualifiers/vs-out-conversion-int-to-float.shader_test @@ -0,0 +1,40 @@ +# Test that implicit type conversion of out parameters works properly. +# +# From the GLSL 1.30 spec (which clarifies, but does not change, the +# rules for implicit type conversion in GLSL 1.20), section 6.1 +# (Function Definitions): +# +# Mismatched types on output parameters (out or inout) must have a +# conversion from the formal parameter type to the calling argument +# type. +# +# This test uses a simple function returning void and taking a single +# out parameter. + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +void f(out int x) +{ + x = 4; +} + +void main() +{ + gl_Position = gl_Vertex; + float value; + f(value); + gl_FrontColor = vec4(1.0/value); +} + +[fragment shader] +void main() +{ + gl_FragColor = gl_Color; +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.25 0.25 0.25 0.25 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/uniform-initializer/fs-structure-array.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/uniform-initializer/fs-structure-array.shader_test new file mode 100644 index 00000000..36f56444 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/uniform-initializer/fs-structure-array.shader_test @@ -0,0 +1,48 @@ +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 + +void main() +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 + +struct S { + int i; + float f; + vec4 v[2]; +}; + +uniform S s[2] = S[2](S(9, 33.3, vec4[2](vec4(1, 2, 3, 4), + vec4(9, 8, 7, 6))), + S(7, 22.2, vec4[2](vec4(5, 6, 7, 8), + vec4(3, 2, 1, 0)))); + +void main() +{ + vec4 color; + + if (s[0].i == 9 + && s[0].f == 33.3 + && s[0].v[0] == vec4(1, 2, 3, 4) + && s[0].v[1] == vec4(9, 8, 7, 6) + && s[1].i == 7 + && s[1].f == 22.2 + && s[1].v[0] == vec4(5, 6, 7, 8) + && s[1].v[1] == vec4(3, 2, 1, 0)) { + color = vec4(0, 1, 0, 1); + } else { + color = vec4(1, 0, 0, 1); + } + + gl_FragColor = color; +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0 1 0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/uniform-initializer/fs-structure.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/uniform-initializer/fs-structure.shader_test new file mode 100644 index 00000000..3b0c9509 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/uniform-initializer/fs-structure.shader_test @@ -0,0 +1,44 @@ +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 + +void main() +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +varying vec4 color; + +struct S { + int i; + float f; + vec4 v[2]; +}; + +uniform S s = S(9, 33.3, vec4[2](vec4(1, 2, 3, 4), + vec4(9, 8, 7, 6))); + +void main() +{ + vec4 color; + + if (s.i == 9 + && s.f == 33.3 + && s.v[0] == vec4(1, 2, 3, 4) + && s.v[1] == vec4(9, 8, 7, 6)) { + color = vec4(0, 1, 0, 1); + } else { + color = vec4(1, 0, 0, 1); + } + + + gl_FragColor = color; +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0 1 0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/uniform-initializer/uniform-initializer.out b/tests/spec/glsl-es-1.00/execution/1.20/uniform-initializer/uniform-initializer.out new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/uniform-initializer/uniform-initializer.out diff --git a/tests/spec/glsl-es-1.00/execution/1.20/uniform-initializer/vs-structure-array.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/uniform-initializer/vs-structure-array.shader_test new file mode 100644 index 00000000..7b8bd508 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/uniform-initializer/vs-structure-array.shader_test @@ -0,0 +1,48 @@ +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 + +struct S { + int i; + float f; + vec4 v[2]; +}; + +uniform S s[2] = S[2](S(9, 33.3, vec4[2](vec4(1, 2, 3, 4), + vec4(9, 8, 7, 6))), + S(7, 22.2, vec4[2](vec4(5, 6, 7, 8), + vec4(3, 2, 1, 0)))); +varying vec4 color; + +void main() +{ + if (s[0].i == 9 + && s[0].f == 33.3 + && s[0].v[0] == vec4(1, 2, 3, 4) + && s[0].v[1] == vec4(9, 8, 7, 6) + && s[1].i == 7 + && s[1].f == 22.2 + && s[1].v[0] == vec4(5, 6, 7, 8) + && s[1].v[1] == vec4(3, 2, 1, 0)) { + color = vec4(0, 1, 0, 1); + } else { + color = vec4(1, 0, 0, 1); + } + + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +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/spec/glsl-es-1.00/execution/1.20/uniform-initializer/vs-structure.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/uniform-initializer/vs-structure.shader_test new file mode 100644 index 00000000..f2fa32d1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/uniform-initializer/vs-structure.shader_test @@ -0,0 +1,42 @@ +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 + +struct S { + int i; + float f; + vec4 v[2]; +}; + +uniform S s = S(9, 33.3, vec4[2](vec4(1, 2, 3, 4), + vec4(9, 8, 7, 6))); +varying vec4 color; + +void main() +{ + if (s.i == 9 + && s.f == 33.3 + && s.v[0] == vec4(1, 2, 3, 4) + && s.v[1] == vec4(9, 8, 7, 6)) { + color = vec4(0, 1, 0, 1); + } else { + color = vec4(1, 0, 0, 1); + } + + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +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/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-col-rd.shader_test new file mode 100644 index 00000000..63d9533e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-col-rd.shader_test @@ -0,0 +1,46 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + + gl_FragColor = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 expect 5 6 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-col-row-rd.shader_test new file mode 100644 index 00000000..4966e069 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-col-row-rd.shader_test @@ -0,0 +1,60 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + + gl_FragColor = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 5 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..5bc8ebf0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test @@ -0,0 +1,75 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-col-wr.shader_test new file mode 100644 index 00000000..32eeaf98 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-col-wr.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-col-rd.shader_test new file mode 100644 index 00000000..61df7269 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-col-rd.shader_test @@ -0,0 +1,71 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + + gl_FragColor = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec2 expect 1 2 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec2 expect 5 6 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec2 expect 9 10 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 11 12 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 00000000..568bbeb1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-col-row-rd.shader_test @@ -0,0 +1,109 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + + gl_FragColor = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 5 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 9 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 85 20 10 10 +probe rgb 90 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 11 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 12 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test new file mode 100644 index 00000000..eca3415e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test @@ -0,0 +1,146 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 85 20 10 10 +probe rgb 90 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test new file mode 100644 index 00000000..df1d6437 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test @@ -0,0 +1,91 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-rd.shader_test new file mode 100644 index 00000000..aba81276 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-rd.shader_test @@ -0,0 +1,51 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + + gl_FragColor = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec2 expect 11 12 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-row-rd.shader_test new file mode 100644 index 00000000..9f617442 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-row-rd.shader_test @@ -0,0 +1,71 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + + gl_FragColor = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 11 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 12 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test new file mode 100644 index 00000000..d4fff20a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test @@ -0,0 +1,92 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-wr.shader_test new file mode 100644 index 00000000..2ec45d99 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-index-wr.shader_test @@ -0,0 +1,64 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-rd.shader_test new file mode 100644 index 00000000..572ea225 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-rd.shader_test @@ -0,0 +1,38 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform vec2 expect; +varying vec4 color; + +void main() +{ + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + + gl_FragColor = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-row-rd.shader_test new file mode 100644 index 00000000..5219fd81 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-row-rd.shader_test @@ -0,0 +1,46 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + + gl_FragColor = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-row-wr.shader_test new file mode 100644 index 00000000..a9efc766 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-row-wr.shader_test @@ -0,0 +1,57 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-wr.shader_test new file mode 100644 index 00000000..bdb4c0b6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat2-wr.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-col-rd.shader_test new file mode 100644 index 00000000..a07de223 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-col-rd.shader_test @@ -0,0 +1,51 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + + gl_FragColor = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 expect 10 11 12 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 16 17 18 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-col-row-rd.shader_test new file mode 100644 index 00000000..d8481c34 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-col-row-rd.shader_test @@ -0,0 +1,86 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + + gl_FragColor = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 10 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 11 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 12 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 16 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 17 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 18 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..104b77c3 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test @@ -0,0 +1,116 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-col-wr.shader_test new file mode 100644 index 00000000..af914683 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-col-wr.shader_test @@ -0,0 +1,64 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-col-rd.shader_test new file mode 100644 index 00000000..26f4803d --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-col-rd.shader_test @@ -0,0 +1,86 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + + gl_FragColor = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec3 expect 1 2 3 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 7 8 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec3 expect 10 11 12 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 16 17 18 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec3 expect 19 20 21 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 22 23 24 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 25 26 27 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 00000000..f4dc1658 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-col-row-rd.shader_test @@ -0,0 +1,187 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + + gl_FragColor = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 7 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 9 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 10 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 11 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 12 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 16 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 17 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 18 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 19 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 20 +draw rect 115 20 10 10 +probe rgb 120 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 21 +draw rect 115 35 10 10 +probe rgb 120 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 22 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 23 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 24 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test new file mode 100644 index 00000000..764e46bb --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test @@ -0,0 +1,269 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 115 20 10 10 +probe rgb 120 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 115 35 10 10 +probe rgb 120 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test new file mode 100644 index 00000000..a072a36a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test @@ -0,0 +1,115 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-rd.shader_test new file mode 100644 index 00000000..c3667bad --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-rd.shader_test @@ -0,0 +1,51 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + + gl_FragColor = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec3 expect 22 23 24 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-row-rd.shader_test new file mode 100644 index 00000000..c2c386cf --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-row-rd.shader_test @@ -0,0 +1,86 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + + gl_FragColor = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 22 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 23 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 24 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test new file mode 100644 index 00000000..ab0b7b35 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test @@ -0,0 +1,116 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-wr.shader_test new file mode 100644 index 00000000..2f1445f9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-index-wr.shader_test @@ -0,0 +1,64 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-rd.shader_test new file mode 100644 index 00000000..a32691d7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-rd.shader_test @@ -0,0 +1,38 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform vec3 expect; +varying vec4 color; + +void main() +{ + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + + gl_FragColor = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-row-rd.shader_test new file mode 100644 index 00000000..a9a33b72 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-row-rd.shader_test @@ -0,0 +1,51 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + + gl_FragColor = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-row-wr.shader_test new file mode 100644 index 00000000..a79bbb6c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-row-wr.shader_test @@ -0,0 +1,65 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-wr.shader_test new file mode 100644 index 00000000..8b6ec754 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat3-wr.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-col-rd.shader_test new file mode 100644 index 00000000..e6383c4b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-col-rd.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + + gl_FragColor = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 expect 17 18 19 20 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 25 26 27 28 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 29 30 31 32 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-col-row-rd.shader_test new file mode 100644 index 00000000..849a94da --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-col-row-rd.shader_test @@ -0,0 +1,122 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + + gl_FragColor = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 17 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 18 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 19 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 20 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 28 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 29 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 30 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 31 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 32 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..20c6c276 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test @@ -0,0 +1,173 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-col-wr.shader_test new file mode 100644 index 00000000..af2621e5 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-col-wr.shader_test @@ -0,0 +1,72 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-col-rd.shader_test new file mode 100644 index 00000000..11bfc83c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-col-rd.shader_test @@ -0,0 +1,101 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + + gl_FragColor = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec4 expect 1 2 3 4 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 9 10 11 12 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 13 14 15 16 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec4 expect 17 18 19 20 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 25 26 27 28 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 29 30 31 32 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec4 expect 33 34 35 36 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 37 38 39 40 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 41 42 43 44 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 45 46 47 48 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 00000000..5ae1f738 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-col-row-rd.shader_test @@ -0,0 +1,295 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + + gl_FragColor = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 4 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 11 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 12 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 13 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 16 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 17 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 18 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 19 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 20 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 28 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 29 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 30 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 31 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 32 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 33 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 34 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 35 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 36 +draw rect 145 50 10 10 +probe rgb 150 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 37 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 38 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 39 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 40 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 41 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 42 +draw rect 175 20 10 10 +probe rgb 180 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 43 +draw rect 175 35 10 10 +probe rgb 180 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 44 +draw rect 175 50 10 10 +probe rgb 180 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 45 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 46 +draw rect 190 20 10 10 +probe rgb 195 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 47 +draw rect 190 35 10 10 +probe rgb 195 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 48 +draw rect 190 50 10 10 +probe rgb 195 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test new file mode 100644 index 00000000..0550579b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test @@ -0,0 +1,440 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 145 50 10 10 +probe rgb 150 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 175 20 10 10 +probe rgb 180 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 175 35 10 10 +probe rgb 180 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 175 50 10 10 +probe rgb 180 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 190 20 10 10 +probe rgb 195 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 190 35 10 10 +probe rgb 195 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 190 50 10 10 +probe rgb 195 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test new file mode 100644 index 00000000..5568cd3d --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test @@ -0,0 +1,139 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-rd.shader_test new file mode 100644 index 00000000..1b9e6bb3 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-rd.shader_test @@ -0,0 +1,51 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + + gl_FragColor = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec4 expect 37 38 39 40 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-row-rd.shader_test new file mode 100644 index 00000000..39217b5e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-row-rd.shader_test @@ -0,0 +1,101 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + + gl_FragColor = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 37 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 38 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 39 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 40 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test new file mode 100644 index 00000000..ec7930e9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test @@ -0,0 +1,140 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-wr.shader_test new file mode 100644 index 00000000..ec818d3d --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-index-wr.shader_test @@ -0,0 +1,64 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-rd.shader_test new file mode 100644 index 00000000..2c6b3a42 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-rd.shader_test @@ -0,0 +1,38 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform vec4 expect; +varying vec4 color; + +void main() +{ + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + + gl_FragColor = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-row-rd.shader_test new file mode 100644 index 00000000..6dc8226f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-row-rd.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + + gl_FragColor = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-row-wr.shader_test new file mode 100644 index 00000000..d64a3c19 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-row-wr.shader_test @@ -0,0 +1,73 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-wr.shader_test new file mode 100644 index 00000000..d9435d8d --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-array-mat4-wr.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-col-rd.shader_test new file mode 100644 index 00000000..cb42f4fd --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-col-rd.shader_test @@ -0,0 +1,43 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); + + gl_FragColor = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 expect 1 2 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-col-row-rd.shader_test new file mode 100644 index 00000000..90342909 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-col-row-rd.shader_test @@ -0,0 +1,57 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); + + gl_FragColor = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..b9826f9c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-col-row-wr.shader_test @@ -0,0 +1,70 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-col-wr.shader_test new file mode 100644 index 00000000..07bfacdd --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-col-wr.shader_test @@ -0,0 +1,51 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-rd.shader_test new file mode 100644 index 00000000..972a2815 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-rd.shader_test @@ -0,0 +1,35 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform vec2 expect; +varying vec4 color; + +void main() +{ + mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); + + gl_FragColor = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-row-rd.shader_test new file mode 100644 index 00000000..a625dfc0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-row-rd.shader_test @@ -0,0 +1,43 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); + + gl_FragColor = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-row-wr.shader_test new file mode 100644 index 00000000..ea43a75d --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-row-wr.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-wr.shader_test new file mode 100644 index 00000000..16ccfffa --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat2-wr.shader_test @@ -0,0 +1,42 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-col-rd.shader_test new file mode 100644 index 00000000..0e9c7885 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-col-rd.shader_test @@ -0,0 +1,48 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + + gl_FragColor = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 expect 1 2 3 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 7 8 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-col-row-rd.shader_test new file mode 100644 index 00000000..f05662cc --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-col-row-rd.shader_test @@ -0,0 +1,83 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + + gl_FragColor = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 7 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 9 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..0c6f1ad5 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-col-row-wr.shader_test @@ -0,0 +1,111 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-col-wr.shader_test new file mode 100644 index 00000000..f5010632 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-col-wr.shader_test @@ -0,0 +1,59 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-rd.shader_test new file mode 100644 index 00000000..e67303c7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-rd.shader_test @@ -0,0 +1,35 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform vec3 expect; +varying vec4 color; + +void main() +{ + mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + + gl_FragColor = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-row-rd.shader_test new file mode 100644 index 00000000..260e53e2 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-row-rd.shader_test @@ -0,0 +1,48 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + + gl_FragColor = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-row-wr.shader_test new file mode 100644 index 00000000..7d2a5a8c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-row-wr.shader_test @@ -0,0 +1,60 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-wr.shader_test new file mode 100644 index 00000000..80fe56a6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat3-wr.shader_test @@ -0,0 +1,42 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-col-rd.shader_test new file mode 100644 index 00000000..a8678072 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-col-rd.shader_test @@ -0,0 +1,53 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + + gl_FragColor = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 expect 1 2 3 4 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 9 10 11 12 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 13 14 15 16 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-col-row-rd.shader_test new file mode 100644 index 00000000..f7fb2f63 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-col-row-rd.shader_test @@ -0,0 +1,119 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + + gl_FragColor = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 4 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 11 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 12 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 13 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 16 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..2a6ffad3 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-col-row-wr.shader_test @@ -0,0 +1,168 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-col-wr.shader_test new file mode 100644 index 00000000..29a067c0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-col-wr.shader_test @@ -0,0 +1,67 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-rd.shader_test new file mode 100644 index 00000000..042dc594 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-rd.shader_test @@ -0,0 +1,35 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform vec4 expect; +varying vec4 color; + +void main() +{ + mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + + gl_FragColor = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-row-rd.shader_test new file mode 100644 index 00000000..c8e661a3 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-row-rd.shader_test @@ -0,0 +1,53 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + + gl_FragColor = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-row-wr.shader_test new file mode 100644 index 00000000..0499571d --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-row-wr.shader_test @@ -0,0 +1,68 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-wr.shader_test new file mode 100644 index 00000000..65e77671 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-temp-mat4-wr.shader_test @@ -0,0 +1,42 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-col-rd.shader_test new file mode 100644 index 00000000..7fb447eb --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-col-rd.shader_test @@ -0,0 +1,49 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 expect 5 6 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-col-row-rd.shader_test new file mode 100644 index 00000000..8fa799d9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-col-row-rd.shader_test @@ -0,0 +1,63 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 5 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-index-col-rd.shader_test new file mode 100644 index 00000000..506783c7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-index-col-rd.shader_test @@ -0,0 +1,74 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec2 expect 1 2 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec2 expect 5 6 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec2 expect 9 10 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 11 12 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 00000000..54f32bf0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-index-col-row-rd.shader_test @@ -0,0 +1,112 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 5 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 9 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 85 20 10 10 +probe rgb 90 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 11 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 12 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-index-rd.shader_test new file mode 100644 index 00000000..497de096 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-index-rd.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec2 expect 11 12 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-index-row-rd.shader_test new file mode 100644 index 00000000..4f2eae0d --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-index-row-rd.shader_test @@ -0,0 +1,74 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 11 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 12 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-rd.shader_test new file mode 100644 index 00000000..b7346554 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-rd.shader_test @@ -0,0 +1,41 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-row-rd.shader_test new file mode 100644 index 00000000..b393cf1c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat2-row-rd.shader_test @@ -0,0 +1,49 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-col-rd.shader_test new file mode 100644 index 00000000..e8f28939 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-col-rd.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 expect 10 11 12 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 16 17 18 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-col-row-rd.shader_test new file mode 100644 index 00000000..6b9a7c0b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-col-row-rd.shader_test @@ -0,0 +1,89 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 10 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 11 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 12 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 16 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 17 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 18 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-index-col-rd.shader_test new file mode 100644 index 00000000..c45e4b1b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-index-col-rd.shader_test @@ -0,0 +1,89 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec3 expect 1 2 3 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 7 8 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec3 expect 10 11 12 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 16 17 18 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec3 expect 19 20 21 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 22 23 24 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 25 26 27 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 00000000..9022e743 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-index-col-row-rd.shader_test @@ -0,0 +1,190 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 7 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 9 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 10 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 11 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 12 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 16 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 17 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 18 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 19 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 20 +draw rect 115 20 10 10 +probe rgb 120 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 21 +draw rect 115 35 10 10 +probe rgb 120 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 22 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 23 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 24 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-index-rd.shader_test new file mode 100644 index 00000000..c7eb6bfe --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-index-rd.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec3 expect 22 23 24 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-index-row-rd.shader_test new file mode 100644 index 00000000..cfa0b462 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-index-row-rd.shader_test @@ -0,0 +1,89 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 22 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 23 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 24 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-rd.shader_test new file mode 100644 index 00000000..34b0f668 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-rd.shader_test @@ -0,0 +1,41 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-row-rd.shader_test new file mode 100644 index 00000000..a2b59571 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat3-row-rd.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-col-rd.shader_test new file mode 100644 index 00000000..ab2e7da5 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-col-rd.shader_test @@ -0,0 +1,59 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 expect 17 18 19 20 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 25 26 27 28 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 29 30 31 32 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-col-row-rd.shader_test new file mode 100644 index 00000000..8949806a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-col-row-rd.shader_test @@ -0,0 +1,125 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 17 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 18 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 19 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 20 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 28 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 29 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 30 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 31 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 32 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-index-col-rd.shader_test new file mode 100644 index 00000000..f55cdb45 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-index-col-rd.shader_test @@ -0,0 +1,104 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec4 expect 1 2 3 4 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 9 10 11 12 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 13 14 15 16 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec4 expect 17 18 19 20 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 25 26 27 28 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 29 30 31 32 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec4 expect 33 34 35 36 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 37 38 39 40 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 41 42 43 44 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 45 46 47 48 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 00000000..7a0623b9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-index-col-row-rd.shader_test @@ -0,0 +1,298 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 4 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 11 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 12 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 13 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 16 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 17 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 18 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 19 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 20 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 28 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 29 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 30 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 31 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 32 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 33 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 34 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 35 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 36 +draw rect 145 50 10 10 +probe rgb 150 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 37 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 38 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 39 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 40 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 41 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 42 +draw rect 175 20 10 10 +probe rgb 180 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 43 +draw rect 175 35 10 10 +probe rgb 180 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 44 +draw rect 175 50 10 10 +probe rgb 180 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 45 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 46 +draw rect 190 20 10 10 +probe rgb 195 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 47 +draw rect 190 35 10 10 +probe rgb 195 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 48 +draw rect 190 50 10 10 +probe rgb 195 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-index-rd.shader_test new file mode 100644 index 00000000..07329220 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-index-rd.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec4 expect 37 38 39 40 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-index-row-rd.shader_test new file mode 100644 index 00000000..c5a21c7b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-index-row-rd.shader_test @@ -0,0 +1,104 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 37 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 38 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 39 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 40 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-rd.shader_test new file mode 100644 index 00000000..ade091db --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-rd.shader_test @@ -0,0 +1,41 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-row-rd.shader_test new file mode 100644 index 00000000..fadf92d3 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-array-mat4-row-rd.shader_test @@ -0,0 +1,59 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat2-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat2-col-rd.shader_test new file mode 100644 index 00000000..e746610f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat2-col-rd.shader_test @@ -0,0 +1,43 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec2 expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform vec2 expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 expect 1 2 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat2-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat2-col-row-rd.shader_test new file mode 100644 index 00000000..3fccb2b1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat2-col-row-rd.shader_test @@ -0,0 +1,57 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat2-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat2-rd.shader_test new file mode 100644 index 00000000..21adf9b9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat2-rd.shader_test @@ -0,0 +1,35 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec2 expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform vec2 expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat2-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat2-row-rd.shader_test new file mode 100644 index 00000000..f0308704 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat2-row-rd.shader_test @@ -0,0 +1,43 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int row; +uniform float expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat3-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat3-col-rd.shader_test new file mode 100644 index 00000000..d8cf0f9d --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat3-col-rd.shader_test @@ -0,0 +1,48 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec3 expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform vec3 expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 expect 1 2 3 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 7 8 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat3-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat3-col-row-rd.shader_test new file mode 100644 index 00000000..9b7bf9d9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat3-col-row-rd.shader_test @@ -0,0 +1,83 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 7 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 9 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat3-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat3-rd.shader_test new file mode 100644 index 00000000..3ac08a78 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat3-rd.shader_test @@ -0,0 +1,35 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec3 expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform vec3 expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat3-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat3-row-rd.shader_test new file mode 100644 index 00000000..ef9b606e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat3-row-rd.shader_test @@ -0,0 +1,48 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int row; +uniform float expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat4-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat4-col-rd.shader_test new file mode 100644 index 00000000..347eabc3 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat4-col-rd.shader_test @@ -0,0 +1,53 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec4 expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform vec4 expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 expect 1 2 3 4 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 9 10 11 12 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 13 14 15 16 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat4-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat4-col-row-rd.shader_test new file mode 100644 index 00000000..e933419b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat4-col-row-rd.shader_test @@ -0,0 +1,119 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 4 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 11 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 12 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 13 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 16 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat4-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat4-rd.shader_test new file mode 100644 index 00000000..b0e5349f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat4-rd.shader_test @@ -0,0 +1,35 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec4 expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform vec4 expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat4-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat4-row-rd.shader_test new file mode 100644 index 00000000..132dd447 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-uniform-mat4-row-rd.shader_test @@ -0,0 +1,53 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +uniform int row; +uniform float expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-col-rd.shader_test new file mode 100644 index 00000000..f6e18948 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-col-rd.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); +} + +[fragment shader] +uniform int col; +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 expect 5 6 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-col-row-rd.shader_test new file mode 100644 index 00000000..a55ef831 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-col-row-rd.shader_test @@ -0,0 +1,61 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 5 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-index-col-rd.shader_test new file mode 100644 index 00000000..9490c599 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-index-col-rd.shader_test @@ -0,0 +1,72 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec2 expect 1 2 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec2 expect 5 6 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec2 expect 9 10 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 11 12 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 00000000..ccd18dff --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-index-col-row-rd.shader_test @@ -0,0 +1,110 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 5 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 9 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 85 20 10 10 +probe rgb 90 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 11 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 12 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-index-rd.shader_test new file mode 100644 index 00000000..fb5b3c7f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-index-rd.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); +} + +[fragment shader] +uniform int index; +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec2 expect 11 12 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-index-row-rd.shader_test new file mode 100644 index 00000000..996da969 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-index-row-rd.shader_test @@ -0,0 +1,72 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 11 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 12 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-rd.shader_test new file mode 100644 index 00000000..a732fac3 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-rd.shader_test @@ -0,0 +1,39 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); +} + +[fragment shader] +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-row-rd.shader_test new file mode 100644 index 00000000..c5774d54 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat2-row-rd.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-col-rd.shader_test new file mode 100644 index 00000000..5bd5208a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-col-rd.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); +} + +[fragment shader] +uniform int col; +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 expect 10 11 12 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 16 17 18 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-col-row-rd.shader_test new file mode 100644 index 00000000..d84c8abe --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-col-row-rd.shader_test @@ -0,0 +1,87 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 10 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 11 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 12 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 16 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 17 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 18 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-index-col-rd.shader_test new file mode 100644 index 00000000..dc696854 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-index-col-rd.shader_test @@ -0,0 +1,87 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec3 expect 1 2 3 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 7 8 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec3 expect 10 11 12 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 16 17 18 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec3 expect 19 20 21 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 22 23 24 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 25 26 27 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 00000000..baef9e35 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-index-col-row-rd.shader_test @@ -0,0 +1,188 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 7 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 9 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 10 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 11 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 12 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 16 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 17 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 18 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 19 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 20 +draw rect 115 20 10 10 +probe rgb 120 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 21 +draw rect 115 35 10 10 +probe rgb 120 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 22 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 23 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 24 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-index-rd.shader_test new file mode 100644 index 00000000..9eaf28bd --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-index-rd.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); +} + +[fragment shader] +uniform int index; +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec3 expect 22 23 24 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-index-row-rd.shader_test new file mode 100644 index 00000000..333f2209 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-index-row-rd.shader_test @@ -0,0 +1,87 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 22 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 23 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 24 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-rd.shader_test new file mode 100644 index 00000000..a812ac5c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-rd.shader_test @@ -0,0 +1,39 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); +} + +[fragment shader] +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-row-rd.shader_test new file mode 100644 index 00000000..31c02031 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat3-row-rd.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-col-rd.shader_test new file mode 100644 index 00000000..6dc38ec9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-col-rd.shader_test @@ -0,0 +1,57 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); +} + +[fragment shader] +uniform int col; +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 expect 17 18 19 20 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 25 26 27 28 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 29 30 31 32 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-col-row-rd.shader_test new file mode 100644 index 00000000..3cb4de04 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-col-row-rd.shader_test @@ -0,0 +1,123 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 17 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 18 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 19 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 20 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 28 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 29 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 30 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 31 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 32 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-index-col-rd.shader_test new file mode 100644 index 00000000..fba08678 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-index-col-rd.shader_test @@ -0,0 +1,102 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec4 expect 1 2 3 4 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 9 10 11 12 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 13 14 15 16 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec4 expect 17 18 19 20 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 25 26 27 28 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 29 30 31 32 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec4 expect 33 34 35 36 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 37 38 39 40 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 41 42 43 44 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 45 46 47 48 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 00000000..d017a225 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-index-col-row-rd.shader_test @@ -0,0 +1,296 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 4 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 11 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 12 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 13 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 16 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 17 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 18 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 19 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 20 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 28 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 29 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 30 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 31 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 32 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 33 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 34 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 35 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 36 +draw rect 145 50 10 10 +probe rgb 150 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 37 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 38 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 39 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 40 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 41 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 42 +draw rect 175 20 10 10 +probe rgb 180 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 43 +draw rect 175 35 10 10 +probe rgb 180 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 44 +draw rect 175 50 10 10 +probe rgb 180 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 45 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 46 +draw rect 190 20 10 10 +probe rgb 195 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 47 +draw rect 190 35 10 10 +probe rgb 195 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 48 +draw rect 190 50 10 10 +probe rgb 195 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-index-rd.shader_test new file mode 100644 index 00000000..b2a09792 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-index-rd.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); +} + +[fragment shader] +uniform int index; +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec4 expect 37 38 39 40 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-index-row-rd.shader_test new file mode 100644 index 00000000..f2908a2f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-index-row-rd.shader_test @@ -0,0 +1,102 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 37 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 38 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 39 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 40 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-rd.shader_test new file mode 100644 index 00000000..37075ccf --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-rd.shader_test @@ -0,0 +1,39 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); +} + +[fragment shader] +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-row-rd.shader_test new file mode 100644 index 00000000..acf00efe --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-array-mat4-row-rd.shader_test @@ -0,0 +1,57 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat2-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat2-col-rd.shader_test new file mode 100644 index 00000000..e7a4a00f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat2-col-rd.shader_test @@ -0,0 +1,45 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec2 expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2x2(1.0, 2.0, 3.0, 4.0); +} + +[fragment shader] +uniform int col; +uniform vec2 expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 expect 1 2 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat2-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat2-col-row-rd.shader_test new file mode 100644 index 00000000..965172d8 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat2-col-row-rd.shader_test @@ -0,0 +1,59 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2x2(1.0, 2.0, 3.0, 4.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat2-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat2-rd.shader_test new file mode 100644 index 00000000..34dcf37e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat2-rd.shader_test @@ -0,0 +1,37 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec2 expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2x2(1.0, 2.0, 3.0, 4.0); +} + +[fragment shader] +uniform vec2 expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat2-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat2-row-rd.shader_test new file mode 100644 index 00000000..1e7f5307 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat2-row-rd.shader_test @@ -0,0 +1,45 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2x2(1.0, 2.0, 3.0, 4.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat3-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat3-col-rd.shader_test new file mode 100644 index 00000000..bfb90277 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat3-col-rd.shader_test @@ -0,0 +1,50 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec3 expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +} + +[fragment shader] +uniform int col; +uniform vec3 expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 expect 1 2 3 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 7 8 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat3-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat3-col-row-rd.shader_test new file mode 100644 index 00000000..71cdc60e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat3-col-row-rd.shader_test @@ -0,0 +1,85 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 7 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 9 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat3-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat3-rd.shader_test new file mode 100644 index 00000000..0bb62f8a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat3-rd.shader_test @@ -0,0 +1,37 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec3 expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +} + +[fragment shader] +uniform vec3 expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat3-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat3-row-rd.shader_test new file mode 100644 index 00000000..33b85391 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat3-row-rd.shader_test @@ -0,0 +1,50 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat4-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat4-col-rd.shader_test new file mode 100644 index 00000000..df81b9b1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat4-col-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec4 expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +} + +[fragment shader] +uniform int col; +uniform vec4 expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 expect 1 2 3 4 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 9 10 11 12 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 13 14 15 16 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat4-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat4-col-row-rd.shader_test new file mode 100644 index 00000000..f719693a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat4-col-row-rd.shader_test @@ -0,0 +1,121 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 4 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 11 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 12 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 13 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 16 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat4-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat4-rd.shader_test new file mode 100644 index 00000000..21b4dc96 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat4-rd.shader_test @@ -0,0 +1,37 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec4 expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +} + +[fragment shader] +uniform vec4 expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat4-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat4-row-rd.shader_test new file mode 100644 index 00000000..b1460a43 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/fs-varying-mat4-row-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + gl_FragColor = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/variable-indexing.out b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/variable-indexing.out new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/variable-indexing.out diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-col-rd.shader_test new file mode 100644 index 00000000..2d2ee907 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-col-rd.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + color = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 expect 5 6 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-col-row-rd.shader_test new file mode 100644 index 00000000..983b3802 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-col-row-rd.shader_test @@ -0,0 +1,61 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + color = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 5 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..0694e6c8 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test @@ -0,0 +1,79 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-col-wr.shader_test new file mode 100644 index 00000000..107c552c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-col-wr.shader_test @@ -0,0 +1,60 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-col-rd.shader_test new file mode 100644 index 00000000..87d54786 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-col-rd.shader_test @@ -0,0 +1,72 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + color = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec2 expect 1 2 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec2 expect 5 6 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec2 expect 9 10 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 11 12 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 00000000..93b4ede0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-col-row-rd.shader_test @@ -0,0 +1,110 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + color = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 5 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 9 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 85 20 10 10 +probe rgb 90 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 11 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 12 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test new file mode 100644 index 00000000..dd8000f0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test @@ -0,0 +1,150 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 85 20 10 10 +probe rgb 90 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test new file mode 100644 index 00000000..e1791a84 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test @@ -0,0 +1,95 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-rd.shader_test new file mode 100644 index 00000000..e73f83ce --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-rd.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + color = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec2 expect 11 12 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-row-rd.shader_test new file mode 100644 index 00000000..06e6ad81 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-row-rd.shader_test @@ -0,0 +1,72 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + color = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 11 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 12 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test new file mode 100644 index 00000000..ffdd2abe --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test @@ -0,0 +1,96 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-wr.shader_test new file mode 100644 index 00000000..9b57db0d --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-index-wr.shader_test @@ -0,0 +1,68 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-rd.shader_test new file mode 100644 index 00000000..771ce237 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-rd.shader_test @@ -0,0 +1,39 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + color = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-row-rd.shader_test new file mode 100644 index 00000000..81a666ee --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-row-rd.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); + color = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-row-wr.shader_test new file mode 100644 index 00000000..acdefb9e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-row-wr.shader_test @@ -0,0 +1,61 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-wr.shader_test new file mode 100644 index 00000000..4c563c7d --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat2-wr.shader_test @@ -0,0 +1,51 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-col-rd.shader_test new file mode 100644 index 00000000..1bc756d2 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-col-rd.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + color = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 expect 10 11 12 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 16 17 18 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-col-row-rd.shader_test new file mode 100644 index 00000000..b8d5ba29 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-col-row-rd.shader_test @@ -0,0 +1,87 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + color = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 10 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 11 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 12 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 16 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 17 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 18 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..c7d2fec0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test @@ -0,0 +1,120 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-col-wr.shader_test new file mode 100644 index 00000000..f9b75df6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-col-wr.shader_test @@ -0,0 +1,68 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-col-rd.shader_test new file mode 100644 index 00000000..855b642a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-col-rd.shader_test @@ -0,0 +1,87 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + color = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec3 expect 1 2 3 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 7 8 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec3 expect 10 11 12 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 16 17 18 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec3 expect 19 20 21 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 22 23 24 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 25 26 27 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 00000000..2b0c8541 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-col-row-rd.shader_test @@ -0,0 +1,188 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + color = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 7 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 9 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 10 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 11 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 12 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 16 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 17 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 18 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 19 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 20 +draw rect 115 20 10 10 +probe rgb 120 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 21 +draw rect 115 35 10 10 +probe rgb 120 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 22 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 23 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 24 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test new file mode 100644 index 00000000..c8574af6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test @@ -0,0 +1,273 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 115 20 10 10 +probe rgb 120 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 115 35 10 10 +probe rgb 120 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test new file mode 100644 index 00000000..8555c1e7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test @@ -0,0 +1,119 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-rd.shader_test new file mode 100644 index 00000000..603d5b7a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-rd.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + color = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec3 expect 22 23 24 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-row-rd.shader_test new file mode 100644 index 00000000..a9428ea2 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-row-rd.shader_test @@ -0,0 +1,87 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + color = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 22 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 23 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 24 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test new file mode 100644 index 00000000..18deb57f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test @@ -0,0 +1,120 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-wr.shader_test new file mode 100644 index 00000000..24ccd462 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-index-wr.shader_test @@ -0,0 +1,68 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-rd.shader_test new file mode 100644 index 00000000..d8ccdebf --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-rd.shader_test @@ -0,0 +1,39 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + color = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-row-rd.shader_test new file mode 100644 index 00000000..cc67904b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-row-rd.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); + color = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-row-wr.shader_test new file mode 100644 index 00000000..fafac2ae --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-row-wr.shader_test @@ -0,0 +1,69 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-wr.shader_test new file mode 100644 index 00000000..5b402f58 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat3-wr.shader_test @@ -0,0 +1,51 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-col-rd.shader_test new file mode 100644 index 00000000..b074b8f8 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-col-rd.shader_test @@ -0,0 +1,57 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + color = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 expect 17 18 19 20 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 25 26 27 28 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 29 30 31 32 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-col-row-rd.shader_test new file mode 100644 index 00000000..4e44e53c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-col-row-rd.shader_test @@ -0,0 +1,123 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + color = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 17 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 18 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 19 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 20 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 28 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 29 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 30 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 31 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 32 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..65fcb343 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test @@ -0,0 +1,177 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-col-wr.shader_test new file mode 100644 index 00000000..f2c32e62 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-col-wr.shader_test @@ -0,0 +1,76 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-col-rd.shader_test new file mode 100644 index 00000000..e38e0e8f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-col-rd.shader_test @@ -0,0 +1,102 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + color = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec4 expect 1 2 3 4 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 9 10 11 12 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 13 14 15 16 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec4 expect 17 18 19 20 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 25 26 27 28 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 29 30 31 32 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec4 expect 33 34 35 36 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 37 38 39 40 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 41 42 43 44 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 45 46 47 48 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 00000000..efcfee10 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-col-row-rd.shader_test @@ -0,0 +1,296 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + color = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 4 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 11 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 12 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 13 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 16 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 17 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 18 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 19 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 20 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 28 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 29 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 30 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 31 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 32 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 33 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 34 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 35 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 36 +draw rect 145 50 10 10 +probe rgb 150 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 37 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 38 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 39 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 40 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 41 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 42 +draw rect 175 20 10 10 +probe rgb 180 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 43 +draw rect 175 35 10 10 +probe rgb 180 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 44 +draw rect 175 50 10 10 +probe rgb 180 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 45 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 46 +draw rect 190 20 10 10 +probe rgb 195 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 47 +draw rect 190 35 10 10 +probe rgb 195 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 48 +draw rect 190 50 10 10 +probe rgb 195 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test new file mode 100644 index 00000000..8d870133 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test @@ -0,0 +1,444 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 145 50 10 10 +probe rgb 150 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 175 20 10 10 +probe rgb 180 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 175 35 10 10 +probe rgb 180 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 175 50 10 10 +probe rgb 180 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 190 20 10 10 +probe rgb 195 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 190 35 10 10 +probe rgb 195 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 190 50 10 10 +probe rgb 195 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test new file mode 100644 index 00000000..b5508c92 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test @@ -0,0 +1,143 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-rd.shader_test new file mode 100644 index 00000000..35d12153 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-rd.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + color = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec4 expect 37 38 39 40 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-row-rd.shader_test new file mode 100644 index 00000000..4df31eea --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-row-rd.shader_test @@ -0,0 +1,102 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + color = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 37 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 38 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 39 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 40 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test new file mode 100644 index 00000000..10e35489 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test @@ -0,0 +1,144 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-wr.shader_test new file mode 100644 index 00000000..7b5d494d --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-index-wr.shader_test @@ -0,0 +1,68 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-rd.shader_test new file mode 100644 index 00000000..e5f63045 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-rd.shader_test @@ -0,0 +1,39 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + color = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-row-rd.shader_test new file mode 100644 index 00000000..2a164071 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-row-rd.shader_test @@ -0,0 +1,57 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); + color = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-row-wr.shader_test new file mode 100644 index 00000000..d7718d5e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-row-wr.shader_test @@ -0,0 +1,77 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-wr.shader_test new file mode 100644 index 00000000..e4f81d1b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-array-mat4-wr.shader_test @@ -0,0 +1,51 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-col-rd.shader_test new file mode 100644 index 00000000..4e9b8bdf --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-col-rd.shader_test @@ -0,0 +1,44 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); + color = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 expect 1 2 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-col-row-rd.shader_test new file mode 100644 index 00000000..e29bea6b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-col-row-rd.shader_test @@ -0,0 +1,58 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); + color = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..e31bc395 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-col-row-wr.shader_test @@ -0,0 +1,74 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-col-wr.shader_test new file mode 100644 index 00000000..4e70f6f0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-col-wr.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-rd.shader_test new file mode 100644 index 00000000..e375eb1f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-rd.shader_test @@ -0,0 +1,36 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); + color = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-row-rd.shader_test new file mode 100644 index 00000000..0f750647 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-row-rd.shader_test @@ -0,0 +1,44 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); + color = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-row-wr.shader_test new file mode 100644 index 00000000..e8438d9b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-row-wr.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-wr.shader_test new file mode 100644 index 00000000..5117b6a7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat2-wr.shader_test @@ -0,0 +1,46 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-col-rd.shader_test new file mode 100644 index 00000000..9e93244f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-col-rd.shader_test @@ -0,0 +1,49 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + color = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 expect 1 2 3 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 7 8 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-col-row-rd.shader_test new file mode 100644 index 00000000..46f8da62 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-col-row-rd.shader_test @@ -0,0 +1,84 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + color = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 7 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 9 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..e38849c3 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-col-row-wr.shader_test @@ -0,0 +1,115 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-col-wr.shader_test new file mode 100644 index 00000000..2510a7e7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-col-wr.shader_test @@ -0,0 +1,63 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-rd.shader_test new file mode 100644 index 00000000..5e7f0bc2 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-rd.shader_test @@ -0,0 +1,36 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + color = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-row-rd.shader_test new file mode 100644 index 00000000..f1e90f1b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-row-rd.shader_test @@ -0,0 +1,49 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + color = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-row-wr.shader_test new file mode 100644 index 00000000..d059f114 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-row-wr.shader_test @@ -0,0 +1,64 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-wr.shader_test new file mode 100644 index 00000000..be579a1a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat3-wr.shader_test @@ -0,0 +1,46 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-col-rd.shader_test new file mode 100644 index 00000000..0cd35930 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-col-rd.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + color = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 expect 1 2 3 4 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 9 10 11 12 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 13 14 15 16 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-col-row-rd.shader_test new file mode 100644 index 00000000..9caeb46c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-col-row-rd.shader_test @@ -0,0 +1,120 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + color = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 4 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 11 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 12 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 13 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 16 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..d3459486 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-col-row-wr.shader_test @@ -0,0 +1,172 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-col-wr.shader_test new file mode 100644 index 00000000..e070e881 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-col-wr.shader_test @@ -0,0 +1,71 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-rd.shader_test new file mode 100644 index 00000000..b081a640 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-rd.shader_test @@ -0,0 +1,36 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + color = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-row-rd.shader_test new file mode 100644 index 00000000..d614f085 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-row-rd.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + color = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-row-wr.shader_test new file mode 100644 index 00000000..21ec3183 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-row-wr.shader_test @@ -0,0 +1,72 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-wr.shader_test new file mode 100644 index 00000000..1588eddd --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-temp-mat4-wr.shader_test @@ -0,0 +1,46 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-col-rd.shader_test new file mode 100644 index 00000000..e54710e6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-col-rd.shader_test @@ -0,0 +1,50 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 expect 5 6 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-col-row-rd.shader_test new file mode 100644 index 00000000..dbe55722 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-col-row-rd.shader_test @@ -0,0 +1,64 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 5 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-index-col-rd.shader_test new file mode 100644 index 00000000..0d392bb4 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-index-col-rd.shader_test @@ -0,0 +1,75 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec2 expect 1 2 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec2 expect 5 6 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec2 expect 9 10 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 11 12 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 00000000..39e2bf26 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-index-col-row-rd.shader_test @@ -0,0 +1,113 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 5 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 9 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 85 20 10 10 +probe rgb 90 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 11 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 12 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-index-rd.shader_test new file mode 100644 index 00000000..416b8976 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-index-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec2 expect 11 12 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-index-row-rd.shader_test new file mode 100644 index 00000000..a5ca8c92 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-index-row-rd.shader_test @@ -0,0 +1,75 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 11 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 12 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-rd.shader_test new file mode 100644 index 00000000..3815d3cd --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-rd.shader_test @@ -0,0 +1,42 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec2 expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-row-rd.shader_test new file mode 100644 index 00000000..07f5cd46 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat2-row-rd.shader_test @@ -0,0 +1,50 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +uniform mat2x2[3] m = mat2x2[3]( + mat2x2(1.0, 2.0, 3.0, 4.0), + mat2x2(5.0, 6.0, 7.0, 8.0), + mat2x2(9.0, 10.0, 11.0, 12.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-col-rd.shader_test new file mode 100644 index 00000000..368804f7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-col-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 expect 10 11 12 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 16 17 18 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-col-row-rd.shader_test new file mode 100644 index 00000000..ced6051d --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-col-row-rd.shader_test @@ -0,0 +1,90 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 10 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 11 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 12 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 16 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 17 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 18 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-index-col-rd.shader_test new file mode 100644 index 00000000..0198c42a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-index-col-rd.shader_test @@ -0,0 +1,90 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec3 expect 1 2 3 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 7 8 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec3 expect 10 11 12 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 16 17 18 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec3 expect 19 20 21 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 22 23 24 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 25 26 27 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 00000000..7490d993 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-index-col-row-rd.shader_test @@ -0,0 +1,191 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 7 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 9 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 10 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 11 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 12 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 16 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 17 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 18 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 19 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 20 +draw rect 115 20 10 10 +probe rgb 120 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 21 +draw rect 115 35 10 10 +probe rgb 120 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 22 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 23 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 24 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-index-rd.shader_test new file mode 100644 index 00000000..4500d127 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-index-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec3 expect 22 23 24 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-index-row-rd.shader_test new file mode 100644 index 00000000..b7d5405c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-index-row-rd.shader_test @@ -0,0 +1,90 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 22 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 23 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 24 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-rd.shader_test new file mode 100644 index 00000000..3ad8b6db --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-rd.shader_test @@ -0,0 +1,42 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec3 expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-row-rd.shader_test new file mode 100644 index 00000000..b4731221 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat3-row-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +uniform mat3x3[3] m = mat3x3[3]( + mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), + mat3x3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0), + mat3x3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-col-rd.shader_test new file mode 100644 index 00000000..8011a820 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-col-rd.shader_test @@ -0,0 +1,60 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 expect 17 18 19 20 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 25 26 27 28 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 29 30 31 32 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-col-row-rd.shader_test new file mode 100644 index 00000000..d37e46ba --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-col-row-rd.shader_test @@ -0,0 +1,126 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 17 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 18 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 19 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 20 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 28 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 29 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 30 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 31 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 32 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-index-col-rd.shader_test new file mode 100644 index 00000000..821729ef --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-index-col-rd.shader_test @@ -0,0 +1,105 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec4 expect 1 2 3 4 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 9 10 11 12 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 13 14 15 16 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec4 expect 17 18 19 20 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 25 26 27 28 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 29 30 31 32 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec4 expect 33 34 35 36 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 37 38 39 40 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 41 42 43 44 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 45 46 47 48 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 00000000..44d34739 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-index-col-row-rd.shader_test @@ -0,0 +1,299 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 4 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 11 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 12 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 13 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 16 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 17 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 18 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 19 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 20 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 28 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 29 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 30 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 31 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 32 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 33 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 34 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 35 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 36 +draw rect 145 50 10 10 +probe rgb 150 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 37 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 38 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 39 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 40 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 41 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 42 +draw rect 175 20 10 10 +probe rgb 180 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 43 +draw rect 175 35 10 10 +probe rgb 180 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 44 +draw rect 175 50 10 10 +probe rgb 180 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 45 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 46 +draw rect 190 20 10 10 +probe rgb 195 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 47 +draw rect 190 35 10 10 +probe rgb 195 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 48 +draw rect 190 50 10 10 +probe rgb 195 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-index-rd.shader_test new file mode 100644 index 00000000..74f195d7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-index-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec4 expect 37 38 39 40 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-index-row-rd.shader_test new file mode 100644 index 00000000..f25e5976 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-index-row-rd.shader_test @@ -0,0 +1,105 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 37 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 38 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 39 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 40 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-rd.shader_test new file mode 100644 index 00000000..28dd319f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-rd.shader_test @@ -0,0 +1,42 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec4 expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-row-rd.shader_test new file mode 100644 index 00000000..a87f0af2 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-array-mat4-row-rd.shader_test @@ -0,0 +1,60 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +uniform mat4x4[3] m = mat4x4[3]( + mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0), + mat4x4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0), + mat4x4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0)); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat2-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat2-col-rd.shader_test new file mode 100644 index 00000000..536d7c8b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat2-col-rd.shader_test @@ -0,0 +1,44 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec2 expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec2 expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 expect 1 2 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat2-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat2-col-row-rd.shader_test new file mode 100644 index 00000000..7fb50d43 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat2-col-row-rd.shader_test @@ -0,0 +1,58 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat2-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat2-rd.shader_test new file mode 100644 index 00000000..30703ad0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat2-rd.shader_test @@ -0,0 +1,36 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec2 expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec2 expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat2-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat2-row-rd.shader_test new file mode 100644 index 00000000..178bc414 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat2-row-rd.shader_test @@ -0,0 +1,44 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +uniform mat2x2 m = mat2x2(1.0, 2.0, 3.0, 4.0); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat3-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat3-col-rd.shader_test new file mode 100644 index 00000000..c9bc3b73 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat3-col-rd.shader_test @@ -0,0 +1,49 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec3 expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec3 expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 expect 1 2 3 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 7 8 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat3-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat3-col-row-rd.shader_test new file mode 100644 index 00000000..00d3d707 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat3-col-row-rd.shader_test @@ -0,0 +1,84 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 7 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 9 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat3-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat3-rd.shader_test new file mode 100644 index 00000000..9b46f4f1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat3-rd.shader_test @@ -0,0 +1,36 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec3 expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec3 expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat3-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat3-row-rd.shader_test new file mode 100644 index 00000000..ed6692ad --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat3-row-rd.shader_test @@ -0,0 +1,49 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +uniform mat3x3 m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat4-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat4-col-rd.shader_test new file mode 100644 index 00000000..745a1220 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat4-col-rd.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec4 expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec4 expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 expect 1 2 3 4 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 9 10 11 12 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 13 14 15 16 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat4-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat4-col-row-rd.shader_test new file mode 100644 index 00000000..1df828b4 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat4-col-row-rd.shader_test @@ -0,0 +1,120 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 4 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 11 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 12 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 13 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 16 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat4-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat4-rd.shader_test new file mode 100644 index 00000000..302cc257 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat4-rd.shader_test @@ -0,0 +1,36 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec4 expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec4 expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat4-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat4-row-rd.shader_test new file mode 100644 index 00000000..2e6e5d90 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-uniform-mat4-row-rd.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + color = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +uniform mat4x4 m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-col-rd.shader_test new file mode 100644 index 00000000..9c3a8415 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-col-rd.shader_test @@ -0,0 +1,63 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1][col] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 expect 5 6 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-col-row-rd.shader_test new file mode 100644 index 00000000..6d14f4bf --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-col-row-rd.shader_test @@ -0,0 +1,77 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1][col][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 5 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..9843980e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test @@ -0,0 +1,90 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; +} + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-col-wr.shader_test new file mode 100644 index 00000000..8903c222 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-col-wr.shader_test @@ -0,0 +1,70 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; +} + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-col-rd.shader_test new file mode 100644 index 00000000..e18b2f53 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-col-rd.shader_test @@ -0,0 +1,88 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[index][col] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec2 expect 1 2 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec2 expect 5 6 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec2 expect 9 10 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 11 12 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 00000000..7a6ecd29 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-col-row-rd.shader_test @@ -0,0 +1,126 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[index][col][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 5 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 9 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 85 20 10 10 +probe rgb 90 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 11 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 12 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test new file mode 100644 index 00000000..cd068d3c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test @@ -0,0 +1,161 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; +} + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 85 20 10 10 +probe rgb 90 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test new file mode 100644 index 00000000..51755f35 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test @@ -0,0 +1,105 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; +} + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-rd.shader_test new file mode 100644 index 00000000..0e39c390 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-rd.shader_test @@ -0,0 +1,68 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[index][1] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec2 expect 11 12 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-row-rd.shader_test new file mode 100644 index 00000000..ecffc136 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-row-rd.shader_test @@ -0,0 +1,88 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[index][1][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 11 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 12 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test new file mode 100644 index 00000000..0064b114 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test @@ -0,0 +1,107 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; +} + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-wr.shader_test new file mode 100644 index 00000000..2928ae82 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-index-wr.shader_test @@ -0,0 +1,78 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; +} + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-rd.shader_test new file mode 100644 index 00000000..a9f3feb9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec2 expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1][1] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 expect 7 8 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-row-rd.shader_test new file mode 100644 index 00000000..19661fea --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-row-rd.shader_test @@ -0,0 +1,63 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat2(1.0, 2.0, 3.0, 4.0); + m[1] = mat2(5.0, 6.0, 7.0, 8.0); + m[2] = mat2(9.0, 10.0, 11.0, 12.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying mat2x2[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1][1][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 7 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-row-wr.shader_test new file mode 100644 index 00000000..67bfa34b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-row-wr.shader_test @@ -0,0 +1,72 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; +} + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-wr.shader_test new file mode 100644 index 00000000..01e3df10 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat2-wr.shader_test @@ -0,0 +1,61 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; +} + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-col-rd.shader_test new file mode 100644 index 00000000..4a522a2c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-col-rd.shader_test @@ -0,0 +1,68 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1][col] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 expect 10 11 12 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 16 17 18 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-col-row-rd.shader_test new file mode 100644 index 00000000..f5a694cf --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-col-row-rd.shader_test @@ -0,0 +1,103 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1][col][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 10 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 11 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 12 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 16 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 17 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 18 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..0f18fe15 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test @@ -0,0 +1,131 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; +} + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-col-wr.shader_test new file mode 100644 index 00000000..7c5fe6d4 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-col-wr.shader_test @@ -0,0 +1,78 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; +} + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-col-rd.shader_test new file mode 100644 index 00000000..769137c0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-col-rd.shader_test @@ -0,0 +1,103 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[index][col] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec3 expect 1 2 3 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 7 8 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec3 expect 10 11 12 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 16 17 18 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec3 expect 19 20 21 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 22 23 24 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 25 26 27 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 00000000..adb50a40 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-col-row-rd.shader_test @@ -0,0 +1,204 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[index][col][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 7 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 9 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 10 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 11 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 12 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 16 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 17 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 18 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 19 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 20 +draw rect 115 20 10 10 +probe rgb 120 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 21 +draw rect 115 35 10 10 +probe rgb 120 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 22 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 23 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 24 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test new file mode 100644 index 00000000..0c283090 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test @@ -0,0 +1,284 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; +} + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 115 20 10 10 +probe rgb 120 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 115 35 10 10 +probe rgb 120 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test new file mode 100644 index 00000000..23e87f70 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test @@ -0,0 +1,129 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; +} + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-rd.shader_test new file mode 100644 index 00000000..4e320a0e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-rd.shader_test @@ -0,0 +1,68 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[index][1] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec3 expect 22 23 24 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-row-rd.shader_test new file mode 100644 index 00000000..1e1871ec --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-row-rd.shader_test @@ -0,0 +1,103 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[index][1][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 22 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 23 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 24 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test new file mode 100644 index 00000000..3f403739 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test @@ -0,0 +1,131 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; +} + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-wr.shader_test new file mode 100644 index 00000000..2c14a6fb --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-index-wr.shader_test @@ -0,0 +1,78 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; +} + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-rd.shader_test new file mode 100644 index 00000000..70941ebc --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec3 expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1][1] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 expect 13 14 15 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-row-rd.shader_test new file mode 100644 index 00000000..58a6f47d --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-row-rd.shader_test @@ -0,0 +1,68 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + m[1] = mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0); + m[2] = mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying mat3x3[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1][1][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 13 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-row-wr.shader_test new file mode 100644 index 00000000..df32fb8e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-row-wr.shader_test @@ -0,0 +1,80 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; +} + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-wr.shader_test new file mode 100644 index 00000000..c57fb29c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat3-wr.shader_test @@ -0,0 +1,61 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; +} + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-col-rd.shader_test new file mode 100644 index 00000000..35b6edd5 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-col-rd.shader_test @@ -0,0 +1,73 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1][col] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 expect 17 18 19 20 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 25 26 27 28 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 29 30 31 32 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-col-row-rd.shader_test new file mode 100644 index 00000000..ef73b498 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-col-row-rd.shader_test @@ -0,0 +1,139 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1][col][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 17 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 18 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 19 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 20 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 28 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 29 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 30 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 31 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 32 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..ebe2f395 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test @@ -0,0 +1,188 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; +} + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-col-wr.shader_test new file mode 100644 index 00000000..0918e208 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-col-wr.shader_test @@ -0,0 +1,86 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; +} + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-col-rd.shader_test new file mode 100644 index 00000000..276ff3b8 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-col-rd.shader_test @@ -0,0 +1,118 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[index][col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[index][col] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec4 expect 1 2 3 4 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 9 10 11 12 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 13 14 15 16 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec4 expect 17 18 19 20 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 25 26 27 28 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 29 30 31 32 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec4 expect 33 34 35 36 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 37 38 39 40 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 41 42 43 44 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 45 46 47 48 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 00000000..265bcf2a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-col-row-rd.shader_test @@ -0,0 +1,312 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[index][col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[index][col][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 4 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 11 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 12 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 13 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 16 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform float expect 17 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 18 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 19 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 20 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 25 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 26 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 27 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 28 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 29 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 30 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 31 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 32 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform float expect 33 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 34 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 35 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 36 +draw rect 145 50 10 10 +probe rgb 150 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 37 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 38 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 39 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 40 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 41 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 42 +draw rect 175 20 10 10 +probe rgb 180 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 43 +draw rect 175 35 10 10 +probe rgb 180 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 44 +draw rect 175 50 10 10 +probe rgb 180 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 45 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 46 +draw rect 190 20 10 10 +probe rgb 195 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 47 +draw rect 190 35 10 10 +probe rgb 195 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 48 +draw rect 190 50 10 10 +probe rgb 195 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test new file mode 100644 index 00000000..8b865f09 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test @@ -0,0 +1,455 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; +} + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 145 50 10 10 +probe rgb 150 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 175 20 10 10 +probe rgb 180 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 175 35 10 10 +probe rgb 180 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 175 50 10 10 +probe rgb 180 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 190 20 10 10 +probe rgb 195 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 190 35 10 10 +probe rgb 195 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 190 50 10 10 +probe rgb 195 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test new file mode 100644 index 00000000..f045a3bf --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test @@ -0,0 +1,153 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; +} + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-rd.shader_test new file mode 100644 index 00000000..983d1dff --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-rd.shader_test @@ -0,0 +1,68 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[index][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[index][1] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec4 expect 37 38 39 40 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-row-rd.shader_test new file mode 100644 index 00000000..118b865f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-row-rd.shader_test @@ -0,0 +1,118 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int index; +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[index][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int index; +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[index][1][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform float expect 37 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 38 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 39 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 40 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test new file mode 100644 index 00000000..5baaf329 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test @@ -0,0 +1,155 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; +} + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-wr.shader_test new file mode 100644 index 00000000..351238bd --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-index-wr.shader_test @@ -0,0 +1,78 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; +} + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-rd.shader_test new file mode 100644 index 00000000..47cfcf99 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1][1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec4 expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1][1] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 expect 21 22 23 24 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-row-rd.shader_test new file mode 100644 index 00000000..4fa8525a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-row-rd.shader_test @@ -0,0 +1,73 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m[0] = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + m[1] = mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0); + m[2] = mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1][1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying mat4x4[3] m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1][1][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 21 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 22 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 23 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 24 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-row-wr.shader_test new file mode 100644 index 00000000..1374bce0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-row-wr.shader_test @@ -0,0 +1,88 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; +} + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-wr.shader_test new file mode 100644 index 00000000..3eb0a508 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-array-mat4-wr.shader_test @@ -0,0 +1,61 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; +} + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-col-rd.shader_test new file mode 100644 index 00000000..fa2b2707 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-col-rd.shader_test @@ -0,0 +1,61 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec2 expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2x2(1.0, 2.0, 3.0, 4.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec2 expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[col] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 expect 1 2 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-col-row-rd.shader_test new file mode 100644 index 00000000..d475dbde --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-col-row-rd.shader_test @@ -0,0 +1,75 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2x2(1.0, 2.0, 3.0, 4.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[col][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..93f37707 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-col-row-wr.shader_test @@ -0,0 +1,83 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; +} + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-col-wr.shader_test new file mode 100644 index 00000000..d5c79ba7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-col-wr.shader_test @@ -0,0 +1,63 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; +} + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-rd.shader_test new file mode 100644 index 00000000..c7f1827c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-rd.shader_test @@ -0,0 +1,53 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec2 expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2x2(1.0, 2.0, 3.0, 4.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec2 expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 expect 3 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-row-rd.shader_test new file mode 100644 index 00000000..4fccf9ce --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-row-rd.shader_test @@ -0,0 +1,61 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2x2(1.0, 2.0, 3.0, 4.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying mat2x2 m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 3 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 4 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-row-wr.shader_test new file mode 100644 index 00000000..773ffc5e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-row-wr.shader_test @@ -0,0 +1,65 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; +} + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-wr.shader_test new file mode 100644 index 00000000..e07316b8 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat2-wr.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; +} + +[fragment shader] +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-col-rd.shader_test new file mode 100644 index 00000000..3ad7ccef --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-col-rd.shader_test @@ -0,0 +1,66 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec3 expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec3 expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[col] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 expect 1 2 3 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 expect 7 8 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-col-row-rd.shader_test new file mode 100644 index 00000000..ff386787 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-col-row-rd.shader_test @@ -0,0 +1,101 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[col][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 7 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 8 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 9 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..b1c04006 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-col-row-wr.shader_test @@ -0,0 +1,124 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; +} + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-col-wr.shader_test new file mode 100644 index 00000000..00af416a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-col-wr.shader_test @@ -0,0 +1,71 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; +} + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-rd.shader_test new file mode 100644 index 00000000..dd663ab4 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-rd.shader_test @@ -0,0 +1,53 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec3 expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec3 expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 expect 4 5 6 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-row-rd.shader_test new file mode 100644 index 00000000..b76f8ca6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-row-rd.shader_test @@ -0,0 +1,66 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying mat3x3 m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 4 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 5 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 6 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-row-wr.shader_test new file mode 100644 index 00000000..1addf038 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-row-wr.shader_test @@ -0,0 +1,73 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; +} + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-wr.shader_test new file mode 100644 index 00000000..1c5f63e5 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat3-wr.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; +} + +[fragment shader] +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-col-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-col-rd.shader_test new file mode 100644 index 00000000..9a26d661 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-col-rd.shader_test @@ -0,0 +1,71 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform vec4 expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform vec4 expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[col] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 expect 1 2 3 4 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 expect 9 10 11 12 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 expect 13 14 15 16 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-col-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-col-row-rd.shader_test new file mode 100644 index 00000000..f21244e9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-col-row-rd.shader_test @@ -0,0 +1,137 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[col][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int col; +uniform int row; +uniform float expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[col][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform float expect 1 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 2 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 3 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 4 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform float expect 9 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 10 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 11 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 12 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform float expect 13 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 14 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 15 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 16 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-col-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..9c16d067 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-col-row-wr.shader_test @@ -0,0 +1,181 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; +} + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-col-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-col-wr.shader_test new file mode 100644 index 00000000..fbb374d6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-col-wr.shader_test @@ -0,0 +1,79 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; +} + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-rd.shader_test new file mode 100644 index 00000000..175bed8e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-rd.shader_test @@ -0,0 +1,53 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform vec4 expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform vec4 expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 expect 5 6 7 8 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-row-rd.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-row-rd.shader_test new file mode 100644 index 00000000..ea05c6ab --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-row-rd.shader_test @@ -0,0 +1,71 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +uniform int row; +uniform float expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat4x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); + + /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "A vertex shader may also read varying variables, getting back the + * same values it has written. Reading a varying variable in a vertex + * shader returns undefined values if it is read before being + * written." + */ + color = (m[1][row] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +uniform int row; +uniform float expect; +varying mat4x4 m; +varying vec4 color; + +void main() +{ + /* There is some trickery here. The fragment shader has to actually use + * the varyings generated by the vertex shader, or the compiler (more + * likely the linker) might demote the varying outputs to just be vertex + * shader global variables. Since the point of the test is the vertex + * shader reading from a varying, that would defeat the test. + */ + gl_FragColor = (m[1][row] == expect) + ? color : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform float expect 5 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform float expect 6 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform float expect 7 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform float expect 8 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-row-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-row-wr.shader_test new file mode 100644 index 00000000..2ed0d6c3 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-row-wr.shader_test @@ -0,0 +1,81 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; +} + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-wr.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-wr.shader_test new file mode 100644 index 00000000..a55c8ba1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/variable-indexing/vs-varying-mat4-wr.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; +} + +[fragment shader] +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-all-equal-bool-array.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-all-equal-bool-array.shader_test new file mode 100644 index 00000000..c9c1e6f1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-all-equal-bool-array.shader_test @@ -0,0 +1,39 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +varying vec4 color; + +uniform bool[2] ub = bool[2](bool(0), bool(1)); + +void main() +{ + if (ub == bool[2](bool(1), bool(1))) { + color = vec4(1, 0, 0, 1); + } else { + color = vec4(0, 1, 0, 1); + } + + gl_Position = 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/spec/glsl-es-1.00/execution/1.20/vs-assign-varied-struct.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-assign-varied-struct.shader_test new file mode 100644 index 00000000..e275bba9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-assign-varied-struct.shader_test @@ -0,0 +1,39 @@ +# Test initialization of an array of structures where the elements of +# the structure do not all have the same vector size. +# +# This test reproduces the problem described in +# https://bugs.freedesktop.org/show_bug.cgi?id=40865#c9. + +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +void main(void) +{ + float x = 3.0; + struct s { float f; vec3 v; }; + s a[1]=s[](s(x,vec3(x))); + if (a[0].f==3.0) + gl_FrontColor = vec4(0.0, 1.0, 0.0, 1.0); // green + else + gl_FrontColor = vec4(1.0, 0.0, 0.0, 1.0); // red + gl_Position = vertex; +} + +[fragment shader] +void main(void) +{ + gl_FragColor = gl_Color; +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 1.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2-ivec.shader_test new file mode 100644 index 00000000..c02a01de --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2-ivec.shader_test @@ -0,0 +1,57 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec2 c = ivec2(2, 3); +const ivec2 r = ivec2(4, 5); +uniform mat2 expected = mat2(8, 12, 10, 15); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2.shader_test new file mode 100644 index 00000000..44434694 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2.shader_test @@ -0,0 +1,37 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + +const vec2 c = vec2(2, 3); +const vec2 r = vec2(4, 5); +uniform mat2 expected = mat2(8, 12, 10, 15); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x2-ivec.shader_test new file mode 100644 index 00000000..b45e696e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x2-ivec.shader_test @@ -0,0 +1,57 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec2 c = ivec2(2, 3); +const ivec2 r = ivec2(4, 5); +uniform mat2x2 expected = mat2x2(8, 12, 10, 15); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2x2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x2.shader_test new file mode 100644 index 00000000..61a26e47 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x2.shader_test @@ -0,0 +1,37 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + +const vec2 c = vec2(2, 3); +const vec2 r = vec2(4, 5); +uniform mat2x2 expected = mat2x2(8, 12, 10, 15); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2x2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x3-ivec.shader_test new file mode 100644 index 00000000..49210b24 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x3-ivec.shader_test @@ -0,0 +1,59 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x3fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec3 c = ivec3(2, 3, 4); +const ivec2 r = ivec2(5, 6); +uniform mat2x3 expected = mat2x3(10, 15, 20, 12, 18, 24); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2x3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x3.shader_test new file mode 100644 index 00000000..54c9231e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x3.shader_test @@ -0,0 +1,39 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x3fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + +const vec3 c = vec3(2, 3, 4); +const vec2 r = vec2(5, 6); +uniform mat2x3 expected = mat2x3(10, 15, 20, 12, 18, 24); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2x3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x4-ivec.shader_test new file mode 100644 index 00000000..7d2daed2 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x4-ivec.shader_test @@ -0,0 +1,59 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec4 c = ivec4(2, 3, 4, 5); +const ivec2 r = ivec2(6, 7); +uniform mat2x4 expected = mat2x4(12, 18, 24, 30, 14, 21, 28, 35); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2x4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x4.shader_test new file mode 100644 index 00000000..d7098643 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat2x4.shader_test @@ -0,0 +1,39 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + +const vec4 c = vec4(2, 3, 4, 5); +const vec2 r = vec2(6, 7); +uniform mat2x4 expected = mat2x4(12, 18, 24, 30, 14, 21, 28, 35); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2x4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3-ivec.shader_test new file mode 100644 index 00000000..0ca67e25 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3-ivec.shader_test @@ -0,0 +1,57 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec3 c = ivec3(2, 3, 4); +const ivec3 r = ivec3(5, 6, 7); +uniform mat3 expected = mat3(10, 15, 20, 12, 18, 24, 14, 21, 28); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3.shader_test new file mode 100644 index 00000000..ba727bce --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3.shader_test @@ -0,0 +1,37 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + +const vec3 c = vec3(2, 3, 4); +const vec3 r = vec3(5, 6, 7); +uniform mat3 expected = mat3(10, 15, 20, 12, 18, 24, 14, 21, 28); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x2-ivec.shader_test new file mode 100644 index 00000000..7af7ce1d --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x2-ivec.shader_test @@ -0,0 +1,59 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec2 c = ivec2(2, 3); +const ivec3 r = ivec3(4, 5, 6); +uniform mat3x2 expected = mat3x2(8, 12, 10, 15, 12, 18); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3x2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x2.shader_test new file mode 100644 index 00000000..894dfb41 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x2.shader_test @@ -0,0 +1,39 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + +const vec2 c = vec2(2, 3); +const vec3 r = vec3(4, 5, 6); +uniform mat3x2 expected = mat3x2(8, 12, 10, 15, 12, 18); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3x2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x3-ivec.shader_test new file mode 100644 index 00000000..fa11bd0e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x3-ivec.shader_test @@ -0,0 +1,57 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec3 c = ivec3(2, 3, 4); +const ivec3 r = ivec3(5, 6, 7); +uniform mat3x3 expected = mat3x3(10, 15, 20, 12, 18, 24, 14, 21, 28); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3x3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x3.shader_test new file mode 100644 index 00000000..c01f50ed --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x3.shader_test @@ -0,0 +1,37 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + +const vec3 c = vec3(2, 3, 4); +const vec3 r = vec3(5, 6, 7); +uniform mat3x3 expected = mat3x3(10, 15, 20, 12, 18, 24, 14, 21, 28); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3x3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x4-ivec.shader_test new file mode 100644 index 00000000..41565eb7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x4-ivec.shader_test @@ -0,0 +1,59 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec4 c = ivec4(2, 3, 4, 5); +const ivec3 r = ivec3(6, 7, 8); +uniform mat3x4 expected = mat3x4(12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3x4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x4.shader_test new file mode 100644 index 00000000..734d3513 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x4.shader_test @@ -0,0 +1,39 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + +const vec4 c = vec4(2, 3, 4, 5); +const vec3 r = vec3(6, 7, 8); +uniform mat3x4 expected = mat3x4(12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3x4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4-ivec.shader_test new file mode 100644 index 00000000..7c634497 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4-ivec.shader_test @@ -0,0 +1,57 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec4 c = ivec4(2, 3, 4, 5); +const ivec4 r = ivec4(6, 7, 8, 9); +uniform mat4 expected = mat4(12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40, 18, 27, 36, 45); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4.shader_test new file mode 100644 index 00000000..df346d47 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4.shader_test @@ -0,0 +1,37 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + +const vec4 c = vec4(2, 3, 4, 5); +const vec4 r = vec4(6, 7, 8, 9); +uniform mat4 expected = mat4(12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40, 18, 27, 36, 45); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x2-ivec.shader_test new file mode 100644 index 00000000..9592645f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x2-ivec.shader_test @@ -0,0 +1,59 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec2 c = ivec2(2, 3); +const ivec4 r = ivec4(4, 5, 6, 7); +uniform mat4x2 expected = mat4x2(8, 12, 10, 15, 12, 18, 14, 21); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4x2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x2.shader_test new file mode 100644 index 00000000..2e37c9f1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x2.shader_test @@ -0,0 +1,39 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + +const vec2 c = vec2(2, 3); +const vec4 r = vec4(4, 5, 6, 7); +uniform mat4x2 expected = mat4x2(8, 12, 10, 15, 12, 18, 14, 21); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4x2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x3-ivec.shader_test new file mode 100644 index 00000000..39dc2ad0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x3-ivec.shader_test @@ -0,0 +1,59 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x3fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec3 c = ivec3(2, 3, 4); +const ivec4 r = ivec4(5, 6, 7, 8); +uniform mat4x3 expected = mat4x3(10, 15, 20, 12, 18, 24, 14, 21, 28, 16, 24, 32); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4x3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x3.shader_test new file mode 100644 index 00000000..61493be6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x3.shader_test @@ -0,0 +1,39 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x3fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + +const vec3 c = vec3(2, 3, 4); +const vec4 r = vec4(5, 6, 7, 8); +uniform mat4x3 expected = mat4x3(10, 15, 20, 12, 18, 24, 14, 21, 28, 16, 24, 32); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4x3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x4-ivec.shader_test new file mode 100644 index 00000000..cad7a261 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x4-ivec.shader_test @@ -0,0 +1,57 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + + +const ivec4 c = ivec4(2, 3, 4, 5); +const ivec4 r = ivec4(6, 7, 8, 9); +uniform mat4x4 expected = mat4x4(12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40, 18, 27, 36, 45); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4x4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x4.shader_test new file mode 100644 index 00000000..9c7ca0d1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat4x4.shader_test @@ -0,0 +1,37 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + +const vec4 c = vec4(2, 3, 4, 5); +const vec4 r = vec4(6, 7, 8, 9); +uniform mat4x4 expected = mat4x4(12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40, 18, 27, 36, 45); +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4x4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2-ivec.shader_test new file mode 100644 index 00000000..78e20f90 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2-ivec.shader_test @@ -0,0 +1,77 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec2 c; +uniform ivec2 r; +uniform mat2 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec2 c 2 3 +uniform ivec2 r 4 5 +uniform mat2x2 expected 8 12 10 15 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec2 c 3 4 +uniform ivec2 r 5 6 +uniform mat2x2 expected 15 20 18 24 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec2 c 4 5 +uniform ivec2 r 6 7 +uniform mat2x2 expected 24 30 28 35 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec2 c 5 6 +uniform ivec2 r 7 8 +uniform mat2x2 expected 35 42 40 48 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2.shader_test new file mode 100644 index 00000000..00d6b55e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2.shader_test @@ -0,0 +1,57 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +uniform vec2 c; +uniform vec2 r; +uniform mat2 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec2 c 2 3 +uniform vec2 r 4 5 +uniform mat2x2 expected 8 12 10 15 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec2 c 3 4 +uniform vec2 r 5 6 +uniform mat2x2 expected 15 20 18 24 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec2 c 4 5 +uniform vec2 r 6 7 +uniform mat2x2 expected 24 30 28 35 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec2 c 5 6 +uniform vec2 r 7 8 +uniform mat2x2 expected 35 42 40 48 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x2-ivec.shader_test new file mode 100644 index 00000000..5feb409b --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x2-ivec.shader_test @@ -0,0 +1,77 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec2 c; +uniform ivec2 r; +uniform mat2x2 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2x2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec2 c 2 3 +uniform ivec2 r 4 5 +uniform mat2x2 expected 8 12 10 15 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec2 c 3 4 +uniform ivec2 r 5 6 +uniform mat2x2 expected 15 20 18 24 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec2 c 4 5 +uniform ivec2 r 6 7 +uniform mat2x2 expected 24 30 28 35 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec2 c 5 6 +uniform ivec2 r 7 8 +uniform mat2x2 expected 35 42 40 48 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x2.shader_test new file mode 100644 index 00000000..88bb5404 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x2.shader_test @@ -0,0 +1,57 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +uniform vec2 c; +uniform vec2 r; +uniform mat2x2 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2x2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec2 c 2 3 +uniform vec2 r 4 5 +uniform mat2x2 expected 8 12 10 15 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec2 c 3 4 +uniform vec2 r 5 6 +uniform mat2x2 expected 15 20 18 24 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec2 c 4 5 +uniform vec2 r 6 7 +uniform mat2x2 expected 24 30 28 35 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec2 c 5 6 +uniform vec2 r 7 8 +uniform mat2x2 expected 35 42 40 48 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x3-ivec.shader_test new file mode 100644 index 00000000..dc6682c4 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x3-ivec.shader_test @@ -0,0 +1,79 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x3fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec3 c; +uniform ivec2 r; +uniform mat2x3 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2x3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec3 c 2 3 4 +uniform ivec2 r 5 6 +uniform mat2x3 expected 10 15 20 12 18 24 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec3 c 3 4 5 +uniform ivec2 r 6 7 +uniform mat2x3 expected 18 24 30 21 28 35 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec3 c 4 5 6 +uniform ivec2 r 7 8 +uniform mat2x3 expected 28 35 42 32 40 48 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec3 c 5 6 7 +uniform ivec2 r 8 9 +uniform mat2x3 expected 40 48 56 45 54 63 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x3.shader_test new file mode 100644 index 00000000..8cbb5172 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x3.shader_test @@ -0,0 +1,59 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x3fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +uniform vec3 c; +uniform vec2 r; +uniform mat2x3 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2x3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec3 c 2 3 4 +uniform vec2 r 5 6 +uniform mat2x3 expected 10 15 20 12 18 24 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec3 c 3 4 5 +uniform vec2 r 6 7 +uniform mat2x3 expected 18 24 30 21 28 35 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec3 c 4 5 6 +uniform vec2 r 7 8 +uniform mat2x3 expected 28 35 42 32 40 48 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec3 c 5 6 7 +uniform vec2 r 8 9 +uniform mat2x3 expected 40 48 56 45 54 63 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x4-ivec.shader_test new file mode 100644 index 00000000..9ced3cee --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x4-ivec.shader_test @@ -0,0 +1,79 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec4 c; +uniform ivec2 r; +uniform mat2x4 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2x4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec4 c 2 3 4 5 +uniform ivec2 r 6 7 +uniform mat2x4 expected 12 18 24 30 14 21 28 35 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec4 c 3 4 5 6 +uniform ivec2 r 7 8 +uniform mat2x4 expected 21 28 35 42 24 32 40 48 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec4 c 4 5 6 7 +uniform ivec2 r 8 9 +uniform mat2x4 expected 32 40 48 56 36 45 54 63 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec4 c 5 6 7 8 +uniform ivec2 r 9 10 +uniform mat2x4 expected 45 54 63 72 50 60 70 80 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x4.shader_test new file mode 100644 index 00000000..a7645321 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat2x4.shader_test @@ -0,0 +1,59 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix2x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +uniform vec4 c; +uniform vec2 r; +uniform mat2x4 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat2x4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec4 c 2 3 4 5 +uniform vec2 r 6 7 +uniform mat2x4 expected 12 18 24 30 14 21 28 35 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec4 c 3 4 5 6 +uniform vec2 r 7 8 +uniform mat2x4 expected 21 28 35 42 24 32 40 48 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec4 c 4 5 6 7 +uniform vec2 r 8 9 +uniform mat2x4 expected 32 40 48 56 36 45 54 63 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec4 c 5 6 7 8 +uniform vec2 r 9 10 +uniform mat2x4 expected 45 54 63 72 50 60 70 80 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3-ivec.shader_test new file mode 100644 index 00000000..b45d27db --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3-ivec.shader_test @@ -0,0 +1,77 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec3 c; +uniform ivec3 r; +uniform mat3 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec3 c 2 3 4 +uniform ivec3 r 5 6 7 +uniform mat3x3 expected 10 15 20 12 18 24 14 21 28 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec3 c 3 4 5 +uniform ivec3 r 6 7 8 +uniform mat3x3 expected 18 24 30 21 28 35 24 32 40 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec3 c 4 5 6 +uniform ivec3 r 7 8 9 +uniform mat3x3 expected 28 35 42 32 40 48 36 45 54 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec3 c 5 6 7 +uniform ivec3 r 8 9 10 +uniform mat3x3 expected 40 48 56 45 54 63 50 60 70 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3.shader_test new file mode 100644 index 00000000..16fc0a87 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3.shader_test @@ -0,0 +1,57 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +uniform vec3 c; +uniform vec3 r; +uniform mat3 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec3 c 2 3 4 +uniform vec3 r 5 6 7 +uniform mat3x3 expected 10 15 20 12 18 24 14 21 28 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec3 c 3 4 5 +uniform vec3 r 6 7 8 +uniform mat3x3 expected 18 24 30 21 28 35 24 32 40 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec3 c 4 5 6 +uniform vec3 r 7 8 9 +uniform mat3x3 expected 28 35 42 32 40 48 36 45 54 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec3 c 5 6 7 +uniform vec3 r 8 9 10 +uniform mat3x3 expected 40 48 56 45 54 63 50 60 70 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x2-ivec.shader_test new file mode 100644 index 00000000..e577dfc1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x2-ivec.shader_test @@ -0,0 +1,79 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec2 c; +uniform ivec3 r; +uniform mat3x2 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3x2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec2 c 2 3 +uniform ivec3 r 4 5 6 +uniform mat3x2 expected 8 12 10 15 12 18 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec2 c 3 4 +uniform ivec3 r 5 6 7 +uniform mat3x2 expected 15 20 18 24 21 28 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec2 c 4 5 +uniform ivec3 r 6 7 8 +uniform mat3x2 expected 24 30 28 35 32 40 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec2 c 5 6 +uniform ivec3 r 7 8 9 +uniform mat3x2 expected 35 42 40 48 45 54 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x2.shader_test new file mode 100644 index 00000000..e7d332da --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x2.shader_test @@ -0,0 +1,59 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +uniform vec2 c; +uniform vec3 r; +uniform mat3x2 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3x2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec2 c 2 3 +uniform vec3 r 4 5 6 +uniform mat3x2 expected 8 12 10 15 12 18 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec2 c 3 4 +uniform vec3 r 5 6 7 +uniform mat3x2 expected 15 20 18 24 21 28 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec2 c 4 5 +uniform vec3 r 6 7 8 +uniform mat3x2 expected 24 30 28 35 32 40 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec2 c 5 6 +uniform vec3 r 7 8 9 +uniform mat3x2 expected 35 42 40 48 45 54 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x3-ivec.shader_test new file mode 100644 index 00000000..2106548c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x3-ivec.shader_test @@ -0,0 +1,77 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec3 c; +uniform ivec3 r; +uniform mat3x3 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3x3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec3 c 2 3 4 +uniform ivec3 r 5 6 7 +uniform mat3x3 expected 10 15 20 12 18 24 14 21 28 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec3 c 3 4 5 +uniform ivec3 r 6 7 8 +uniform mat3x3 expected 18 24 30 21 28 35 24 32 40 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec3 c 4 5 6 +uniform ivec3 r 7 8 9 +uniform mat3x3 expected 28 35 42 32 40 48 36 45 54 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec3 c 5 6 7 +uniform ivec3 r 8 9 10 +uniform mat3x3 expected 40 48 56 45 54 63 50 60 70 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x3.shader_test new file mode 100644 index 00000000..863544d6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x3.shader_test @@ -0,0 +1,57 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +uniform vec3 c; +uniform vec3 r; +uniform mat3x3 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3x3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec3 c 2 3 4 +uniform vec3 r 5 6 7 +uniform mat3x3 expected 10 15 20 12 18 24 14 21 28 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec3 c 3 4 5 +uniform vec3 r 6 7 8 +uniform mat3x3 expected 18 24 30 21 28 35 24 32 40 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec3 c 4 5 6 +uniform vec3 r 7 8 9 +uniform mat3x3 expected 28 35 42 32 40 48 36 45 54 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec3 c 5 6 7 +uniform vec3 r 8 9 10 +uniform mat3x3 expected 40 48 56 45 54 63 50 60 70 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x4-ivec.shader_test new file mode 100644 index 00000000..f06744ed --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x4-ivec.shader_test @@ -0,0 +1,79 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec4 c; +uniform ivec3 r; +uniform mat3x4 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3x4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec4 c 2 3 4 5 +uniform ivec3 r 6 7 8 +uniform mat3x4 expected 12 18 24 30 14 21 28 35 16 24 32 40 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec4 c 3 4 5 6 +uniform ivec3 r 7 8 9 +uniform mat3x4 expected 21 28 35 42 24 32 40 48 27 36 45 54 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec4 c 4 5 6 7 +uniform ivec3 r 8 9 10 +uniform mat3x4 expected 32 40 48 56 36 45 54 63 40 50 60 70 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec4 c 5 6 7 8 +uniform ivec3 r 9 10 11 +uniform mat3x4 expected 45 54 63 72 50 60 70 80 55 66 77 88 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x4.shader_test new file mode 100644 index 00000000..7779535c --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat3x4.shader_test @@ -0,0 +1,59 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix3x4fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +uniform vec4 c; +uniform vec3 r; +uniform mat3x4 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat3x4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec4 c 2 3 4 5 +uniform vec3 r 6 7 8 +uniform mat3x4 expected 12 18 24 30 14 21 28 35 16 24 32 40 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec4 c 3 4 5 6 +uniform vec3 r 7 8 9 +uniform mat3x4 expected 21 28 35 42 24 32 40 48 27 36 45 54 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec4 c 4 5 6 7 +uniform vec3 r 8 9 10 +uniform mat3x4 expected 32 40 48 56 36 45 54 63 40 50 60 70 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec4 c 5 6 7 8 +uniform vec3 r 9 10 11 +uniform mat3x4 expected 45 54 63 72 50 60 70 80 55 66 77 88 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4-ivec.shader_test new file mode 100644 index 00000000..df564a1f --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4-ivec.shader_test @@ -0,0 +1,77 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec4 c; +uniform ivec4 r; +uniform mat4 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec4 c 2 3 4 5 +uniform ivec4 r 6 7 8 9 +uniform mat4x4 expected 12 18 24 30 14 21 28 35 16 24 32 40 18 27 36 45 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec4 c 3 4 5 6 +uniform ivec4 r 7 8 9 10 +uniform mat4x4 expected 21 28 35 42 24 32 40 48 27 36 45 54 30 40 50 60 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec4 c 4 5 6 7 +uniform ivec4 r 8 9 10 11 +uniform mat4x4 expected 32 40 48 56 36 45 54 63 40 50 60 70 44 55 66 77 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec4 c 5 6 7 8 +uniform ivec4 r 9 10 11 12 +uniform mat4x4 expected 45 54 63 72 50 60 70 80 55 66 77 88 60 72 84 96 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4.shader_test new file mode 100644 index 00000000..f27e5754 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4.shader_test @@ -0,0 +1,57 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +uniform vec4 c; +uniform vec4 r; +uniform mat4 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec4 c 2 3 4 5 +uniform vec4 r 6 7 8 9 +uniform mat4x4 expected 12 18 24 30 14 21 28 35 16 24 32 40 18 27 36 45 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec4 c 3 4 5 6 +uniform vec4 r 7 8 9 10 +uniform mat4x4 expected 21 28 35 42 24 32 40 48 27 36 45 54 30 40 50 60 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec4 c 4 5 6 7 +uniform vec4 r 8 9 10 11 +uniform mat4x4 expected 32 40 48 56 36 45 54 63 40 50 60 70 44 55 66 77 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec4 c 5 6 7 8 +uniform vec4 r 9 10 11 12 +uniform mat4x4 expected 45 54 63 72 50 60 70 80 55 66 77 88 60 72 84 96 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x2-ivec.shader_test new file mode 100644 index 00000000..3aa1565a --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x2-ivec.shader_test @@ -0,0 +1,79 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec2 c; +uniform ivec4 r; +uniform mat4x2 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4x2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec2 c 2 3 +uniform ivec4 r 4 5 6 7 +uniform mat4x2 expected 8 12 10 15 12 18 14 21 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec2 c 3 4 +uniform ivec4 r 5 6 7 8 +uniform mat4x2 expected 15 20 18 24 21 28 24 32 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec2 c 4 5 +uniform ivec4 r 6 7 8 9 +uniform mat4x2 expected 24 30 28 35 32 40 36 45 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec2 c 5 6 +uniform ivec4 r 7 8 9 10 +uniform mat4x2 expected 35 42 40 48 45 54 50 60 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x2.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x2.shader_test new file mode 100644 index 00000000..f16ad09e --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x2.shader_test @@ -0,0 +1,59 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x2fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +uniform vec2 c; +uniform vec4 r; +uniform mat4x2 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4x2 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec2 c 2 3 +uniform vec4 r 4 5 6 7 +uniform mat4x2 expected 8 12 10 15 12 18 14 21 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec2 c 3 4 +uniform vec4 r 5 6 7 8 +uniform mat4x2 expected 15 20 18 24 21 28 24 32 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec2 c 4 5 +uniform vec4 r 6 7 8 9 +uniform mat4x2 expected 24 30 28 35 32 40 36 45 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec2 c 5 6 +uniform vec4 r 7 8 9 10 +uniform mat4x2 expected 35 42 40 48 45 54 50 60 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x3-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x3-ivec.shader_test new file mode 100644 index 00000000..30eb3ad7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x3-ivec.shader_test @@ -0,0 +1,79 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x3fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec3 c; +uniform ivec4 r; +uniform mat4x3 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4x3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec3 c 2 3 4 +uniform ivec4 r 5 6 7 8 +uniform mat4x3 expected 10 15 20 12 18 24 14 21 28 16 24 32 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec3 c 3 4 5 +uniform ivec4 r 6 7 8 9 +uniform mat4x3 expected 18 24 30 21 28 35 24 32 40 27 36 45 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec3 c 4 5 6 +uniform ivec4 r 7 8 9 10 +uniform mat4x3 expected 28 35 42 32 40 48 36 45 54 40 50 60 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec3 c 5 6 7 +uniform ivec4 r 8 9 10 11 +uniform mat4x3 expected 40 48 56 45 54 63 50 60 70 55 66 77 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x3.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x3.shader_test new file mode 100644 index 00000000..57c3af98 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x3.shader_test @@ -0,0 +1,59 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es +# glUniformMatrix4x3fv only exists in OpenGL 2.1 or later. + + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +uniform vec3 c; +uniform vec4 r; +uniform mat4x3 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4x3 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec3 c 2 3 4 +uniform vec4 r 5 6 7 8 +uniform mat4x3 expected 10 15 20 12 18 24 14 21 28 16 24 32 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec3 c 3 4 5 +uniform vec4 r 6 7 8 9 +uniform mat4x3 expected 18 24 30 21 28 35 24 32 40 27 36 45 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec3 c 4 5 6 +uniform vec4 r 7 8 9 10 +uniform mat4x3 expected 28 35 42 32 40 48 36 45 54 40 50 60 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec3 c 5 6 7 +uniform vec4 r 8 9 10 11 +uniform mat4x3 expected 40 48 56 45 54 63 50 60 70 55 66 77 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x4-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x4-ivec.shader_test new file mode 100644 index 00000000..e0e450d8 --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x4-ivec.shader_test @@ -0,0 +1,77 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); +/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec: + * + * "If an exact match is found, the other signatures are ignored, and the + * exact match is used. Otherwise, if no exact match is found, then the + * implicit conversions in Section 4.1.10 "Implicit Conversions" will be + * applied to the calling arguments if this can make their types match a + * signature." + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4" + */ + +uniform ivec4 c; +uniform ivec4 r; +uniform mat4x4 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4x4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform ivec4 c 2 3 4 5 +uniform ivec4 r 6 7 8 9 +uniform mat4x4 expected 12 18 24 30 14 21 28 35 16 24 32 40 18 27 36 45 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform ivec4 c 3 4 5 6 +uniform ivec4 r 7 8 9 10 +uniform mat4x4 expected 21 28 35 42 24 32 40 48 27 36 45 54 30 40 50 60 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform ivec4 c 4 5 6 7 +uniform ivec4 r 8 9 10 11 +uniform mat4x4 expected 32 40 48 56 36 45 54 63 40 50 60 70 44 55 66 77 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform ivec4 c 5 6 7 8 +uniform ivec4 r 9 10 11 12 +uniform mat4x4 expected 45 54 63 72 50 60 70 80 55 66 77 88 60 72 84 96 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 diff --git a/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x4.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x4.shader_test new file mode 100644 index 00000000..fe146fac --- /dev/null +++ b/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-mat4x4.shader_test @@ -0,0 +1,57 @@ +[require] +GLSL >= 1.00 es +GL >= 2.0 es + +[vertex shader] +attribute vec4 vertex; +mat4 proj = mat4( + 2.0/250.0, 0.0, 0.0, -1.0, + 0.0, 2.0/250.0, 0.0, -1.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + +uniform vec4 c; +uniform vec4 r; +uniform mat4x4 expected; +varying vec4 color; + +void main() { + gl_Position = vertex; + gl_Position *= proj; + mat4x4 result = outerProduct(c, r); + color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[fragment shader] + +varying vec4 color; +void main() { gl_FragColor = color; } + +[test] +clear color 0.5 0.5 0.5 0.0 +clear + + +uniform vec4 c 2 3 4 5 +uniform vec4 r 6 7 8 9 +uniform mat4x4 expected 12 18 24 30 14 21 28 35 16 24 32 40 18 27 36 45 +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 + +uniform vec4 c 3 4 5 6 +uniform vec4 r 7 8 9 10 +uniform mat4x4 expected 21 28 35 42 24 32 40 48 27 36 45 54 30 40 50 60 +draw rect 30 10 10 10 +probe rgb 35 15 0.0 1.0 0.0 + +uniform vec4 c 4 5 6 7 +uniform vec4 r 8 9 10 11 +uniform mat4x4 expected 32 40 48 56 36 45 54 63 40 50 60 70 44 55 66 77 +draw rect 50 10 10 10 +probe rgb 55 15 0.0 1.0 0.0 + +uniform vec4 c 5 6 7 8 +uniform vec4 r 9 10 11 12 +uniform mat4x4 expected 45 54 63 72 50 60 70 80 55 66 77 88 60 72 84 96 +draw rect 70 10 10 10 +probe rgb 75 15 0.0 1.0 0.0 |