diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2011-07-17 15:56:57 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2011-08-19 09:25:04 -0700 |
commit | d1696bb83ff89dfdc7b6aff4c62fd01e767de4e3 (patch) | |
tree | 548e72d48bb6e8d9cba3ce308c95d3822b9a5953 /tests/spec/glsl-1.10/execution/variable-indexing | |
parent | f7747a2caf2834b7ca1cd450e613b52239fde494 (diff) |
glsl-1.10 / glsl-1.20: Add non-constant index write tests
All of these tests follow a similar form. An array of matrices is set
to some values that have one incorrect element. A non-constant index
write is used to fix that incorrect element. The result is verified.
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.
Diffstat (limited to 'tests/spec/glsl-1.10/execution/variable-indexing')
108 files changed, 11442 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..bcb9253f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test @@ -0,0 +1,81 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-wr.shader_test new file mode 100644 index 00000000..b37196fd --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-wr.shader_test @@ -0,0 +1,62 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test new file mode 100644 index 00000000..309a336f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test @@ -0,0 +1,152 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 85 20 10 10 +probe rgb 90 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test new file mode 100644 index 00000000..db13f9b7 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test @@ -0,0 +1,97 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test new file mode 100644 index 00000000..382861a9 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test @@ -0,0 +1,98 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-wr.shader_test new file mode 100644 index 00000000..9a50ecd7 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-wr.shader_test @@ -0,0 +1,70 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-row-wr.shader_test new file mode 100644 index 00000000..bdc5113b --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-row-wr.shader_test @@ -0,0 +1,63 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-wr.shader_test new file mode 100644 index 00000000..364bb083 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-wr.shader_test @@ -0,0 +1,53 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..6ddd41b4 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test @@ -0,0 +1,122 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-wr.shader_test new file mode 100644 index 00000000..c7156429 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-wr.shader_test @@ -0,0 +1,70 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test new file mode 100644 index 00000000..4f1a8fcd --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test @@ -0,0 +1,275 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 115 20 10 10 +probe rgb 120 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 115 35 10 10 +probe rgb 120 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test new file mode 100644 index 00000000..f46fa414 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test @@ -0,0 +1,121 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test new file mode 100644 index 00000000..37734986 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test @@ -0,0 +1,122 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-wr.shader_test new file mode 100644 index 00000000..f104e3a3 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-wr.shader_test @@ -0,0 +1,70 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-row-wr.shader_test new file mode 100644 index 00000000..8027907a --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-row-wr.shader_test @@ -0,0 +1,71 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-wr.shader_test new file mode 100644 index 00000000..93861c97 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-wr.shader_test @@ -0,0 +1,53 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..7e035abc --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test @@ -0,0 +1,179 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-wr.shader_test new file mode 100644 index 00000000..c6860f20 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-wr.shader_test @@ -0,0 +1,78 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test new file mode 100644 index 00000000..f408484a --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test @@ -0,0 +1,446 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 145 50 10 10 +probe rgb 150 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 175 20 10 10 +probe rgb 180 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 175 35 10 10 +probe rgb 180 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 175 50 10 10 +probe rgb 180 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 190 20 10 10 +probe rgb 195 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 190 35 10 10 +probe rgb 195 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 190 50 10 10 +probe rgb 195 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test new file mode 100644 index 00000000..74d8d953 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test @@ -0,0 +1,145 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test new file mode 100644 index 00000000..473b2d7a --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test @@ -0,0 +1,146 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-wr.shader_test new file mode 100644 index 00000000..6762d63e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-wr.shader_test @@ -0,0 +1,70 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-row-wr.shader_test new file mode 100644 index 00000000..25bbab06 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-row-wr.shader_test @@ -0,0 +1,79 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-wr.shader_test new file mode 100644 index 00000000..9ddf8f87 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-wr.shader_test @@ -0,0 +1,53 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..e8de8649 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-row-wr.shader_test @@ -0,0 +1,73 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-wr.shader_test new file mode 100644 index 00000000..544b0783 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-wr.shader_test @@ -0,0 +1,54 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-row-wr.shader_test new file mode 100644 index 00000000..954b78b7 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-row-wr.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-wr.shader_test new file mode 100644 index 00000000..a23dac7f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-wr.shader_test @@ -0,0 +1,45 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..4ca1f7f5 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-row-wr.shader_test @@ -0,0 +1,114 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-wr.shader_test new file mode 100644 index 00000000..410a355e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-wr.shader_test @@ -0,0 +1,62 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-row-wr.shader_test new file mode 100644 index 00000000..4f2e2690 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-row-wr.shader_test @@ -0,0 +1,63 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-wr.shader_test new file mode 100644 index 00000000..855fbedf --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-wr.shader_test @@ -0,0 +1,45 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..ed094bed --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-row-wr.shader_test @@ -0,0 +1,171 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-wr.shader_test new file mode 100644 index 00000000..61151289 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-wr.shader_test @@ -0,0 +1,70 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-row-wr.shader_test new file mode 100644 index 00000000..0164a105 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-row-wr.shader_test @@ -0,0 +1,71 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-wr.shader_test new file mode 100644 index 00000000..ea49ac38 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-wr.shader_test @@ -0,0 +1,45 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..924807d6 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test @@ -0,0 +1,83 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-wr.shader_test new file mode 100644 index 00000000..4bb04e81 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-wr.shader_test @@ -0,0 +1,64 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test new file mode 100644 index 00000000..adaf608f --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test @@ -0,0 +1,154 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 85 20 10 10 +probe rgb 90 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test new file mode 100644 index 00000000..39c6dff2 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test @@ -0,0 +1,99 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test new file mode 100644 index 00000000..e5a5c084 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test @@ -0,0 +1,100 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-wr.shader_test new file mode 100644 index 00000000..2ade3d1a --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-wr.shader_test @@ -0,0 +1,72 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-row-wr.shader_test new file mode 100644 index 00000000..e20cf7db --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-row-wr.shader_test @@ -0,0 +1,65 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-wr.shader_test new file mode 100644 index 00000000..3d4e2ff6 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-wr.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 dst_matrix[3]; + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..5c5a2f77 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test @@ -0,0 +1,124 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-wr.shader_test new file mode 100644 index 00000000..743d6f40 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-wr.shader_test @@ -0,0 +1,72 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test new file mode 100644 index 00000000..63c18e81 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test @@ -0,0 +1,277 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 115 20 10 10 +probe rgb 120 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 115 35 10 10 +probe rgb 120 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test new file mode 100644 index 00000000..4a2ca89c --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test @@ -0,0 +1,123 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test new file mode 100644 index 00000000..def99ade --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test @@ -0,0 +1,124 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-wr.shader_test new file mode 100644 index 00000000..b7dd57d3 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-wr.shader_test @@ -0,0 +1,72 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-row-wr.shader_test new file mode 100644 index 00000000..1d19e560 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-row-wr.shader_test @@ -0,0 +1,73 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-wr.shader_test new file mode 100644 index 00000000..f34b68b6 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-wr.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 dst_matrix[3]; + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..66552664 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test @@ -0,0 +1,181 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-wr.shader_test new file mode 100644 index 00000000..05b0d194 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-wr.shader_test @@ -0,0 +1,80 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test new file mode 100644 index 00000000..1bec9c9d --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test @@ -0,0 +1,448 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 145 50 10 10 +probe rgb 150 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 175 20 10 10 +probe rgb 180 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 175 35 10 10 +probe rgb 180 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 175 50 10 10 +probe rgb 180 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 190 20 10 10 +probe rgb 195 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 190 35 10 10 +probe rgb 195 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 190 50 10 10 +probe rgb 195 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test new file mode 100644 index 00000000..d411fe0d --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test @@ -0,0 +1,147 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test new file mode 100644 index 00000000..8785feaf --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test @@ -0,0 +1,148 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-wr.shader_test new file mode 100644 index 00000000..63d23291 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-wr.shader_test @@ -0,0 +1,72 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-row-wr.shader_test new file mode 100644 index 00000000..5225449c --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-row-wr.shader_test @@ -0,0 +1,81 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-wr.shader_test new file mode 100644 index 00000000..0e8d4fd5 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-wr.shader_test @@ -0,0 +1,55 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 dst_matrix[3]; + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..2514a0d7 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-row-wr.shader_test @@ -0,0 +1,75 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-wr.shader_test new file mode 100644 index 00000000..87430fb5 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-wr.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-row-wr.shader_test new file mode 100644 index 00000000..838e68eb --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-row-wr.shader_test @@ -0,0 +1,57 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-wr.shader_test new file mode 100644 index 00000000..f601edc1 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-wr.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..6236a29e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-row-wr.shader_test @@ -0,0 +1,116 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-wr.shader_test new file mode 100644 index 00000000..2d627741 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-wr.shader_test @@ -0,0 +1,64 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-row-wr.shader_test new file mode 100644 index 00000000..1fa3d11e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-row-wr.shader_test @@ -0,0 +1,65 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-wr.shader_test new file mode 100644 index 00000000..ed09640e --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-wr.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..4c35716d --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-row-wr.shader_test @@ -0,0 +1,173 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-wr.shader_test new file mode 100644 index 00000000..db671c9a --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-wr.shader_test @@ -0,0 +1,72 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-row-wr.shader_test new file mode 100644 index 00000000..e6d9e3f2 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-row-wr.shader_test @@ -0,0 +1,73 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-wr.shader_test new file mode 100644 index 00000000..3fae51ef --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-wr.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 110 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..f811b1c2 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test @@ -0,0 +1,94 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; +} + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-wr.shader_test new file mode 100644 index 00000000..bf3c7c70 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-wr.shader_test @@ -0,0 +1,74 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; +} + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test new file mode 100644 index 00000000..189995a7 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test @@ -0,0 +1,165 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; +} + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 85 20 10 10 +probe rgb 90 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test new file mode 100644 index 00000000..c18124f4 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test @@ -0,0 +1,109 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; +} + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test new file mode 100644 index 00000000..55adf239 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test @@ -0,0 +1,111 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; +} + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-wr.shader_test new file mode 100644 index 00000000..1be320e5 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-wr.shader_test @@ -0,0 +1,82 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; +} + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-row-wr.shader_test new file mode 100644 index 00000000..3b9ad245 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-row-wr.shader_test @@ -0,0 +1,76 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; +} + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-wr.shader_test new file mode 100644 index 00000000..312db59a --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-wr.shader_test @@ -0,0 +1,65 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat2(0.0); + dst_matrix[1] = mat2(0.0); + dst_matrix[2] = mat2(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; +} + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..41d504ac --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test @@ -0,0 +1,135 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; +} + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-wr.shader_test new file mode 100644 index 00000000..adb4e9fe --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-wr.shader_test @@ -0,0 +1,82 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; +} + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test new file mode 100644 index 00000000..b277be94 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test @@ -0,0 +1,288 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; +} + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 115 20 10 10 +probe rgb 120 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 115 35 10 10 +probe rgb 120 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test new file mode 100644 index 00000000..22a970ad --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test @@ -0,0 +1,133 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; +} + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test new file mode 100644 index 00000000..9c7441f0 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test @@ -0,0 +1,135 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; +} + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-wr.shader_test new file mode 100644 index 00000000..5b539732 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-wr.shader_test @@ -0,0 +1,82 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; +} + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-row-wr.shader_test new file mode 100644 index 00000000..81ad559a --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-row-wr.shader_test @@ -0,0 +1,84 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; +} + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-wr.shader_test new file mode 100644 index 00000000..0e0d1bca --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-wr.shader_test @@ -0,0 +1,65 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat3(0.0); + dst_matrix[1] = mat3(0.0); + dst_matrix[2] = mat3(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; +} + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..425d4267 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test @@ -0,0 +1,192 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; +} + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-wr.shader_test new file mode 100644 index 00000000..7792f823 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-wr.shader_test @@ -0,0 +1,90 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; +} + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test new file mode 100644 index 00000000..da56d002 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test @@ -0,0 +1,459 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; +} + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 145 50 10 10 +probe rgb 150 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 175 20 10 10 +probe rgb 180 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 175 35 10 10 +probe rgb 180 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 175 50 10 10 +probe rgb 180 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 190 20 10 10 +probe rgb 195 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 190 35 10 10 +probe rgb 195 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 190 50 10 10 +probe rgb 195 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test new file mode 100644 index 00000000..7c6d108d --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test @@ -0,0 +1,157 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; +} + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test new file mode 100644 index 00000000..709c6a4a --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test @@ -0,0 +1,159 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; +} + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-wr.shader_test new file mode 100644 index 00000000..57b0708d --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-wr.shader_test @@ -0,0 +1,82 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; +} + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-row-wr.shader_test new file mode 100644 index 00000000..d7741787 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-row-wr.shader_test @@ -0,0 +1,92 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; +} + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-wr.shader_test new file mode 100644 index 00000000..988f7157 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-wr.shader_test @@ -0,0 +1,65 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix[0] = mat4(0.0); + dst_matrix[1] = mat4(0.0); + dst_matrix[2] = mat4(0.0); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; +} + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4 dst_matrix[3]; + +void main() +{ + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..0f607195 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-row-wr.shader_test @@ -0,0 +1,85 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat2 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; +} + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat2 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-wr.shader_test new file mode 100644 index 00000000..f1706ba0 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-wr.shader_test @@ -0,0 +1,65 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; +varying mat2 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; +} + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; +varying mat2 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-row-wr.shader_test new file mode 100644 index 00000000..37791e74 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-row-wr.shader_test @@ -0,0 +1,67 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat2 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; +} + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat2 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-wr.shader_test new file mode 100644 index 00000000..66fad047 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-wr.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; +varying mat2 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; +} + +[fragment shader] +#version 110 +uniform mat2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; +varying mat2 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..b70b3c2c --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-row-wr.shader_test @@ -0,0 +1,126 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat3 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; +} + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat3 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-wr.shader_test new file mode 100644 index 00000000..bc5e3e46 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-wr.shader_test @@ -0,0 +1,73 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; +varying mat3 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; +} + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; +varying mat3 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-row-wr.shader_test new file mode 100644 index 00000000..859d9f33 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-row-wr.shader_test @@ -0,0 +1,75 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat3 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; +} + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat3 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-wr.shader_test new file mode 100644 index 00000000..770fbdc8 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-wr.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; +varying mat3 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; +} + +[fragment shader] +#version 110 +uniform mat3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; +varying mat3 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..97107f9a --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-row-wr.shader_test @@ -0,0 +1,183 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat4 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; +} + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat4 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-wr.shader_test new file mode 100644 index 00000000..edc999ee --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-wr.shader_test @@ -0,0 +1,81 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; +varying mat4 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; +} + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; +varying mat4 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-row-wr.shader_test new file mode 100644 index 00000000..aeca2438 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-row-wr.shader_test @@ -0,0 +1,83 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat4 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; +} + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat4 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-wr.shader_test new file mode 100644 index 00000000..377bf894 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-wr.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.10 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; +varying mat4 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; +} + +[fragment shader] +#version 110 +uniform mat4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; +varying mat4 dst_matrix; + +void main() +{ + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + |