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 00000000..0c37a8b4 --- /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 00000000..4da2b97f --- /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 00000000..8d2944f4 --- /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 00000000..6333f945 --- /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 00000000..b5dfc656 --- /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 00000000..111c7ee4 --- /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 00000000..cca3c57d --- /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 00000000..6eb35fff --- /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 00000000..578dd301 --- /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 00000000..b4f06ea9 --- /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 00000000..6957f28b --- /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 00000000..ae93756f --- /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 00000000..6c6b3f60 --- /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 00000000..a72ab467 --- /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 00000000..185699ac --- /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 00000000..03d645cb --- /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 00000000..904203ef --- /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 00000000..615e5e78 --- /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 00000000..5b8c720a --- /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 00000000..a365f36a --- /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 00000000..6a3ccd7e --- /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 00000000..9cb578d2 --- /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 00000000..6ef3fc48 --- /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 00000000..ebe91a3c --- /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 00000000..2a041862 --- /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 00000000..12aa2da8 --- /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 00000000..03105b7d --- /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 00000000..9fa74230 --- /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 00000000..9b18316b --- /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 00000000..eae9768e --- /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 00000000..71bbb321 --- /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 00000000..35d81566 --- /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 00000000..3bc8e2b9 --- /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 00000000..0f51c088 --- /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 00000000..90c7a0ee --- /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 00000000..49a55808 --- /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 00000000..97eb1eaf --- /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 00000000..325b9b0b --- /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 00000000..f4322e00 --- /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 00000000..ff8cd022 --- /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 00000000..ffeebba1 --- /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 00000000..fdd18782 --- /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 00000000..504d66d9 --- /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 00000000..c96e55c8 --- /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 00000000..02810f61 --- /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 00000000..da038be7 --- /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 00000000..8acf998a --- /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 00000000..ec1bb859 --- /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 00000000..6dffbb08 --- /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 00000000..3ef0ae66 --- /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 00000000..0d631c9a --- /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 00000000..0086592d --- /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 00000000..570c9902 --- /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 00000000..cdc1d9de --- /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 00000000..eb77c88f --- /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 00000000..cd61894d --- /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 00000000..82c87982 --- /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 00000000..21157aa3 --- /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 00000000..52f4a4f9 --- /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 00000000..6e01a1c2 --- /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 00000000..0249873e --- /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 00000000..388b21e7 --- /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 00000000..0625f8b0 --- /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 00000000..fb2175af --- /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 00000000..0e4b171a --- /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 00000000..1242332f --- /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 00000000..694acb22 --- /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 00000000..6cdacfb6 --- /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 00000000..7d186f2c --- /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 00000000..0928e05a --- /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 00000000..ee7d7bf3 --- /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 00000000..151fdaec --- /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 00000000..f3ec0e38 --- /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 00000000..27e81b6a --- /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 00000000..ba9a4169 --- /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 00000000..acb5bf96 --- /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 00000000..67a20049 --- /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 00000000..8b5babbe --- /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 00000000..caaedf68 --- /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 00000000..61e91b51 --- /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 00000000..b07a98cf --- /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 00000000..8b65007f --- /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 00000000..77c0095c --- /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 00000000..161f596a --- /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 00000000..009cefa6 --- /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 00000000..a99c306b --- /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 00000000..59993545 --- /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 00000000..1b2e7336 --- /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 00000000..68108a70 --- /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 00000000..8fdea06c --- /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 00000000..43538dff --- /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 00000000..ce6c02fd --- /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 00000000..c34fcb8a --- /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 00000000..e33607fb --- /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 00000000..bb756ec8 --- /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 00000000..7ddef700 --- /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 00000000..82bc5153 --- /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 00000000..fd21cdaa --- /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 00000000..8ae5105c --- /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 00000000..9a40c7c5 --- /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 00000000..aa653faa --- /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 00000000..039d5695 --- /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 00000000..2197c42f --- /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 00000000..3a2e2611 --- /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 00000000..0e30c9e5 --- /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 00000000..8b06e27c --- /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 00000000..51f3ab4f --- /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 00000000..274eea68 --- /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 00000000..f7735225 --- /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 00000000..d4559105 --- /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 00000000..fa1a0318 --- /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 00000000..69e2b047 --- /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 00000000..a3665320 --- /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 00000000..0f75546e --- /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 00000000..0367f2f8 --- /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 00000000..a252af4e --- /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 00000000..3859e428 --- /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 00000000..f23bec3d --- /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 00000000..cf3a1482 --- /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 00000000..bb0950d0 --- /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 00000000..899fb0f3 --- /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 00000000..d441b3a1 --- /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 00000000..f314c93e --- /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 00000000..2b68ad14 --- /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 00000000..680b7cbf --- /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 00000000..af57f358 --- /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 00000000..e74afe9c --- /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 00000000..a3a6400c --- /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 00000000..fab9d0f5 --- /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 00000000..fd7441c3 --- /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 00000000..0459de9a --- /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 00000000..a6fe5dae --- /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 00000000..796e546b --- /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 00000000..8ffd5633 --- /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 00000000..16d0ec84 --- /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 00000000..9256112d --- /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 00000000..ae40544a --- /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 00000000..0d61714c --- /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 00000000..d5c044d2 --- /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 00000000..028cdde1 --- /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 00000000..9b46ded4 --- /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 00000000..61b0cc77 --- /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 00000000..749d64a3 --- /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 00000000..46d4f538 --- /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 00000000..8830f8f8 --- /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 00000000..dd2ede8f --- /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 00000000..8c9b1ceb --- /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 00000000..9187c38c --- /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 00000000..3d4f9553 --- /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 00000000..bc5becb7 --- /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 00000000..cfef3fd9 --- /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 00000000..6f7c5331 --- /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 00000000..a32d6e56 --- /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 00000000..ca98fddf --- /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 00000000..b538777f --- /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 00000000..b43405fe --- /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 00000000..89e1c16b --- /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 00000000..eba0c335 --- /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 00000000..f47e412d --- /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 00000000..31117950 --- /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 00000000..ecae6a4e --- /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 00000000..8cb59719 --- /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 00000000..3feb36c9 --- /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 00000000..fc481950 --- /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 00000000..ed5d2e29 --- /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 00000000..63638ffa --- /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 00000000..20664b10 --- /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 00000000..d0892622 --- /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 00000000..36ece655 --- /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 00000000..792b3433 --- /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 00000000..8ec2f571 --- /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 00000000..9ecdcbcf --- /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 00000000..60f11360 --- /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 00000000..38a40294 --- /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 00000000..7c67df2d --- /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 00000000..38acf8d9 --- /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 00000000..99527462 --- /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 00000000..4c0ca045 --- /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 00000000..f7ffde2c --- /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 00000000..2e091e4a --- /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 00000000..272ecae6 --- /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 00000000..e3740d26 --- /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 00000000..06be962c --- /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 00000000..36933ac8 --- /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 00000000..b0c2a2e3 --- /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 00000000..35f238b0 --- /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 00000000..9b89902f --- /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 00000000..6b9eb70d --- /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 00000000..98586265 --- /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 00000000..1b2ea278 --- /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 00000000..975c255f --- /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 00000000..84eb92b1 --- /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 00000000..6e19aa36 --- /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 00000000..19a62d92 --- /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 00000000..0c3673de --- /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 00000000..fc4b3291 --- /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 00000000..306fae1b --- /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 00000000..ceaee5d3 --- /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 00000000..ac71a757 --- /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 00000000..03eb0596 --- /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 00000000..2bf421b0 --- /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 00000000..cc4a5fed --- /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 00000000..20df7b1f --- /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 00000000..ffd1aae4 --- /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 00000000..b0fd3842 --- /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 00000000..ac5f17e2 --- /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 00000000..b2988837 --- /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 00000000..a6d09b54 --- /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 00000000..98470852 --- /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 00000000..56576117 --- /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 00000000..76424068 --- /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 00000000..2d4e70f3 --- /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 00000000..874f03c2 --- /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 00000000..1a50570b --- /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 00000000..5b9f4840 --- /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 00000000..da906c3d --- /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 00000000..903d4e4c --- /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 00000000..9c4a56ee --- /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 00000000..d4bcb1a2 --- /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 00000000..2b8fe0c9 --- /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 00000000..cd66f7d9 --- /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 00000000..41addaa1 --- /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 00000000..62c17965 --- /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 00000000..7a59c495 --- /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 00000000..dd79c6e8 --- /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 00000000..22bcf3e0 --- /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 00000000..a46f1bc0 --- /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 00000000..fa87d92e --- /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 00000000..dd072f30 --- /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 00000000..f555b0b7 --- /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 00000000..04e63127 --- /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 00000000..b991bbc9 --- /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 00000000..ab842f76 --- /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 00000000..542edcbd --- /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 00000000..0785f198 --- /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 00000000..193fce4e --- /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 00000000..4499d529 --- /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 00000000..1174ac96 --- /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 00000000..081be553 --- /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 00000000..d7250961 --- /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 00000000..f4645d9b --- /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 00000000..69b747db --- /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 00000000..4fc9ffe0 --- /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 00000000..d7c2cb65 --- /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 00000000..760c2e0a --- /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 00000000..0deb2e91 --- /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 00000000..579d6b20 --- /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 00000000..1f3ab080 --- /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 00000000..83bc89b0 --- /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 00000000..6b0915bc --- /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 00000000..ec057e7f --- /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 00000000..79a341df --- /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 00000000..1df61e8f --- /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 00000000..44d6d8fc --- /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 00000000..c810505a --- /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 00000000..395e84bb --- /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 00000000..f4fd63b5 --- /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 00000000..8f937e3b --- /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 00000000..4617c77b --- /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 00000000..daa80030 --- /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 00000000..7d22c3e5 --- /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 00000000..902e1177 --- /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 00000000..3629ca9c --- /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 00000000..af467d1a --- /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 00000000..88402f44 --- /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 00000000..c686b4f4 --- /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 00000000..da109fb5 --- /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 00000000..93468d00 --- /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 00000000..5f6eef5b --- /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 00000000..867b4a37 --- /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 00000000..d1b6667b --- /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 00000000..1112c2a5 --- /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 00000000..cbc1afc5 --- /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 00000000..68f860f7 --- /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 00000000..c83031b1 --- /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 00000000..e0d16a10 --- /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 00000000..b9d0204f --- /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 00000000..ed83ad37 --- /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 00000000..93de8f0a --- /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 00000000..dfeda235 --- /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 00000000..967f81a8 --- /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 00000000..4f23cf70 --- /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 00000000..13ce6a54 --- /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 00000000..00844124 --- /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 00000000..a6c58198 --- /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 00000000..0c12a44c --- /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 00000000..9cb1545b --- /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 00000000..46e8d764 --- /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 00000000..5a08d04b --- /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 00000000..f5d53243 --- /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 00000000..4651de85 --- /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 00000000..b20af67c --- /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 00000000..b7ba2fe6 --- /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 00000000..e9560b76 --- /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 00000000..10135d07 --- /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 00000000..b78c330e --- /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 00000000..ccfb4908 --- /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 00000000..b59cd719 --- /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 00000000..8366fb0c --- /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 00000000..894510df --- /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 00000000..8296e0be --- /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 00000000..9fc2c68e --- /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 00000000..8d7ea4ce --- /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 00000000..6869bd3f --- /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 00000000..daa3d4f4 --- /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 00000000..51c0b2fe --- /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 00000000..bb57ff89 --- /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 00000000..e35ec59a --- /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 00000000..4bf4559b --- /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 00000000..985e285e --- /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 00000000..2592a751 --- /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 00000000..a68cdcd5 --- /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 00000000..faf4f23d --- /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 00000000..71b0891d --- /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 00000000..417889ff --- /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 00000000..09893b59 --- /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 00000000..54ed6cb7 --- /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 00000000..6e0c0c51 --- /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 00000000..8f1982cd --- /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 00000000..bba23e4a --- /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 00000000..de3a6971 --- /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 00000000..4097e5c7 --- /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 00000000..42892575 --- /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 00000000..34416786 --- /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 00000000..96cd3e7e --- /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 00000000..cddaaba9 --- /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 00000000..aa22a7bb --- /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 00000000..525abcdf --- /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 00000000..8c11d49b --- /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 00000000..596a183d --- /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 00000000..87fc6442 --- /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 00000000..b100a1b1 --- /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 00000000..1784bf02 --- /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 00000000..624bbaea --- /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 00000000..c5359cb3 --- /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 00000000..40271f11 --- /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 00000000..9089a27c --- /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 00000000..cb6548d7 --- /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 00000000..e2967055 --- /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 00000000..962bcf6d --- /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 00000000..d87309cf --- /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 00000000..3df024dc --- /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 00000000..45877bdc --- /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 00000000..df5b1686 --- /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 00000000..814b426f --- /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 00000000..74056dc9 --- /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 00000000..9107641d --- /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 00000000..f62c417b --- /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 00000000..5769b086 --- /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 00000000..cc5c9ed9 --- /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 00000000..96659d9e --- /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 00000000..08eb0c25 --- /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 00000000..8ccda997 --- /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 00000000..c61fb9fb --- /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 00000000..2aecfedf --- /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 00000000..671abc18 --- /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 00000000..32a9ccbf --- /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 00000000..2ba1ee93 --- /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 00000000..3b6a6abe --- /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 00000000..bc51c91a --- /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 00000000..ce8699a1 --- /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 00000000..d5402a6c --- /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 00000000..b06fb556 --- /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 00000000..047ab96a --- /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 00000000..33d8211f --- /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 00000000..1660b4c0 --- /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 00000000..a76a271b --- /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 00000000..dd57abe3 --- /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 00000000..a157b520 --- /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 00000000..95fab47a --- /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 00000000..1d9785e8 --- /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 00000000..614d7123 --- /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 00000000..d5e75646 --- /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 00000000..c298e707 --- /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 00000000..418a76cd --- /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 00000000..856fbc70 --- /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 00000000..f3407755 --- /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 00000000..c2e5b866 --- /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 00000000..3d44b03f --- /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 00000000..eafd32fb --- /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 00000000..e95ce56a --- /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 00000000..e91cd517 --- /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 00000000..eeae2607 --- /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 00000000..46a6f12e --- /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 00000000..db8940de --- /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 00000000..4234fbd0 --- /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 00000000..9270e327 --- /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 00000000..d092be5f --- /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 00000000..46bdcbf9 --- /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 00000000..0ce8e5d9 --- /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 00000000..e986951a --- /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 00000000..342a7a9d --- /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 00000000..d55dcf8f --- /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 00000000..2464b11a --- /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 00000000..b6ed60cb --- /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 00000000..45ab2425 --- /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 00000000..0389be0a --- /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 00000000..6fac4766 --- /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 00000000..a83d6a7e --- /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 00000000..9cedc8df --- /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 00000000..43e1c76a --- /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 00000000..b18868bb --- /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 00000000..5be4011a --- /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 00000000..88f176ba --- /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 00000000..bfe2aee5 --- /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 00000000..2fa65dac --- /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 00000000..d77dc3fd --- /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 00000000..167f58e1 --- /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 00000000..a8a22dd1 --- /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 00000000..6f5dc617 --- /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 00000000..e6966c0d --- /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 00000000..267fdf19 --- /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 00000000..cb0bbcd5 --- /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 00000000..98c94336 --- /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 00000000..a7da889f --- /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 00000000..2ce2f4c8 --- /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 00000000..e5e30e7c --- /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 00000000..981c49e9 --- /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 00000000..5b04facc --- /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 00000000..3e64a2ed --- /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 00000000..341630bc --- /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 00000000..fc6d02a3 --- /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 00000000..9c77ad54 --- /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 00000000..ee930f3f --- /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 00000000..2d55e77a --- /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 00000000..8897263b --- /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 00000000..253c24f5 --- /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 00000000..c17ccb45 --- /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 00000000..ed368372 --- /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 00000000..cf16651a --- /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 00000000..204db703 --- /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 00000000..d34d9410 --- /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 00000000..a1563f6a --- /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 + |