diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2011-07-15 11:54:58 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2011-08-19 09:25:03 -0700 |
commit | f7747a2caf2834b7ca1cd450e613b52239fde494 (patch) | |
tree | 948e0760f31bad731828e1993389d4c2f27c9c4e | |
parent | 01dff3f8338e17665b036d849e0fdf2c96348325 (diff) |
glsl-1.10 / glsl-1.20: Add non-constant index read tests
All of these tests follow a similar form. A simple shader that reads
a particular array element, matrix column, and vector element (matrix
row) and compares it to some expected value. The tests vary on:
- Storage qualifier of the array/matrix (uniform, temporary, varying).
- Array / not an array.
- Matrix size (mat2, mat3, mat4).
- Whether or not the array index is a non-constant.
- Whether or not the matrix column is a non-constant.
- Whether or not the matrix row is a non-constant.
Since the base type is always a matrix, attributes and fragment shader
outputs are not tested.
433 files changed, 34772 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-rd.shader_test new file mode 100644 index 000000000..0c37a8b4c --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-rd.shader_test @@ -0,0 +1,49 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + mat2 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..4da2b97f4 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-row-rd.shader_test @@ -0,0 +1,63 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat2 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-rd.shader_test new file mode 100644 index 000000000..8d2944f43 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-rd.shader_test @@ -0,0 +1,74 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + mat2 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 000000000..6333f9451 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-row-rd.shader_test @@ -0,0 +1,112 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +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] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat2 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat2-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-rd.shader_test new file mode 100644 index 000000000..b5dfc656e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-rd.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + mat2 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-row-rd.shader_test new file mode 100644 index 000000000..111c7ee47 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-row-rd.shader_test @@ -0,0 +1,74 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat2 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat2-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-rd.shader_test new file mode 100644 index 000000000..cca3c57d4 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-rd.shader_test @@ -0,0 +1,41 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform vec2 expect; +varying vec4 color; + +void main() +{ + mat2 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat2-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-row-rd.shader_test new file mode 100644 index 000000000..6eb35fffd --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-row-rd.shader_test @@ -0,0 +1,49 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat2 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat3-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-rd.shader_test new file mode 100644 index 000000000..578dd3012 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-rd.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + mat3 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..b4f06ea97 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-row-rd.shader_test @@ -0,0 +1,89 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat3 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-rd.shader_test new file mode 100644 index 000000000..6957f28b2 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-rd.shader_test @@ -0,0 +1,89 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + mat3 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 000000000..ae93756fd --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-row-rd.shader_test @@ -0,0 +1,190 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +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] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat3 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat3-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-rd.shader_test new file mode 100644 index 000000000..6c6b3f60b --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-rd.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + mat3 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-row-rd.shader_test new file mode 100644 index 000000000..a72ab4671 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-row-rd.shader_test @@ -0,0 +1,89 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat3 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat3-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-rd.shader_test new file mode 100644 index 000000000..185699ac7 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-rd.shader_test @@ -0,0 +1,41 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform vec3 expect; +varying vec4 color; + +void main() +{ + mat3 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat3-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-row-rd.shader_test new file mode 100644 index 000000000..03d645cbf --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-row-rd.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat3 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat4-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-rd.shader_test new file mode 100644 index 000000000..904203ef2 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-rd.shader_test @@ -0,0 +1,59 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + mat4 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..615e5e787 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-row-rd.shader_test @@ -0,0 +1,125 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat4 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-rd.shader_test new file mode 100644 index 000000000..5b8c720a7 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-rd.shader_test @@ -0,0 +1,104 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + mat4 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 000000000..a365f36a1 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-row-rd.shader_test @@ -0,0 +1,298 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +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] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat4 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat4-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-rd.shader_test new file mode 100644 index 000000000..6a3ccd7e2 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-rd.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + mat4 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-row-rd.shader_test new file mode 100644 index 000000000..9cb578d27 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-row-rd.shader_test @@ -0,0 +1,104 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat4 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat4-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-rd.shader_test new file mode 100644 index 000000000..6ef3fc481 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-rd.shader_test @@ -0,0 +1,41 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform vec4 expect; +varying vec4 color; + +void main() +{ + mat4 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-array-mat4-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-row-rd.shader_test new file mode 100644 index 000000000..ebe91a3c5 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-row-rd.shader_test @@ -0,0 +1,59 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat4 m[3]; + 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); + + 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-1.10/execution/variable-indexing/fs-temp-mat2-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-rd.shader_test new file mode 100644 index 000000000..2a041862a --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-rd.shader_test @@ -0,0 +1,46 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + mat2 m = mat2(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-1.10/execution/variable-indexing/fs-temp-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..12aa2da89 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-row-rd.shader_test @@ -0,0 +1,60 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat2 m = mat2(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-1.10/execution/variable-indexing/fs-temp-mat2-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-rd.shader_test new file mode 100644 index 000000000..03105b7dd --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-rd.shader_test @@ -0,0 +1,38 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform vec2 expect; +varying vec4 color; + +void main() +{ + mat2 m = mat2(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-1.10/execution/variable-indexing/fs-temp-mat2-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-row-rd.shader_test new file mode 100644 index 000000000..9fa742304 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-row-rd.shader_test @@ -0,0 +1,46 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat2 m = mat2(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-1.10/execution/variable-indexing/fs-temp-mat3-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-rd.shader_test new file mode 100644 index 000000000..9b18316b3 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-rd.shader_test @@ -0,0 +1,51 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + mat3 m = mat3(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-1.10/execution/variable-indexing/fs-temp-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..eae9768e1 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-row-rd.shader_test @@ -0,0 +1,86 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat3 m = mat3(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-1.10/execution/variable-indexing/fs-temp-mat3-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-rd.shader_test new file mode 100644 index 000000000..71bbb321b --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-rd.shader_test @@ -0,0 +1,38 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform vec3 expect; +varying vec4 color; + +void main() +{ + mat3 m = mat3(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-1.10/execution/variable-indexing/fs-temp-mat3-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-row-rd.shader_test new file mode 100644 index 000000000..35d81566f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-row-rd.shader_test @@ -0,0 +1,51 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat3 m = mat3(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-1.10/execution/variable-indexing/fs-temp-mat4-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-rd.shader_test new file mode 100644 index 000000000..3bc8e2b9f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-rd.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + mat4 m = 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); + + 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-1.10/execution/variable-indexing/fs-temp-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..0f51c0884 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-row-rd.shader_test @@ -0,0 +1,122 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat4 m = 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); + + 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-1.10/execution/variable-indexing/fs-temp-mat4-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-rd.shader_test new file mode 100644 index 000000000..90c7a0ee8 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-rd.shader_test @@ -0,0 +1,38 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform vec4 expect; +varying vec4 color; + +void main() +{ + mat4 m = 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); + + 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-1.10/execution/variable-indexing/fs-temp-mat4-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-row-rd.shader_test new file mode 100644 index 000000000..49a558089 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-row-rd.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + mat4 m = 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); + + 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-1.10/execution/variable-indexing/fs-uniform-array-mat2-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-col-rd.shader_test new file mode 100644 index 000000000..97eb1eaf8 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec2 expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform vec2 expect; +uniform mat2 m[3]; +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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-1.10/execution/variable-indexing/fs-uniform-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..325b9b0b0 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat2 m[3]; +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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-1.10/execution/variable-indexing/fs-uniform-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-index-col-rd.shader_test new file mode 100644 index 000000000..f4322e009 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-index-col-rd.shader_test @@ -0,0 +1,80 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec2 expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform int col; +uniform vec2 expect; +uniform mat2 m[3]; +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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-1.10/execution/variable-indexing/fs-uniform-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 000000000..ff8cd022d --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-index-col-row-rd.shader_test @@ -0,0 +1,118 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat2 m[3]; +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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-1.10/execution/variable-indexing/fs-uniform-array-mat2-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-index-rd.shader_test new file mode 100644 index 000000000..ffeebba19 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-index-rd.shader_test @@ -0,0 +1,60 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec2 expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform vec2 expect; +uniform mat2 m[3]; +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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-1.10/execution/variable-indexing/fs-uniform-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-index-row-rd.shader_test new file mode 100644 index 000000000..fdd187826 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-index-row-rd.shader_test @@ -0,0 +1,80 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +uniform mat2 m[3]; +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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-1.10/execution/variable-indexing/fs-uniform-array-mat2-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-rd.shader_test new file mode 100644 index 000000000..504d66d9f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-rd.shader_test @@ -0,0 +1,41 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec2 expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform vec2 expect; +uniform mat2 m[3]; +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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-1.10/execution/variable-indexing/fs-uniform-array-mat2-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-row-rd.shader_test new file mode 100644 index 000000000..c96e55c8e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat2 m[3]; +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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-1.10/execution/variable-indexing/fs-uniform-array-mat3-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-col-rd.shader_test new file mode 100644 index 000000000..02810f617 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec3 expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform vec3 expect; +uniform mat3 m[3]; +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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-1.10/execution/variable-indexing/fs-uniform-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..da038be72 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat3 m[3]; +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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-1.10/execution/variable-indexing/fs-uniform-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-index-col-rd.shader_test new file mode 100644 index 000000000..8acf998a5 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-index-col-rd.shader_test @@ -0,0 +1,95 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec3 expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform int col; +uniform vec3 expect; +uniform mat3 m[3]; +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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-1.10/execution/variable-indexing/fs-uniform-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 000000000..ec1bb859e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-index-col-row-rd.shader_test @@ -0,0 +1,196 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat3 m[3]; +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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-1.10/execution/variable-indexing/fs-uniform-array-mat3-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-index-rd.shader_test new file mode 100644 index 000000000..6dffbb086 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-index-rd.shader_test @@ -0,0 +1,60 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec3 expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform vec3 expect; +uniform mat3 m[3]; +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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-1.10/execution/variable-indexing/fs-uniform-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-index-row-rd.shader_test new file mode 100644 index 000000000..3ef0ae662 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-index-row-rd.shader_test @@ -0,0 +1,95 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +uniform mat3 m[3]; +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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-1.10/execution/variable-indexing/fs-uniform-array-mat3-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-rd.shader_test new file mode 100644 index 000000000..0d631c9ae --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-rd.shader_test @@ -0,0 +1,41 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec3 expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform vec3 expect; +uniform mat3 m[3]; +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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-1.10/execution/variable-indexing/fs-uniform-array-mat3-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-row-rd.shader_test new file mode 100644 index 000000000..0086592d5 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat3 m[3]; +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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-1.10/execution/variable-indexing/fs-uniform-array-mat4-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-col-rd.shader_test new file mode 100644 index 000000000..570c99029 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec4 expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform vec4 expect; +uniform mat4 m[3]; +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/fs-uniform-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..cdc1d9de0 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat4 m[3]; +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/fs-uniform-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-index-col-rd.shader_test new file mode 100644 index 000000000..eb77c88f6 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-index-col-rd.shader_test @@ -0,0 +1,110 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec4 expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform int col; +uniform vec4 expect; +uniform mat4 m[3]; +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/fs-uniform-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 000000000..cd61894d4 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-index-col-row-rd.shader_test @@ -0,0 +1,304 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat4 m[3]; +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/fs-uniform-array-mat4-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-index-rd.shader_test new file mode 100644 index 000000000..82c87982b --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-index-rd.shader_test @@ -0,0 +1,60 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec4 expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform vec4 expect; +uniform mat4 m[3]; +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/fs-uniform-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-index-row-rd.shader_test new file mode 100644 index 000000000..21157aa3f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-index-row-rd.shader_test @@ -0,0 +1,110 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +uniform mat4 m[3]; +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/fs-uniform-array-mat4-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-rd.shader_test new file mode 100644 index 000000000..52f4a4f93 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-rd.shader_test @@ -0,0 +1,41 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec4 expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform vec4 expect; +uniform mat4 m[3]; +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/fs-uniform-array-mat4-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-row-rd.shader_test new file mode 100644 index 000000000..6e01a1c2f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat4 m[3]; +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/fs-uniform-mat2-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat2-col-rd.shader_test new file mode 100644 index 000000000..0249873e5 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat2-col-rd.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec2 expect; +uniform mat2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform vec2 expect; +uniform mat2 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 mat2x2 m 1.0 2.0 3.0 4.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 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..388b21e72 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat2-col-row-rd.shader_test @@ -0,0 +1,61 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat2 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 mat2x2 m 1.0 2.0 3.0 4.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 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat2-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat2-rd.shader_test new file mode 100644 index 000000000..0625f8b08 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat2-rd.shader_test @@ -0,0 +1,39 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec2 expect; +uniform mat2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform vec2 expect; +uniform mat2 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 mat2x2 m 1.0 2.0 3.0 4.0 +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-1.10/execution/variable-indexing/fs-uniform-mat2-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat2-row-rd.shader_test new file mode 100644 index 000000000..fb2175af6 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat2-row-rd.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat2 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 mat2x2 m 1.0 2.0 3.0 4.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 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat3-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat3-col-rd.shader_test new file mode 100644 index 000000000..0e4b171aa --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat3-col-rd.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec3 expect; +uniform mat3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform vec3 expect; +uniform mat3 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 mat3x3 m 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.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 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..1242332fc --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat3-col-row-rd.shader_test @@ -0,0 +1,87 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat3 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 mat3x3 m 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.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 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat3-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat3-rd.shader_test new file mode 100644 index 000000000..694acb22b --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat3-rd.shader_test @@ -0,0 +1,39 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec3 expect; +uniform mat3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform vec3 expect; +uniform mat3 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 mat3x3 m 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +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-1.10/execution/variable-indexing/fs-uniform-mat3-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat3-row-rd.shader_test new file mode 100644 index 000000000..6cdacfb6f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat3-row-rd.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat3 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 mat3x3 m 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.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 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat4-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat4-col-rd.shader_test new file mode 100644 index 000000000..7d186f2c4 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat4-col-rd.shader_test @@ -0,0 +1,57 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec4 expect; +uniform mat4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform vec4 expect; +uniform mat4 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 mat4x4 m 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 +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-1.10/execution/variable-indexing/fs-uniform-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..0928e05a6 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat4-col-row-rd.shader_test @@ -0,0 +1,123 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat4 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 mat4x4 m 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 +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-1.10/execution/variable-indexing/fs-uniform-mat4-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat4-rd.shader_test new file mode 100644 index 000000000..ee7d7bf3a --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat4-rd.shader_test @@ -0,0 +1,39 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec4 expect; +uniform mat4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform vec4 expect; +uniform mat4 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 mat4x4 m 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 +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-1.10/execution/variable-indexing/fs-uniform-mat4-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat4-row-rd.shader_test new file mode 100644 index 000000000..151fdaec9 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-mat4-row-rd.shader_test @@ -0,0 +1,57 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat4 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 mat4x4 m 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 +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-1.10/execution/variable-indexing/fs-varying-array-mat2-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-col-rd.shader_test new file mode 100644 index 000000000..f3ec0e38d --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-col-rd.shader_test @@ -0,0 +1,50 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec2 expect; +varying mat2 m[3]; +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] +#version 110 +uniform int col; +uniform vec2 expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..27e81b6a0 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-col-row-rd.shader_test @@ -0,0 +1,64 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat2 m[3]; +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] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-index-col-rd.shader_test new file mode 100644 index 000000000..ba9a41696 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-index-col-rd.shader_test @@ -0,0 +1,75 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec2 expect; +varying mat2 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform vec2 expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 000000000..acb5bf968 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-index-col-row-rd.shader_test @@ -0,0 +1,113 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat2 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat2-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-index-rd.shader_test new file mode 100644 index 000000000..67a20049f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-index-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec2 expect; +varying mat2 m[3]; +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] +#version 110 +uniform int index; +uniform vec2 expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-index-row-rd.shader_test new file mode 100644 index 000000000..8b5babbed --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-index-row-rd.shader_test @@ -0,0 +1,75 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying mat2 m[3]; +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] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat2-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-rd.shader_test new file mode 100644 index 000000000..caaedf683 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-rd.shader_test @@ -0,0 +1,42 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec2 expect; +varying mat2 m[3]; +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] +#version 110 +uniform vec2 expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat2-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-row-rd.shader_test new file mode 100644 index 000000000..61e91b511 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat2-row-rd.shader_test @@ -0,0 +1,50 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying mat2 m[3]; +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] +#version 110 +uniform int row; +uniform float expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat3-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-col-rd.shader_test new file mode 100644 index 000000000..b07a98cf4 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-col-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec3 expect; +varying mat3 m[3]; +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] +#version 110 +uniform int col; +uniform vec3 expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..8b65007f2 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-col-row-rd.shader_test @@ -0,0 +1,90 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat3 m[3]; +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] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-index-col-rd.shader_test new file mode 100644 index 000000000..77c0095c3 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-index-col-rd.shader_test @@ -0,0 +1,90 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec3 expect; +varying mat3 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform vec3 expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 000000000..161f596af --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-index-col-row-rd.shader_test @@ -0,0 +1,191 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat3 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat3-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-index-rd.shader_test new file mode 100644 index 000000000..009cefa66 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-index-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec3 expect; +varying mat3 m[3]; +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] +#version 110 +uniform int index; +uniform vec3 expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-index-row-rd.shader_test new file mode 100644 index 000000000..a99c306b6 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-index-row-rd.shader_test @@ -0,0 +1,90 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying mat3 m[3]; +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] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat3-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-rd.shader_test new file mode 100644 index 000000000..59993545b --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-rd.shader_test @@ -0,0 +1,42 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec3 expect; +varying mat3 m[3]; +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] +#version 110 +uniform vec3 expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat3-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-row-rd.shader_test new file mode 100644 index 000000000..1b2e73366 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat3-row-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying mat3 m[3]; +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] +#version 110 +uniform int row; +uniform float expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat4-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-col-rd.shader_test new file mode 100644 index 000000000..68108a703 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-col-rd.shader_test @@ -0,0 +1,60 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec4 expect; +varying mat4 m[3]; +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] +#version 110 +uniform int col; +uniform vec4 expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..8fdea06c8 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-col-row-rd.shader_test @@ -0,0 +1,126 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat4 m[3]; +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] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-index-col-rd.shader_test new file mode 100644 index 000000000..43538dff2 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-index-col-rd.shader_test @@ -0,0 +1,105 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec4 expect; +varying mat4 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform vec4 expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 000000000..ce6c02fd3 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-index-col-row-rd.shader_test @@ -0,0 +1,299 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat4 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat4-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-index-rd.shader_test new file mode 100644 index 000000000..c34fcb8aa --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-index-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec4 expect; +varying mat4 m[3]; +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] +#version 110 +uniform int index; +uniform vec4 expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-index-row-rd.shader_test new file mode 100644 index 000000000..e33607fb9 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-index-row-rd.shader_test @@ -0,0 +1,105 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying mat4 m[3]; +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] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat4-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-rd.shader_test new file mode 100644 index 000000000..bb756ec8b --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-rd.shader_test @@ -0,0 +1,42 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec4 expect; +varying mat4 m[3]; +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] +#version 110 +uniform vec4 expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/fs-varying-array-mat4-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-row-rd.shader_test new file mode 100644 index 000000000..7ddef700c --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-array-mat4-row-rd.shader_test @@ -0,0 +1,60 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying mat4 m[3]; +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] +#version 110 +uniform int row; +uniform float expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/fs-varying-mat2-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat2-col-rd.shader_test new file mode 100644 index 000000000..82bc5153c --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat2-col-rd.shader_test @@ -0,0 +1,48 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec2 expect; +varying mat2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2(1.0, 2.0, 3.0, 4.0); +} + +[fragment shader] +#version 110 +uniform int col; +uniform vec2 expect; +varying mat2 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-1.10/execution/variable-indexing/fs-varying-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..fd21cdaad --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat2-col-row-rd.shader_test @@ -0,0 +1,62 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2(1.0, 2.0, 3.0, 4.0); +} + +[fragment shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat2 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-1.10/execution/variable-indexing/fs-varying-mat2-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat2-rd.shader_test new file mode 100644 index 000000000..8ae5105cc --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat2-rd.shader_test @@ -0,0 +1,40 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec2 expect; +varying mat2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2(1.0, 2.0, 3.0, 4.0); +} + +[fragment shader] +#version 110 +uniform vec2 expect; +varying mat2 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-1.10/execution/variable-indexing/fs-varying-mat2-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat2-row-rd.shader_test new file mode 100644 index 000000000..9a40c7c5c --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat2-row-rd.shader_test @@ -0,0 +1,48 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying mat2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2(1.0, 2.0, 3.0, 4.0); +} + +[fragment shader] +#version 110 +uniform int row; +uniform float expect; +varying mat2 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-1.10/execution/variable-indexing/fs-varying-mat3-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat3-col-rd.shader_test new file mode 100644 index 000000000..aa653faa0 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat3-col-rd.shader_test @@ -0,0 +1,53 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec3 expect; +varying mat3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +} + +[fragment shader] +#version 110 +uniform int col; +uniform vec3 expect; +varying mat3 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-1.10/execution/variable-indexing/fs-varying-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..039d5695c --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat3-col-row-rd.shader_test @@ -0,0 +1,88 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +} + +[fragment shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat3 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-1.10/execution/variable-indexing/fs-varying-mat3-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat3-rd.shader_test new file mode 100644 index 000000000..2197c42f6 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat3-rd.shader_test @@ -0,0 +1,40 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec3 expect; +varying mat3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +} + +[fragment shader] +#version 110 +uniform vec3 expect; +varying mat3 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-1.10/execution/variable-indexing/fs-varying-mat3-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat3-row-rd.shader_test new file mode 100644 index 000000000..3a2e26111 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat3-row-rd.shader_test @@ -0,0 +1,53 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying mat3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); +} + +[fragment shader] +#version 110 +uniform int row; +uniform float expect; +varying mat3 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-1.10/execution/variable-indexing/fs-varying-mat4-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat4-col-rd.shader_test new file mode 100644 index 000000000..0e30c9e52 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat4-col-rd.shader_test @@ -0,0 +1,58 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec4 expect; +varying mat4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = 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); +} + +[fragment shader] +#version 110 +uniform int col; +uniform vec4 expect; +varying mat4 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-1.10/execution/variable-indexing/fs-varying-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..8b06e27cf --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat4-col-row-rd.shader_test @@ -0,0 +1,124 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = 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); +} + +[fragment shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat4 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-1.10/execution/variable-indexing/fs-varying-mat4-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat4-rd.shader_test new file mode 100644 index 000000000..51f3ab4ff --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat4-rd.shader_test @@ -0,0 +1,40 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec4 expect; +varying mat4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = 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); +} + +[fragment shader] +#version 110 +uniform vec4 expect; +varying mat4 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-1.10/execution/variable-indexing/fs-varying-mat4-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat4-row-rd.shader_test new file mode 100644 index 000000000..274eea683 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-varying-mat4-row-rd.shader_test @@ -0,0 +1,58 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying mat4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = 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); +} + +[fragment shader] +#version 110 +uniform int row; +uniform float expect; +varying mat4 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-1.10/execution/variable-indexing/vs-temp-array-mat2-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-rd.shader_test new file mode 100644 index 000000000..f77352253 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-rd.shader_test @@ -0,0 +1,50 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..d4559105a --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-row-rd.shader_test @@ -0,0 +1,64 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-rd.shader_test new file mode 100644 index 000000000..fa1a0318e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-rd.shader_test @@ -0,0 +1,75 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 000000000..69e2b047d --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-row-rd.shader_test @@ -0,0 +1,113 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat2-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-rd.shader_test new file mode 100644 index 000000000..a36653204 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-row-rd.shader_test new file mode 100644 index 000000000..0f75546e8 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-row-rd.shader_test @@ -0,0 +1,75 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat2-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-rd.shader_test new file mode 100644 index 000000000..0367f2f80 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-rd.shader_test @@ -0,0 +1,42 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat2-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-row-rd.shader_test new file mode 100644 index 000000000..a252af4e8 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-row-rd.shader_test @@ -0,0 +1,50 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat3-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-rd.shader_test new file mode 100644 index 000000000..3859e4287 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..f23bec3d8 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-row-rd.shader_test @@ -0,0 +1,90 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-rd.shader_test new file mode 100644 index 000000000..cf3a14822 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-rd.shader_test @@ -0,0 +1,90 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 000000000..bb0950d0b --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-row-rd.shader_test @@ -0,0 +1,191 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat3-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-rd.shader_test new file mode 100644 index 000000000..899fb0f34 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-row-rd.shader_test new file mode 100644 index 000000000..d441b3a10 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-row-rd.shader_test @@ -0,0 +1,90 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat3-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-rd.shader_test new file mode 100644 index 000000000..f314c93e1 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-rd.shader_test @@ -0,0 +1,42 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat3-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-row-rd.shader_test new file mode 100644 index 000000000..2b68ad148 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-row-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat4-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-rd.shader_test new file mode 100644 index 000000000..680b7cbfa --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-rd.shader_test @@ -0,0 +1,60 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..af57f358e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-row-rd.shader_test @@ -0,0 +1,126 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-rd.shader_test new file mode 100644 index 000000000..e74afe9cc --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-rd.shader_test @@ -0,0 +1,105 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 000000000..a3a6400c6 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-row-rd.shader_test @@ -0,0 +1,299 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat4-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-rd.shader_test new file mode 100644 index 000000000..fab9d0f5e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-rd.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-row-rd.shader_test new file mode 100644 index 000000000..fd7441c35 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-row-rd.shader_test @@ -0,0 +1,105 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat4-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-rd.shader_test new file mode 100644 index 000000000..0459de9a6 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-rd.shader_test @@ -0,0 +1,42 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-array-mat4-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-row-rd.shader_test new file mode 100644 index 000000000..a6fe5dae0 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-row-rd.shader_test @@ -0,0 +1,60 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 m[3]; + 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-mat2-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-rd.shader_test new file mode 100644 index 000000000..796e546b9 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-rd.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 m = mat2(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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..8ffd5633e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-row-rd.shader_test @@ -0,0 +1,61 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 m = mat2(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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-mat2-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-rd.shader_test new file mode 100644 index 000000000..16d0ec84b --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-rd.shader_test @@ -0,0 +1,39 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 m = mat2(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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-mat2-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-row-rd.shader_test new file mode 100644 index 000000000..9256112d9 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-row-rd.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 m = mat2(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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-mat3-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-rd.shader_test new file mode 100644 index 000000000..ae40544a4 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-rd.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 m = mat3(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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..0d61714c7 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-row-rd.shader_test @@ -0,0 +1,87 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 m = mat3(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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-mat3-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-rd.shader_test new file mode 100644 index 000000000..d5c044d28 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-rd.shader_test @@ -0,0 +1,39 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 m = mat3(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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-mat3-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-row-rd.shader_test new file mode 100644 index 000000000..028cdde13 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-row-rd.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 m = mat3(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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-mat4-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-rd.shader_test new file mode 100644 index 000000000..9b46ded4d --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-rd.shader_test @@ -0,0 +1,57 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 m = 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); + color = (m[col] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..61b0cc779 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-row-rd.shader_test @@ -0,0 +1,123 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 m = 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-mat4-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-rd.shader_test new file mode 100644 index 000000000..749d64a3b --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-rd.shader_test @@ -0,0 +1,39 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 m = 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); + color = (m[1] == expect) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +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-1.10/execution/variable-indexing/vs-temp-mat4-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-row-rd.shader_test new file mode 100644 index 000000000..46d4f538f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-row-rd.shader_test @@ -0,0 +1,57 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 m = 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); + 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] +#version 110 +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-1.10/execution/variable-indexing/vs-uniform-array-mat2-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-col-rd.shader_test new file mode 100644 index 000000000..8830f8f80 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec2 expect; +uniform mat2 m[3]; +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] +#version 110 +uniform int col; +uniform vec2 expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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-1.10/execution/variable-indexing/vs-uniform-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..dd2ede8fc --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat2 m[3]; +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] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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-1.10/execution/variable-indexing/vs-uniform-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-index-col-rd.shader_test new file mode 100644 index 000000000..8c9b1ceba --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-index-col-rd.shader_test @@ -0,0 +1,81 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec2 expect; +uniform mat2 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform vec2 expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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-1.10/execution/variable-indexing/vs-uniform-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 000000000..9187c38cc --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-index-col-row-rd.shader_test @@ -0,0 +1,119 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat2 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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-1.10/execution/variable-indexing/vs-uniform-array-mat2-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-index-rd.shader_test new file mode 100644 index 000000000..3d4f9553c --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-index-rd.shader_test @@ -0,0 +1,61 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec2 expect; +uniform mat2 m[3]; +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] +#version 110 +uniform int index; +uniform vec2 expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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-1.10/execution/variable-indexing/vs-uniform-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-index-row-rd.shader_test new file mode 100644 index 000000000..bc5becb72 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-index-row-rd.shader_test @@ -0,0 +1,81 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +uniform mat2 m[3]; +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] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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 mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.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-1.10/execution/variable-indexing/vs-uniform-array-mat2-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-rd.shader_test new file mode 100644 index 000000000..cfef3fd90 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-rd.shader_test @@ -0,0 +1,42 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec2 expect; +uniform mat2 m[3]; +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] +#version 110 +uniform vec2 expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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-1.10/execution/variable-indexing/vs-uniform-array-mat2-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-row-rd.shader_test new file mode 100644 index 000000000..6f7c53315 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat2 m[3]; +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] +#version 110 +uniform int row; +uniform float expect; +uniform mat2 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat2x2 m[0] 1.0 2.0 3.0 4.0 +uniform mat2x2 m[1] 5.0 6.0 7.0 8.0 +uniform mat2x2 m[2] 9.0 10.0 11.0 12.0 +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-1.10/execution/variable-indexing/vs-uniform-array-mat3-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-col-rd.shader_test new file mode 100644 index 000000000..a32d6e56c --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec3 expect; +uniform mat3 m[3]; +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] +#version 110 +uniform int col; +uniform vec3 expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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-1.10/execution/variable-indexing/vs-uniform-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..ca98fddfd --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat3 m[3]; +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] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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-1.10/execution/variable-indexing/vs-uniform-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-index-col-rd.shader_test new file mode 100644 index 000000000..b538777f1 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-index-col-rd.shader_test @@ -0,0 +1,96 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec3 expect; +uniform mat3 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform vec3 expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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-1.10/execution/variable-indexing/vs-uniform-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 000000000..b43405fe0 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-index-col-row-rd.shader_test @@ -0,0 +1,197 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat3 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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-1.10/execution/variable-indexing/vs-uniform-array-mat3-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-index-rd.shader_test new file mode 100644 index 000000000..89e1c16b3 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-index-rd.shader_test @@ -0,0 +1,61 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec3 expect; +uniform mat3 m[3]; +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] +#version 110 +uniform int index; +uniform vec3 expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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-1.10/execution/variable-indexing/vs-uniform-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-index-row-rd.shader_test new file mode 100644 index 000000000..eba0c3350 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-index-row-rd.shader_test @@ -0,0 +1,96 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +uniform mat3 m[3]; +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] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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 mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.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-1.10/execution/variable-indexing/vs-uniform-array-mat3-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-rd.shader_test new file mode 100644 index 000000000..f47e412d3 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-rd.shader_test @@ -0,0 +1,42 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec3 expect; +uniform mat3 m[3]; +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] +#version 110 +uniform vec3 expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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-1.10/execution/variable-indexing/vs-uniform-array-mat3-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-row-rd.shader_test new file mode 100644 index 000000000..311179504 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat3 m[3]; +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] +#version 110 +uniform int row; +uniform float expect; +uniform mat3 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 +uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 +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-1.10/execution/variable-indexing/vs-uniform-array-mat4-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-col-rd.shader_test new file mode 100644 index 000000000..ecae6a4ed --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec4 expect; +uniform mat4 m[3]; +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] +#version 110 +uniform int col; +uniform vec4 expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/vs-uniform-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..8cb597195 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat4 m[3]; +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] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/vs-uniform-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-index-col-rd.shader_test new file mode 100644 index 000000000..3feb36c9b --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-index-col-rd.shader_test @@ -0,0 +1,111 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec4 expect; +uniform mat4 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform vec4 expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/vs-uniform-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 000000000..fc4819507 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-index-col-row-rd.shader_test @@ -0,0 +1,305 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat4 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/vs-uniform-array-mat4-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-index-rd.shader_test new file mode 100644 index 000000000..ed5d2e29c --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-index-rd.shader_test @@ -0,0 +1,61 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec4 expect; +uniform mat4 m[3]; +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] +#version 110 +uniform int index; +uniform vec4 expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/vs-uniform-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-index-row-rd.shader_test new file mode 100644 index 000000000..63638ffa4 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-index-row-rd.shader_test @@ -0,0 +1,111 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +uniform mat4 m[3]; +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] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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 mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/vs-uniform-array-mat4-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-rd.shader_test new file mode 100644 index 000000000..20664b10f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-rd.shader_test @@ -0,0 +1,42 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec4 expect; +uniform mat4 m[3]; +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] +#version 110 +uniform vec4 expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/vs-uniform-array-mat4-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-row-rd.shader_test new file mode 100644 index 000000000..d08926221 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/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.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat4 m[3]; +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] +#version 110 +uniform int row; +uniform float expect; +uniform mat4 m[3]; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat4x4 m[0] 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 +uniform mat4x4 m[1] 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 +uniform mat4x4 m[2] 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 +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-1.10/execution/variable-indexing/vs-uniform-mat2-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat2-col-rd.shader_test new file mode 100644 index 000000000..36ece655f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat2-col-rd.shader_test @@ -0,0 +1,48 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec2 expect; +uniform mat2 m; +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] +#version 110 +uniform int col; +uniform vec2 expect; +uniform mat2 m; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat2x2 m 1.0 2.0 3.0 4.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 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..792b34335 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat2-col-row-rd.shader_test @@ -0,0 +1,62 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat2 m; +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] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat2 m; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat2x2 m 1.0 2.0 3.0 4.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 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat2-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat2-rd.shader_test new file mode 100644 index 000000000..8ec2f5716 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat2-rd.shader_test @@ -0,0 +1,40 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec2 expect; +uniform mat2 m; +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] +#version 110 +uniform vec2 expect; +uniform mat2 m; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat2x2 m 1.0 2.0 3.0 4.0 +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-1.10/execution/variable-indexing/vs-uniform-mat2-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat2-row-rd.shader_test new file mode 100644 index 000000000..9ecdcbcf3 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat2-row-rd.shader_test @@ -0,0 +1,48 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat2 m; +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] +#version 110 +uniform int row; +uniform float expect; +uniform mat2 m; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat2x2 m 1.0 2.0 3.0 4.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 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat3-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat3-col-rd.shader_test new file mode 100644 index 000000000..60f113602 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat3-col-rd.shader_test @@ -0,0 +1,53 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec3 expect; +uniform mat3 m; +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] +#version 110 +uniform int col; +uniform vec3 expect; +uniform mat3 m; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat3x3 m 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.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 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..38a402949 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat3-col-row-rd.shader_test @@ -0,0 +1,88 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat3 m; +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] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat3 m; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat3x3 m 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.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 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat3-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat3-rd.shader_test new file mode 100644 index 000000000..7c67df2d7 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat3-rd.shader_test @@ -0,0 +1,40 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec3 expect; +uniform mat3 m; +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] +#version 110 +uniform vec3 expect; +uniform mat3 m; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat3x3 m 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 +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-1.10/execution/variable-indexing/vs-uniform-mat3-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat3-row-rd.shader_test new file mode 100644 index 000000000..38acf8d94 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat3-row-rd.shader_test @@ -0,0 +1,53 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat3 m; +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] +#version 110 +uniform int row; +uniform float expect; +uniform mat3 m; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat3x3 m 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.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 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat4-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat4-col-rd.shader_test new file mode 100644 index 000000000..99527462a --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat4-col-rd.shader_test @@ -0,0 +1,58 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec4 expect; +uniform mat4 m; +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] +#version 110 +uniform int col; +uniform vec4 expect; +uniform mat4 m; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat4x4 m 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 +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-1.10/execution/variable-indexing/vs-uniform-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..4c0ca0450 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat4-col-row-rd.shader_test @@ -0,0 +1,124 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat4 m; +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] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +uniform mat4 m; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat4x4 m 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 +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-1.10/execution/variable-indexing/vs-uniform-mat4-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat4-rd.shader_test new file mode 100644 index 000000000..f7ffde2cf --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat4-rd.shader_test @@ -0,0 +1,40 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec4 expect; +uniform mat4 m; +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] +#version 110 +uniform vec4 expect; +uniform mat4 m; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat4x4 m 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 +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-1.10/execution/variable-indexing/vs-uniform-mat4-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat4-row-rd.shader_test new file mode 100644 index 000000000..2e091e4a1 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-mat4-row-rd.shader_test @@ -0,0 +1,58 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +uniform mat4 m; +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] +#version 110 +uniform int row; +uniform float expect; +uniform mat4 m; +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform mat4x4 m 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 +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-1.10/execution/variable-indexing/vs-varying-array-mat2-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-rd.shader_test new file mode 100644 index 000000000..272ecae60 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-rd.shader_test @@ -0,0 +1,66 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec2 expect; +varying mat2 m[3]; +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] +#version 110 +uniform int col; +uniform vec2 expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..e3740d268 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-row-rd.shader_test @@ -0,0 +1,80 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat2 m[3]; +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] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-rd.shader_test new file mode 100644 index 000000000..06be962c8 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-rd.shader_test @@ -0,0 +1,91 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec2 expect; +varying mat2 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform vec2 expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 000000000..36933ac8e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-row-rd.shader_test @@ -0,0 +1,129 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat2 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat2-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-rd.shader_test new file mode 100644 index 000000000..b0c2a2e35 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-rd.shader_test @@ -0,0 +1,71 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec2 expect; +varying mat2 m[3]; +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] +#version 110 +uniform int index; +uniform vec2 expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-row-rd.shader_test new file mode 100644 index 000000000..35f238b0f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-row-rd.shader_test @@ -0,0 +1,91 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying mat2 m[3]; +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] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat2-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-rd.shader_test new file mode 100644 index 000000000..9b89902fb --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-rd.shader_test @@ -0,0 +1,58 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec2 expect; +varying mat2 m[3]; +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] +#version 110 +uniform vec2 expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat2-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-row-rd.shader_test new file mode 100644 index 000000000..6b9eb70d0 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-row-rd.shader_test @@ -0,0 +1,66 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying mat2 m[3]; +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] +#version 110 +uniform int row; +uniform float expect; +varying mat2 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat3-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-rd.shader_test new file mode 100644 index 000000000..98586265e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-rd.shader_test @@ -0,0 +1,71 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec3 expect; +varying mat3 m[3]; +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] +#version 110 +uniform int col; +uniform vec3 expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..1b2ea2789 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-row-rd.shader_test @@ -0,0 +1,106 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat3 m[3]; +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] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-rd.shader_test new file mode 100644 index 000000000..975c255f9 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-rd.shader_test @@ -0,0 +1,106 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec3 expect; +varying mat3 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform vec3 expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 000000000..84eb92b1f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-row-rd.shader_test @@ -0,0 +1,207 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat3 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat3-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-rd.shader_test new file mode 100644 index 000000000..6e19aa36c --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-rd.shader_test @@ -0,0 +1,71 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec3 expect; +varying mat3 m[3]; +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] +#version 110 +uniform int index; +uniform vec3 expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-row-rd.shader_test new file mode 100644 index 000000000..19a62d920 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-row-rd.shader_test @@ -0,0 +1,106 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying mat3 m[3]; +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] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat3-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-rd.shader_test new file mode 100644 index 000000000..0c3673de4 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-rd.shader_test @@ -0,0 +1,58 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec3 expect; +varying mat3 m[3]; +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] +#version 110 +uniform vec3 expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat3-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-row-rd.shader_test new file mode 100644 index 000000000..fc4b3291e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-row-rd.shader_test @@ -0,0 +1,71 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying mat3 m[3]; +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] +#version 110 +uniform int row; +uniform float expect; +varying mat3 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat4-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-rd.shader_test new file mode 100644 index 000000000..306fae1b1 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-rd.shader_test @@ -0,0 +1,76 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec4 expect; +varying mat4 m[3]; +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] +#version 110 +uniform int col; +uniform vec4 expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..ceaee5d37 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-row-rd.shader_test @@ -0,0 +1,142 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat4 m[3]; +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] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-rd.shader_test new file mode 100644 index 000000000..ac71a7574 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-rd.shader_test @@ -0,0 +1,121 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform vec4 expect; +varying mat4 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform vec4 expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 000000000..03eb0596c --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-row-rd.shader_test @@ -0,0 +1,315 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat4 m[3]; +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] +#version 110 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat4-index-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-rd.shader_test new file mode 100644 index 000000000..2bf421b0c --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-rd.shader_test @@ -0,0 +1,71 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform vec4 expect; +varying mat4 m[3]; +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] +#version 110 +uniform int index; +uniform vec4 expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-row-rd.shader_test new file mode 100644 index 000000000..cc4a5fedb --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-row-rd.shader_test @@ -0,0 +1,121 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying mat4 m[3]; +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] +#version 110 +uniform int index; +uniform int row; +uniform float expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat4-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-rd.shader_test new file mode 100644 index 000000000..20df7b1fc --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-rd.shader_test @@ -0,0 +1,58 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec4 expect; +varying mat4 m[3]; +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] +#version 110 +uniform vec4 expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/vs-varying-array-mat4-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-row-rd.shader_test new file mode 100644 index 000000000..ffd1aae4f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-row-rd.shader_test @@ -0,0 +1,76 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying mat4 m[3]; +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] +#version 110 +uniform int row; +uniform float expect; +varying mat4 m[3]; +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-1.10/execution/variable-indexing/vs-varying-mat2-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-rd.shader_test new file mode 100644 index 000000000..b0fd38425 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-rd.shader_test @@ -0,0 +1,64 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec2 expect; +varying mat2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2(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] +#version 110 +uniform int col; +uniform vec2 expect; +varying mat2 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-1.10/execution/variable-indexing/vs-varying-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..ac5f17e2b --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-row-rd.shader_test @@ -0,0 +1,78 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2(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] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat2 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-1.10/execution/variable-indexing/vs-varying-mat2-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-rd.shader_test new file mode 100644 index 000000000..b29888371 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-rd.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec2 expect; +varying mat2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2(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] +#version 110 +uniform vec2 expect; +varying mat2 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-1.10/execution/variable-indexing/vs-varying-mat2-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-row-rd.shader_test new file mode 100644 index 000000000..a6d09b549 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-row-rd.shader_test @@ -0,0 +1,64 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying mat2 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat2(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] +#version 110 +uniform int row; +uniform float expect; +varying mat2 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-1.10/execution/variable-indexing/vs-varying-mat3-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-rd.shader_test new file mode 100644 index 000000000..984708522 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-rd.shader_test @@ -0,0 +1,69 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec3 expect; +varying mat3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3(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] +#version 110 +uniform int col; +uniform vec3 expect; +varying mat3 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-1.10/execution/variable-indexing/vs-varying-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..56576117e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-row-rd.shader_test @@ -0,0 +1,104 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3(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] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat3 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-1.10/execution/variable-indexing/vs-varying-mat3-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-rd.shader_test new file mode 100644 index 000000000..76424068c --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-rd.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec3 expect; +varying mat3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3(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] +#version 110 +uniform vec3 expect; +varying mat3 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-1.10/execution/variable-indexing/vs-varying-mat3-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-row-rd.shader_test new file mode 100644 index 000000000..2d4e70f39 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-row-rd.shader_test @@ -0,0 +1,69 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying mat3 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = mat3(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] +#version 110 +uniform int row; +uniform float expect; +varying mat3 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-1.10/execution/variable-indexing/vs-varying-mat4-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-rd.shader_test new file mode 100644 index 000000000..874f03c27 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-rd.shader_test @@ -0,0 +1,74 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform vec4 expect; +varying mat4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = 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); + + /* 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] +#version 110 +uniform int col; +uniform vec4 expect; +varying mat4 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-1.10/execution/variable-indexing/vs-varying-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..1a50570b5 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-row-rd.shader_test @@ -0,0 +1,140 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = 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); + + /* 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] +#version 110 +uniform int col; +uniform int row; +uniform float expect; +varying mat4 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-1.10/execution/variable-indexing/vs-varying-mat4-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-rd.shader_test new file mode 100644 index 000000000..5b9f48400 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-rd.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform vec4 expect; +varying mat4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = 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); + + /* 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] +#version 110 +uniform vec4 expect; +varying mat4 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-1.10/execution/variable-indexing/vs-varying-mat4-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-row-rd.shader_test new file mode 100644 index 000000000..da906c3d7 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-row-rd.shader_test @@ -0,0 +1,74 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform int row; +uniform float expect; +varying mat4 m; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + m = 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); + + /* 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] +#version 110 +uniform int row; +uniform float expect; +varying mat4 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-1.10/variable-index-read.sh b/tests/spec/glsl-1.10/variable-index-read.sh new file mode 100755 index 000000000..903d4e4c4 --- /dev/null +++ b/tests/spec/glsl-1.10/variable-index-read.sh @@ -0,0 +1,476 @@ +#!/bin/sh + +# Generate a set of data for a sized matrix. Elements start with a specified +# value and increment by 1.0 for each element. +function matrix_data +{ + first=$1 + dim=$2 + + last=$(($first + $dim * $dim - 1)) + seq $first $last | tr '\n' ' ' | sed 's/ /.0, /g;s/, $//;s/ *$//g' +} + + +function emit_matrix_array_initializer +{ + matrix_dim=$1 + array_dim=$2 + base_type=$3 + indent=$4 + + for c in $(seq $array_dim); do + if [ $c -ne 1 ]; then + echo "," + fi + + first=$(((c - 1) * matrix_dim * matrix_dim + 1)) + echo -n "${indent} ${base_type}(" + matrix_data $first $matrix_dim + echo -n ")" + done + +} + + +# Emit global variable declarations for either the vertex shader or the +# fragment shader. +function emit_globals +{ + matrix_dim=$1 + array_dim=$2 + mode=$3 + index_value=$4 + col=$5 + expect_type=$6 + + v=${version/./} + if [ $v -ge 120 ]; then + base_type="mat${matrix_dim}x${matrix_dim}" + else + base_type="mat${matrix_dim}" + fi + + type=$base_type + dim="" + if [ $array_dim -ne 0 ]; then + if [ $v -ge 120 ]; then + type="${type}[$array_dim]" + else + dim="[${array_dim}]" + fi + fi + + if [ $array_dim -ne 0 -a "x$index_value" = "xindex" ]; then + echo "uniform int index;" + fi + + if [ "x$col" = "xcol" ]; then + echo "uniform int col;" + fi + + if [ "x$expect_type" == "xfloat" ]; then + echo "uniform int row;" + fi + + echo "uniform ${expect_type} expect;" + + if [ $v -ge 120 -a "x$mode" = "xuniform" ]; then + if [ $array_dim -eq 0 ]; then + echo -n "${mode} ${type} m = ${type}(" + matrix_data 1 $matrix_dim + echo ");" + else + echo " ${type} m${dim} = ${type}(" + emit_matrix_array_initializer $matrix_dim $array_dim $base_type "" + echo ");" + fi + elif [ "x$mode" != "xtemp" ]; then + echo "${mode} ${type} m${dim};" + fi + echo "varying vec4 color;" + echo +} + + +function emit_set_matrix +{ + matrix_dim=$1 + array_dim=$2 + mode=$3 + + v=${version/./} + if [ $v -ge 120 ]; then + base_type="mat${matrix_dim}x${matrix_dim}" + else + base_type="mat${matrix_dim}" + fi + + type=$base_type + dim="" + if [ $array_dim -ne 0 ]; then + if [ $v -ge 120 ]; then + type="${type}[$array_dim]" + else + dim="[${array_dim}]" + fi + fi + + if [ $array_dim -ne 0 ]; then + if [ "x$mode" = "xtemp" ]; then + if [ $v -ge 120 ]; then + echo " ${type} m${dim} = ${type}(" + emit_matrix_array_initializer $matrix_dim $array_dim $base_type " " + echo ");" + else + echo " ${type} m${dim};" + fi + fi + + if [ $v -lt 120 -o "x$mode" = "xvarying" ]; then + for i in $(seq 0 $(($array_dim - 1))); do + first=$((1 + $i * $matrix_dim * $matrix_dim)) + echo -n " m[$i] = mat${matrix_dim}(" + matrix_data $first $matrix_dim + echo ");" + done + fi + else + matrix_values=$(matrix_data 1 $matrix_dim) + + if [ "x$mode" = "xtemp" ] ; then + echo " ${type} m = ${type}(${matrix_values});" + else + echo " m = ${type}(${matrix_values});" + fi + fi +} + + +function emit_vs +{ + matrix_dim=$1 + array_dim=$2 + mode=$3 + index_value=$4 + col=$5 + expect_type=$6 + do_compare=$7 + + if [ $array_dim -ne 0 ]; then + idx="[${index_value}]" + else + idx="" + fi + + echo "[vertex shader]" + echo "#version ${version/./}" + emit_globals $* + + echo "void main()" + echo "{" + echo " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;" + + # Only emit the code to set the matrix if the vertex shader is generating + # varyings for a fragment shader or the matrix is in local storage and the + # vertex shader is doing the comparison. + if [ "x$mode" = "xvarying" -o \( "x$mode" = "xtemp" -a $do_compare -ne 0 \) ]; then + echo + emit_set_matrix $matrix_dim $array_dim $mode + fi + + if [ $do_compare -ne 0 ]; then + # Many people thing that a vertex shader cannot read a varying. Quote + # some bits from the GLSL spec so that people won't get the wrong idea + # when reading the test. + if [ "x$mode" = "xvarying" ]; then + cat <<EOF + + /* 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." + */ +EOF + fi + + if [ "x$expect_type" = "xfloat" ]; then + echo " color = (m${idx}[$col][row] == expect)" + else + echo " color = (m${idx}[$col] == expect)" + fi + echo " ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);" + fi + echo -e "}\n" +} + + +emit_fs() +{ + matrix_dim=$1 + array_dim=$2 + mode=$3 + index_value=$4 + col=$5 + expect_type=$6 + do_compare=$7 + + echo "[fragment shader]" + echo "#version ${version/./}" + emit_globals $* + + echo "void main()" + echo "{" + + if [ $do_compare -eq 0 -a "x$mode" = "xvarying" ]; then + cat <<EOF + /* 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. + */ +EOF + fi + + if [ $do_compare -ne 0 -o "x$mode" = "xvarying" ]; then + if [ "x$mode" = "xtemp" ]; then + emit_set_matrix $matrix_dim $array_dim $mode + echo + fi + + if [ $array_dim -ne 0 ]; then + idx="[$index_value]" + else + idx="" + fi + + if [ "x$expect_type" = "xfloat" ]; then + row="[row]" + else + row="" + fi + + echo " gl_FragColor = (m${idx}[${col}]${row} == expect)" + + if [ $do_compare -eq 0 ]; then + echo " ? color : vec4(1.0, 0.0, 0.0, 1.0);" + else + echo " ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);" + fi + else + echo " gl_FragColor = color;" + fi + + echo "}" + echo +} + + +function emit_test_vectors +{ + matrix_dim=$1 + array_dim=$2 + mode=$3 + index_value=$4 + col=$5 + expect_type=$6 + + cat <<EOF +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +EOF + + # NOTE: shader_runner uses the matCxR names even for GLSL 1.10 + v=${version/./} + type="mat${matrix_dim}x${matrix_dim}" + if [ "x$mode" = "xuniform" -a $v -le 110 ]; then + if [ $array_dim -eq 0 ]; then + echo -n "uniform ${type} m " + matrix_data 1 $matrix_dim | sed 's/,//g' + echo + fi + fi + + if [ $array_dim -eq 0 ]; then + sizes="1" + elif [ "x$index_value" = "xindex" ]; then + sizes=$(seq $array_dim) + else + sizes="2" + fi + + if [ "x$col" = "xcol" ]; then + columns=$(seq $matrix_dim) + else + columns=2 + fi + + if [ "x$expect_type" = "xfloat" ]; then + rows=$(seq $matrix_dim) + else + rows=1 + fi + + for i in $sizes; do + if [ "x$mode" = "xuniform" -a $v -le 110 ]; then + if [ $array_dim -ne 0 ]; then + for c in $(seq 0 $(($array_dim - 1))); do + first=$((1 + c * matrix_dim * matrix_dim)) + echo -n "uniform ${type} m[$c] " + matrix_data $first $matrix_dim | sed 's/,//g' + echo + done + fi + fi + + if [ $array_dim -ne 0 -a "x$index_value" = "xindex" ]; then + echo "uniform int index $((i - 1))" + fi + + x_base=$(((i - 1) * (15 * matrix_dim + 10))) + for c in $columns; do + if [ "x$col" = "xcol" ]; then + echo "uniform int col $((c - 1))" + fi + + for r in $rows; do + expect=$(((i - 1) * (matrix_dim * matrix_dim) + (c - 1) * matrix_dim + r)) + if [ "x$expect_type" = "xfloat" ]; then + echo "uniform int row $((r - 1))" + echo "uniform float expect $expect" + else + e=$(seq $expect $((expect + matrix_dim - 1)) | tr '\n' ' ' | sed 's/[[:space:]]*$//g') + echo "uniform ${expect_type} expect $e" + fi + + x=$((x_base + 15 * c - 10)) + y=$((15 * r - 10)) + echo "draw rect $x $y 10 10" + + x=$((x + 5)) + y=$((y + 5)) + echo "probe rgb $x $y 0.0 1.0 0.0" + echo + done + done + done +} + +# Generate a test that read from an (array of) matrix using a non-constant +# index in the fragment shader. +function emit_fs_rd_test +{ + echo "# Test generated by:" + echo "# ${cmd}" + echo + echo "[require]" + echo "GLSL >= $version" + echo + + emit_vs $* 0 + emit_fs $* 1 + + emit_test_vectors $* +} + + +# Generate a test that read from an (array of) matrix using a non-constant +# index in the fragment shader. +function emit_vs_rd_test +{ + echo "# Test generated by:" + echo "# ${cmd}" + echo + echo "[require]" + echo "GLSL >= $version" + echo + + emit_vs $* 1 + emit_fs $* 0 + + emit_test_vectors $* +} + +cmd="$0 $*" + +if [ "x$1" = "x" ]; then + version="1.10" +else + case "$1" in + 1.[12]0) version="$1";; + *) + echo "Bogus GLSL version \"$1\" specified." + exit 1 + ;; + esac +fi + +for mode in temp uniform varying; do + # More than 3 is unlikely to work for the varying tests due to using too + # many varying vectors. mat4[3] uses 12 varying vectors by itself. + for array_dim in 0 3; do + for matrix_dim in 2 3 4; do + if [ $array_dim -ne 0 ]; then + arr="array-" + idx_txt="index-" + + emit_fs_rd_test $matrix_dim $array_dim $mode 1 col float \ + > fs-${mode}-${arr}mat${matrix_dim}-col-row-rd.shader_test + + emit_fs_rd_test $matrix_dim $array_dim $mode 1 1 float \ + > fs-${mode}-${arr}mat${matrix_dim}-row-rd.shader_test + + emit_fs_rd_test $matrix_dim $array_dim $mode 1 col vec${matrix_dim} \ + > fs-${mode}-${arr}mat${matrix_dim}-col-rd.shader_test + + emit_fs_rd_test $matrix_dim $array_dim $mode 1 1 vec${matrix_dim} \ + > fs-${mode}-${arr}mat${matrix_dim}-rd.shader_test + + emit_vs_rd_test $matrix_dim $array_dim $mode 1 col float \ + > vs-${mode}-${arr}mat${matrix_dim}-col-row-rd.shader_test + + emit_vs_rd_test $matrix_dim $array_dim $mode 1 1 float \ + > vs-${mode}-${arr}mat${matrix_dim}-row-rd.shader_test + + emit_vs_rd_test $matrix_dim $array_dim $mode 1 col vec${matrix_dim} \ + > vs-${mode}-${arr}mat${matrix_dim}-col-rd.shader_test + + emit_vs_rd_test $matrix_dim $array_dim $mode 1 1 vec${matrix_dim} \ + > vs-${mode}-${arr}mat${matrix_dim}-rd.shader_test + else + arr="" + idx_txt="" + fi + + emit_fs_rd_test $matrix_dim $array_dim $mode index col float \ + > fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-row-rd.shader_test + + emit_fs_rd_test $matrix_dim $array_dim $mode index 1 float \ + > fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}row-rd.shader_test + + emit_fs_rd_test $matrix_dim $array_dim $mode index col vec${matrix_dim} \ + > fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-rd.shader_test + + emit_fs_rd_test $matrix_dim $array_dim $mode index 1 vec${matrix_dim} \ + > fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}rd.shader_test + + emit_vs_rd_test $matrix_dim $array_dim $mode index col float \ + > vs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-row-rd.shader_test + + emit_vs_rd_test $matrix_dim $array_dim $mode index 1 float \ + > vs-${mode}-${arr}mat${matrix_dim}-${idx_txt}row-rd.shader_test + + emit_vs_rd_test $matrix_dim $array_dim $mode index col vec${matrix_dim} \ + > vs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-rd.shader_test + + emit_vs_rd_test $matrix_dim $array_dim $mode index 1 vec${matrix_dim} \ + > vs-${mode}-${arr}mat${matrix_dim}-${idx_txt}rd.shader_test + done + done +done diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-col-rd.shader_test new file mode 100644 index 000000000..9c4a56ee3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..d4bcb1a28 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-col-rd.shader_test new file mode 100644 index 000000000..2b8fe0c96 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int index; +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 000000000..cd66f7d99 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat2-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-rd.shader_test new file mode 100644 index 000000000..41addaa17 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int index; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-row-rd.shader_test new file mode 100644 index 000000000..62c179653 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat2-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-rd.shader_test new file mode 100644 index 000000000..7a59c4954 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat2-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-row-rd.shader_test new file mode 100644 index 000000000..dd79c6e8d --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat3-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-col-rd.shader_test new file mode 100644 index 000000000..22bcf3e01 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..a46f1bc0a --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-col-rd.shader_test new file mode 100644 index 000000000..fa87d92e6 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int index; +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 000000000..dd072f307 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat3-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-rd.shader_test new file mode 100644 index 000000000..f555b0b7e --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int index; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-row-rd.shader_test new file mode 100644 index 000000000..04e631274 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat3-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-rd.shader_test new file mode 100644 index 000000000..b991bbc93 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat3-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-row-rd.shader_test new file mode 100644 index 000000000..ab842f768 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat4-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-col-rd.shader_test new file mode 100644 index 000000000..542edcbd2 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..0785f198d --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-col-rd.shader_test new file mode 100644 index 000000000..193fce4eb --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int index; +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 000000000..4499d5296 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat4-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-rd.shader_test new file mode 100644 index 000000000..1174ac96b --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int index; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-row-rd.shader_test new file mode 100644 index 000000000..081be553e --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int index; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat4-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-rd.shader_test new file mode 100644 index 000000000..d7250961a --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-array-mat4-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-row-rd.shader_test new file mode 100644 index 000000000..f4645d9b5 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-mat2-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-col-rd.shader_test new file mode 100644 index 000000000..69b747dbb --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int col; +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..4fc9ffe05 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-mat2-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-rd.shader_test new file mode 100644 index 000000000..d7c2cb659 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform vec2 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-mat2-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-row-rd.shader_test new file mode 100644 index 000000000..760c2e0a8 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-mat3-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-col-rd.shader_test new file mode 100644 index 000000000..0deb2e914 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int col; +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..579d6b203 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-mat3-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-rd.shader_test new file mode 100644 index 000000000..1f3ab0802 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform vec3 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-mat3-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-row-rd.shader_test new file mode 100644 index 000000000..83bc89b04 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-mat4-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-col-rd.shader_test new file mode 100644 index 000000000..6b0915bc0 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int col; +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..ec057e7f2 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int col; +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-mat4-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-rd.shader_test new file mode 100644 index 000000000..79a341df8 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform vec4 expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-temp-mat4-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-row-rd.shader_test new file mode 100644 index 000000000..1df61e8fc --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-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] +#version 120 +uniform int row; +uniform float expect; +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +[fragment shader] +#version 120 +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-1.20/execution/variable-indexing/fs-uniform-array-mat2-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-col-rd.shader_test new file mode 100644 index 000000000..44d6d8fc3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-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] +#version 120 +uniform int col; +uniform vec2 expect; + 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] +#version 120 +uniform int col; +uniform vec2 expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..c810505a4 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-col-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] +#version 120 +uniform int col; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int col; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-index-col-rd.shader_test new file mode 100644 index 000000000..395e84bbc --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-index-col-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] +#version 120 +uniform int index; +uniform int col; +uniform vec2 expect; + 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] +#version 120 +uniform int index; +uniform int col; +uniform vec2 expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 000000000..f4fd63b5a --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-index-col-row-rd.shader_test @@ -0,0 +1,115 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat2-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-index-rd.shader_test new file mode 100644 index 000000000..8f937e3b5 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-index-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] +#version 120 +uniform int index; +uniform vec2 expect; + 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] +#version 120 +uniform int index; +uniform vec2 expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-index-row-rd.shader_test new file mode 100644 index 000000000..4617c77b3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-index-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] +#version 120 +uniform int index; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int index; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat2-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-rd.shader_test new file mode 100644 index 000000000..daa800302 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-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] +#version 120 +uniform vec2 expect; + 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] +#version 120 +uniform vec2 expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat2-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-row-rd.shader_test new file mode 100644 index 000000000..7d22c3e5d --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat2-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] +#version 120 +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat3-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-col-rd.shader_test new file mode 100644 index 000000000..902e11772 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-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] +#version 120 +uniform int col; +uniform vec3 expect; + 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] +#version 120 +uniform int col; +uniform vec3 expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..3629ca9c1 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-col-row-rd.shader_test @@ -0,0 +1,92 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int col; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int col; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-index-col-rd.shader_test new file mode 100644 index 000000000..af467d1a8 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-index-col-rd.shader_test @@ -0,0 +1,92 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int col; +uniform vec3 expect; + 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] +#version 120 +uniform int index; +uniform int col; +uniform vec3 expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 000000000..88402f44d --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-index-col-row-rd.shader_test @@ -0,0 +1,193 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat3-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-index-rd.shader_test new file mode 100644 index 000000000..c686b4f47 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-index-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] +#version 120 +uniform int index; +uniform vec3 expect; + 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] +#version 120 +uniform int index; +uniform vec3 expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-index-row-rd.shader_test new file mode 100644 index 000000000..da109fb54 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-index-row-rd.shader_test @@ -0,0 +1,92 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int index; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat3-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-rd.shader_test new file mode 100644 index 000000000..93468d000 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-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] +#version 120 +uniform vec3 expect; + 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] +#version 120 +uniform vec3 expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat3-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-row-rd.shader_test new file mode 100644 index 000000000..5f6eef5b2 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat3-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] +#version 120 +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat4-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-col-rd.shader_test new file mode 100644 index 000000000..867b4a37f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-col-rd.shader_test @@ -0,0 +1,62 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int col; +uniform vec4 expect; + 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] +#version 120 +uniform int col; +uniform vec4 expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..d1b6667b3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-col-row-rd.shader_test @@ -0,0 +1,128 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int col; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int col; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-index-col-rd.shader_test new file mode 100644 index 000000000..1112c2a5a --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-index-col-rd.shader_test @@ -0,0 +1,107 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int col; +uniform vec4 expect; + 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] +#version 120 +uniform int index; +uniform int col; +uniform vec4 expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 000000000..cbc1afc54 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-index-col-row-rd.shader_test @@ -0,0 +1,301 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat4-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-index-rd.shader_test new file mode 100644 index 000000000..68f860f73 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-index-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] +#version 120 +uniform int index; +uniform vec4 expect; + 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] +#version 120 +uniform int index; +uniform vec4 expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-index-row-rd.shader_test new file mode 100644 index 000000000..c83031b1b --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-index-row-rd.shader_test @@ -0,0 +1,107 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int index; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat4-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-rd.shader_test new file mode 100644 index 000000000..e0d16a10f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-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] +#version 120 +uniform vec4 expect; + 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] +#version 120 +uniform vec4 expect; + 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-1.20/execution/variable-indexing/fs-uniform-array-mat4-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-row-rd.shader_test new file mode 100644 index 000000000..b9d0204f3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-array-mat4-row-rd.shader_test @@ -0,0 +1,62 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/fs-uniform-mat2-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-mat2-col-rd.shader_test new file mode 100644 index 000000000..ed83ad377 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-uniform-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..93de8f0a7 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-uniform-mat2-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-mat2-rd.shader_test new file mode 100644 index 000000000..dfeda2351 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-uniform-mat2-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-mat2-row-rd.shader_test new file mode 100644 index 000000000..967f81a8b --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-uniform-mat3-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-mat3-col-rd.shader_test new file mode 100644 index 000000000..4f23cf701 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-uniform-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..13ce6a54b --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-uniform-mat3-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-mat3-rd.shader_test new file mode 100644 index 000000000..00844124c --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-uniform-mat3-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-mat3-row-rd.shader_test new file mode 100644 index 000000000..a6c581980 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-uniform-mat4-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-mat4-col-rd.shader_test new file mode 100644 index 000000000..0c12a44c4 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-uniform-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..9cb1545bb --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-uniform-mat4-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-mat4-rd.shader_test new file mode 100644 index 000000000..46e8d7644 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-uniform-mat4-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-mat4-row-rd.shader_test new file mode 100644 index 000000000..5a08d04b0 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat2-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat2-col-rd.shader_test new file mode 100644 index 000000000..f5d53243f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..4651de853 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat2-index-col-rd.shader_test new file mode 100644 index 000000000..b20af67cb --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 000000000..b7ba2fe68 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat2-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat2-index-rd.shader_test new file mode 100644 index 000000000..e9560b766 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat2-index-row-rd.shader_test new file mode 100644 index 000000000..10135d071 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat2-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat2-rd.shader_test new file mode 100644 index 000000000..b78c330e9 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat2-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat2-row-rd.shader_test new file mode 100644 index 000000000..ccfb4908b --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat3-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat3-col-rd.shader_test new file mode 100644 index 000000000..b59cd7192 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..8366fb0c2 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat3-index-col-rd.shader_test new file mode 100644 index 000000000..894510df1 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 000000000..8296e0be9 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat3-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat3-index-rd.shader_test new file mode 100644 index 000000000..9fc2c68ef --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat3-index-row-rd.shader_test new file mode 100644 index 000000000..8d7ea4ce2 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat3-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat3-rd.shader_test new file mode 100644 index 000000000..6869bd3fd --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat3-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat3-row-rd.shader_test new file mode 100644 index 000000000..daa3d4f48 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat4-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat4-col-rd.shader_test new file mode 100644 index 000000000..51c0b2fe2 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..bb57ff89d --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat4-index-col-rd.shader_test new file mode 100644 index 000000000..e35ec59a3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 000000000..4bf4559bd --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat4-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat4-index-rd.shader_test new file mode 100644 index 000000000..985e285e9 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat4-index-row-rd.shader_test new file mode 100644 index 000000000..2592a7514 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat4-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat4-rd.shader_test new file mode 100644 index 000000000..a68cdcd5f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-array-mat4-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-array-mat4-row-rd.shader_test new file mode 100644 index 000000000..faf4f23d3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-mat2-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat2-col-rd.shader_test new file mode 100644 index 000000000..71b0891da --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat2-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..417889ff2 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat2-col-row-rd.shader_test @@ -0,0 +1,62 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-mat2-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat2-rd.shader_test new file mode 100644 index 000000000..09893b599 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat2-rd.shader_test @@ -0,0 +1,40 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-mat2-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat2-row-rd.shader_test new file mode 100644 index 000000000..54ed6cb71 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat2-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-mat3-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat3-col-rd.shader_test new file mode 100644 index 000000000..6e0c0c51f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat3-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..8f1982cdb --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat3-col-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-mat3-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat3-rd.shader_test new file mode 100644 index 000000000..bba23e4ac --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat3-rd.shader_test @@ -0,0 +1,40 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-mat3-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat3-row-rd.shader_test new file mode 100644 index 000000000..de3a6971f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat3-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-mat4-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat4-col-rd.shader_test new file mode 100644 index 000000000..4097e5c7f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat4-col-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..428925758 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat4-col-row-rd.shader_test @@ -0,0 +1,124 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-mat4-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat4-rd.shader_test new file mode 100644 index 000000000..344167866 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat4-rd.shader_test @@ -0,0 +1,40 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/fs-varying-mat4-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat4-row-rd.shader_test new file mode 100644 index 000000000..96cd3e7e5 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-varying-mat4-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat2-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-col-rd.shader_test new file mode 100644 index 000000000..cddaaba90 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..aa22a7bb4 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-col-rd.shader_test new file mode 100644 index 000000000..525abcdf9 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 000000000..8c11d49b2 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat2-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-rd.shader_test new file mode 100644 index 000000000..596a183d0 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-row-rd.shader_test new file mode 100644 index 000000000..87fc64427 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat2-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-rd.shader_test new file mode 100644 index 000000000..b100a1b11 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat2-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-row-rd.shader_test new file mode 100644 index 000000000..1784bf024 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat3-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-col-rd.shader_test new file mode 100644 index 000000000..624bbaeae --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..c5359cb36 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-col-rd.shader_test new file mode 100644 index 000000000..40271f116 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 000000000..9089a27c3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat3-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-rd.shader_test new file mode 100644 index 000000000..cb6548d79 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-row-rd.shader_test new file mode 100644 index 000000000..e2967055e --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat3-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-rd.shader_test new file mode 100644 index 000000000..962bcf6d1 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat3-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-row-rd.shader_test new file mode 100644 index 000000000..d87309cf3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat4-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-col-rd.shader_test new file mode 100644 index 000000000..3df024dc0 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..45877bdc0 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-col-rd.shader_test new file mode 100644 index 000000000..df5b1686e --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 000000000..814b426f0 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat4-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-rd.shader_test new file mode 100644 index 000000000..74056dc96 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-row-rd.shader_test new file mode 100644 index 000000000..9107641dc --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat4-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-rd.shader_test new file mode 100644 index 000000000..f62c417b0 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-array-mat4-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-row-rd.shader_test new file mode 100644 index 000000000..5769b0860 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-mat2-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-col-rd.shader_test new file mode 100644 index 000000000..cc5c9ed92 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..96659d9e5 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-mat2-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-rd.shader_test new file mode 100644 index 000000000..08eb0c256 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-mat2-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-row-rd.shader_test new file mode 100644 index 000000000..8ccda9978 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-mat3-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-col-rd.shader_test new file mode 100644 index 000000000..c61fb9fb3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..2aecfedfb --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-mat3-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-rd.shader_test new file mode 100644 index 000000000..671abc18f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-mat3-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-row-rd.shader_test new file mode 100644 index 000000000..32a9ccbf2 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-mat4-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-col-rd.shader_test new file mode 100644 index 000000000..2ba1ee932 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..3b6a6abe1 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-mat4-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-rd.shader_test new file mode 100644 index 000000000..bc51c91a5 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-temp-mat4-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-row-rd.shader_test new file mode 100644 index 000000000..ce8699a1b --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-uniform-array-mat2-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-col-rd.shader_test new file mode 100644 index 000000000..d5402a6c7 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-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] +#version 120 +uniform int col; +uniform vec2 expect; + 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] +#version 120 +uniform int col; +uniform vec2 expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..b06fb5569 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-col-row-rd.shader_test @@ -0,0 +1,67 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int col; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int col; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-index-col-rd.shader_test new file mode 100644 index 000000000..047ab96a6 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-index-col-rd.shader_test @@ -0,0 +1,78 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int col; +uniform vec2 expect; + 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] +#version 120 +uniform int index; +uniform int col; +uniform vec2 expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 000000000..33d8211f0 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-index-col-row-rd.shader_test @@ -0,0 +1,116 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat2-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-index-rd.shader_test new file mode 100644 index 000000000..1660b4c0a --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-index-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] +#version 120 +uniform int index; +uniform vec2 expect; + 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] +#version 120 +uniform int index; +uniform vec2 expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-index-row-rd.shader_test new file mode 100644 index 000000000..a76a271b5 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-index-row-rd.shader_test @@ -0,0 +1,78 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int index; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat2-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-rd.shader_test new file mode 100644 index 000000000..dd57abe3b --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-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] +#version 120 +uniform vec2 expect; + 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] +#version 120 +uniform vec2 expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat2-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-row-rd.shader_test new file mode 100644 index 000000000..a157b520e --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat2-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] +#version 120 +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat3-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-col-rd.shader_test new file mode 100644 index 000000000..95fab47a7 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-col-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] +#version 120 +uniform int col; +uniform vec3 expect; + 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] +#version 120 +uniform int col; +uniform vec3 expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..1d9785e87 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-col-row-rd.shader_test @@ -0,0 +1,93 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int col; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int col; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-index-col-rd.shader_test new file mode 100644 index 000000000..614d71234 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-index-col-rd.shader_test @@ -0,0 +1,93 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int col; +uniform vec3 expect; + 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] +#version 120 +uniform int index; +uniform int col; +uniform vec3 expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 000000000..d5e756466 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-index-col-row-rd.shader_test @@ -0,0 +1,194 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat3-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-index-rd.shader_test new file mode 100644 index 000000000..c298e707b --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-index-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] +#version 120 +uniform int index; +uniform vec3 expect; + 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] +#version 120 +uniform int index; +uniform vec3 expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-index-row-rd.shader_test new file mode 100644 index 000000000..418a76cd4 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-index-row-rd.shader_test @@ -0,0 +1,93 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int index; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat3-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-rd.shader_test new file mode 100644 index 000000000..856fbc706 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-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] +#version 120 +uniform vec3 expect; + 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] +#version 120 +uniform vec3 expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat3-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-row-rd.shader_test new file mode 100644 index 000000000..f34077556 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat3-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] +#version 120 +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat4-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-col-rd.shader_test new file mode 100644 index 000000000..c2e5b8666 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-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] +#version 120 +uniform int col; +uniform vec4 expect; + 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] +#version 120 +uniform int col; +uniform vec4 expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..3d44b03f9 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-col-row-rd.shader_test @@ -0,0 +1,129 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int col; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int col; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-index-col-rd.shader_test new file mode 100644 index 000000000..eafd32fb3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-index-col-rd.shader_test @@ -0,0 +1,108 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int col; +uniform vec4 expect; + 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] +#version 120 +uniform int index; +uniform int col; +uniform vec4 expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 000000000..e95ce56a8 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-index-col-row-rd.shader_test @@ -0,0 +1,302 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int index; +uniform int col; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat4-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-index-rd.shader_test new file mode 100644 index 000000000..e91cd5178 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-index-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] +#version 120 +uniform int index; +uniform vec4 expect; + 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] +#version 120 +uniform int index; +uniform vec4 expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-index-row-rd.shader_test new file mode 100644 index 000000000..eeae26077 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-index-row-rd.shader_test @@ -0,0 +1,108 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform int index; +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int index; +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat4-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-rd.shader_test new file mode 100644 index 000000000..46a6f12e8 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-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] +#version 120 +uniform vec4 expect; + 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] +#version 120 +uniform vec4 expect; + 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-1.20/execution/variable-indexing/vs-uniform-array-mat4-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-row-rd.shader_test new file mode 100644 index 000000000..db8940de3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-array-mat4-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] +#version 120 +uniform int row; +uniform float expect; + 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] +#version 120 +uniform int row; +uniform float expect; + 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-1.20/execution/variable-indexing/vs-uniform-mat2-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-mat2-col-rd.shader_test new file mode 100644 index 000000000..4234fbd08 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-uniform-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..9270e3270 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-uniform-mat2-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-mat2-rd.shader_test new file mode 100644 index 000000000..d092be5f7 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-uniform-mat2-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-mat2-row-rd.shader_test new file mode 100644 index 000000000..46bdcbf97 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-uniform-mat3-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-mat3-col-rd.shader_test new file mode 100644 index 000000000..0ce8e5d93 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-uniform-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..e986951a6 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-uniform-mat3-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-mat3-rd.shader_test new file mode 100644 index 000000000..342a7a9d2 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-uniform-mat3-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-mat3-row-rd.shader_test new file mode 100644 index 000000000..d55dcf8ff --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-uniform-mat4-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-mat4-col-rd.shader_test new file mode 100644 index 000000000..2464b11a3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-uniform-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..b6ed60cb4 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-uniform-mat4-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-mat4-rd.shader_test new file mode 100644 index 000000000..45ab24257 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-uniform-mat4-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-mat4-row-rd.shader_test new file mode 100644 index 000000000..0389be0a9 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-uniform-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat2-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-col-rd.shader_test new file mode 100644 index 000000000..6fac47660 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..a83d6a7e8 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-col-row-rd.shader_test @@ -0,0 +1,80 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat2-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-col-rd.shader_test new file mode 100644 index 000000000..9cedc8df8 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-col-rd.shader_test @@ -0,0 +1,91 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat2-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-col-row-rd.shader_test new file mode 100644 index 000000000..43e1c76a8 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-col-row-rd.shader_test @@ -0,0 +1,129 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat2-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-rd.shader_test new file mode 100644 index 000000000..b18868bbc --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat2-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-row-rd.shader_test new file mode 100644 index 000000000..5be4011a7 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-row-rd.shader_test @@ -0,0 +1,91 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat2-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-rd.shader_test new file mode 100644 index 000000000..88f176baa --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat2-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-row-rd.shader_test new file mode 100644 index 000000000..bfe2aee5d --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat3-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-col-rd.shader_test new file mode 100644 index 000000000..2fa65dacd --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..d77dc3fd3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-col-row-rd.shader_test @@ -0,0 +1,106 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat3-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-col-rd.shader_test new file mode 100644 index 000000000..167f58e18 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-col-rd.shader_test @@ -0,0 +1,106 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat3-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-col-row-rd.shader_test new file mode 100644 index 000000000..a8a22dd1d --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-col-row-rd.shader_test @@ -0,0 +1,207 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat3-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-rd.shader_test new file mode 100644 index 000000000..6f5dc617c --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat3-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-row-rd.shader_test new file mode 100644 index 000000000..e6966c0d4 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-row-rd.shader_test @@ -0,0 +1,106 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat3-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-rd.shader_test new file mode 100644 index 000000000..267fdf19a --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat3-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-row-rd.shader_test new file mode 100644 index 000000000..cb0bbcd56 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat4-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-col-rd.shader_test new file mode 100644 index 000000000..98c94336d --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-col-rd.shader_test @@ -0,0 +1,76 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..a7da889fc --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-col-row-rd.shader_test @@ -0,0 +1,142 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat4-index-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-col-rd.shader_test new file mode 100644 index 000000000..2ce2f4c80 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-col-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat4-index-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-col-row-rd.shader_test new file mode 100644 index 000000000..e5e30e7c5 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-col-row-rd.shader_test @@ -0,0 +1,315 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat4-index-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-rd.shader_test new file mode 100644 index 000000000..981c49e99 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat4-index-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-row-rd.shader_test new file mode 100644 index 000000000..5b04faccc --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat4-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-rd.shader_test new file mode 100644 index 000000000..3e64a2edd --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-array-mat4-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-row-rd.shader_test new file mode 100644 index 000000000..341630bcc --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-row-rd.shader_test @@ -0,0 +1,76 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-mat2-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-col-rd.shader_test new file mode 100644 index 000000000..fc6d02a3d --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-col-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-col-row-rd.shader_test new file mode 100644 index 000000000..9c77ad544 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-col-row-rd.shader_test @@ -0,0 +1,78 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-mat2-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-rd.shader_test new file mode 100644 index 000000000..ee930f3fe --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-mat2-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-row-rd.shader_test new file mode 100644 index 000000000..2d55e77a9 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-mat3-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-col-rd.shader_test new file mode 100644 index 000000000..8897263be --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-col-rd.shader_test @@ -0,0 +1,69 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-col-row-rd.shader_test new file mode 100644 index 000000000..253c24f57 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-col-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-mat3-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-rd.shader_test new file mode 100644 index 000000000..c17ccb457 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-mat3-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-row-rd.shader_test new file mode 100644 index 000000000..ed3683729 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-row-rd.shader_test @@ -0,0 +1,69 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-mat4-col-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-col-rd.shader_test new file mode 100644 index 000000000..cf16651a8 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-col-row-rd.shader_test new file mode 100644 index 000000000..204db7030 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-col-row-rd.shader_test @@ -0,0 +1,140 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-read.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-mat4-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-rd.shader_test new file mode 100644 index 000000000..d34d9410c --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-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] +#version 120 +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] +#version 120 +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-1.20/execution/variable-indexing/vs-varying-mat4-row-rd.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-row-rd.shader_test new file mode 100644 index 000000000..a1563f6ad --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-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] +#version 120 +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] +#version 120 +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 + |