From d1696bb83ff89dfdc7b6aff4c62fd01e767de4e3 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sun, 17 Jul 2011 15:56:57 -0700 Subject: 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. --- .../fs-temp-array-mat2-col-row-wr.shader_test | 81 ++++ .../fs-temp-array-mat2-col-wr.shader_test | 62 +++ ...fs-temp-array-mat2-index-col-row-wr.shader_test | 152 +++++++ .../fs-temp-array-mat2-index-col-wr.shader_test | 97 +++++ .../fs-temp-array-mat2-index-row-wr.shader_test | 98 +++++ .../fs-temp-array-mat2-index-wr.shader_test | 70 +++ .../fs-temp-array-mat2-row-wr.shader_test | 63 +++ .../fs-temp-array-mat2-wr.shader_test | 53 +++ .../fs-temp-array-mat3-col-row-wr.shader_test | 122 ++++++ .../fs-temp-array-mat3-col-wr.shader_test | 70 +++ ...fs-temp-array-mat3-index-col-row-wr.shader_test | 275 ++++++++++++ .../fs-temp-array-mat3-index-col-wr.shader_test | 121 ++++++ .../fs-temp-array-mat3-index-row-wr.shader_test | 122 ++++++ .../fs-temp-array-mat3-index-wr.shader_test | 70 +++ .../fs-temp-array-mat3-row-wr.shader_test | 71 ++++ .../fs-temp-array-mat3-wr.shader_test | 53 +++ .../fs-temp-array-mat4-col-row-wr.shader_test | 179 ++++++++ .../fs-temp-array-mat4-col-wr.shader_test | 78 ++++ ...fs-temp-array-mat4-index-col-row-wr.shader_test | 446 +++++++++++++++++++ .../fs-temp-array-mat4-index-col-wr.shader_test | 145 +++++++ .../fs-temp-array-mat4-index-row-wr.shader_test | 146 +++++++ .../fs-temp-array-mat4-index-wr.shader_test | 70 +++ .../fs-temp-array-mat4-row-wr.shader_test | 79 ++++ .../fs-temp-array-mat4-wr.shader_test | 53 +++ .../fs-temp-mat2-col-row-wr.shader_test | 73 ++++ .../fs-temp-mat2-col-wr.shader_test | 54 +++ .../fs-temp-mat2-row-wr.shader_test | 55 +++ .../variable-indexing/fs-temp-mat2-wr.shader_test | 45 ++ .../fs-temp-mat3-col-row-wr.shader_test | 114 +++++ .../fs-temp-mat3-col-wr.shader_test | 62 +++ .../fs-temp-mat3-row-wr.shader_test | 63 +++ .../variable-indexing/fs-temp-mat3-wr.shader_test | 45 ++ .../fs-temp-mat4-col-row-wr.shader_test | 171 ++++++++ .../fs-temp-mat4-col-wr.shader_test | 70 +++ .../fs-temp-mat4-row-wr.shader_test | 71 ++++ .../variable-indexing/fs-temp-mat4-wr.shader_test | 45 ++ .../vs-temp-array-mat2-col-row-wr.shader_test | 83 ++++ .../vs-temp-array-mat2-col-wr.shader_test | 64 +++ ...vs-temp-array-mat2-index-col-row-wr.shader_test | 154 +++++++ .../vs-temp-array-mat2-index-col-wr.shader_test | 99 +++++ .../vs-temp-array-mat2-index-row-wr.shader_test | 100 +++++ .../vs-temp-array-mat2-index-wr.shader_test | 72 ++++ .../vs-temp-array-mat2-row-wr.shader_test | 65 +++ .../vs-temp-array-mat2-wr.shader_test | 55 +++ .../vs-temp-array-mat3-col-row-wr.shader_test | 124 ++++++ .../vs-temp-array-mat3-col-wr.shader_test | 72 ++++ ...vs-temp-array-mat3-index-col-row-wr.shader_test | 277 ++++++++++++ .../vs-temp-array-mat3-index-col-wr.shader_test | 123 ++++++ .../vs-temp-array-mat3-index-row-wr.shader_test | 124 ++++++ .../vs-temp-array-mat3-index-wr.shader_test | 72 ++++ .../vs-temp-array-mat3-row-wr.shader_test | 73 ++++ .../vs-temp-array-mat3-wr.shader_test | 55 +++ .../vs-temp-array-mat4-col-row-wr.shader_test | 181 ++++++++ .../vs-temp-array-mat4-col-wr.shader_test | 80 ++++ ...vs-temp-array-mat4-index-col-row-wr.shader_test | 448 ++++++++++++++++++++ .../vs-temp-array-mat4-index-col-wr.shader_test | 147 +++++++ .../vs-temp-array-mat4-index-row-wr.shader_test | 148 +++++++ .../vs-temp-array-mat4-index-wr.shader_test | 72 ++++ .../vs-temp-array-mat4-row-wr.shader_test | 81 ++++ .../vs-temp-array-mat4-wr.shader_test | 55 +++ .../vs-temp-mat2-col-row-wr.shader_test | 75 ++++ .../vs-temp-mat2-col-wr.shader_test | 56 +++ .../vs-temp-mat2-row-wr.shader_test | 57 +++ .../variable-indexing/vs-temp-mat2-wr.shader_test | 47 ++ .../vs-temp-mat3-col-row-wr.shader_test | 116 +++++ .../vs-temp-mat3-col-wr.shader_test | 64 +++ .../vs-temp-mat3-row-wr.shader_test | 65 +++ .../variable-indexing/vs-temp-mat3-wr.shader_test | 47 ++ .../vs-temp-mat4-col-row-wr.shader_test | 173 ++++++++ .../vs-temp-mat4-col-wr.shader_test | 72 ++++ .../vs-temp-mat4-row-wr.shader_test | 73 ++++ .../variable-indexing/vs-temp-mat4-wr.shader_test | 47 ++ .../vs-varying-array-mat2-col-row-wr.shader_test | 94 ++++ .../vs-varying-array-mat2-col-wr.shader_test | 74 ++++ ...varying-array-mat2-index-col-row-wr.shader_test | 165 ++++++++ .../vs-varying-array-mat2-index-col-wr.shader_test | 109 +++++ .../vs-varying-array-mat2-index-row-wr.shader_test | 111 +++++ .../vs-varying-array-mat2-index-wr.shader_test | 82 ++++ .../vs-varying-array-mat2-row-wr.shader_test | 76 ++++ .../vs-varying-array-mat2-wr.shader_test | 65 +++ .../vs-varying-array-mat3-col-row-wr.shader_test | 135 ++++++ .../vs-varying-array-mat3-col-wr.shader_test | 82 ++++ ...varying-array-mat3-index-col-row-wr.shader_test | 288 +++++++++++++ .../vs-varying-array-mat3-index-col-wr.shader_test | 133 ++++++ .../vs-varying-array-mat3-index-row-wr.shader_test | 135 ++++++ .../vs-varying-array-mat3-index-wr.shader_test | 82 ++++ .../vs-varying-array-mat3-row-wr.shader_test | 84 ++++ .../vs-varying-array-mat3-wr.shader_test | 65 +++ .../vs-varying-array-mat4-col-row-wr.shader_test | 192 +++++++++ .../vs-varying-array-mat4-col-wr.shader_test | 90 ++++ ...varying-array-mat4-index-col-row-wr.shader_test | 459 ++++++++++++++++++++ .../vs-varying-array-mat4-index-col-wr.shader_test | 157 +++++++ .../vs-varying-array-mat4-index-row-wr.shader_test | 159 +++++++ .../vs-varying-array-mat4-index-wr.shader_test | 82 ++++ .../vs-varying-array-mat4-row-wr.shader_test | 92 ++++ .../vs-varying-array-mat4-wr.shader_test | 65 +++ .../vs-varying-mat2-col-row-wr.shader_test | 85 ++++ .../vs-varying-mat2-col-wr.shader_test | 65 +++ .../vs-varying-mat2-row-wr.shader_test | 67 +++ .../vs-varying-mat2-wr.shader_test | 56 +++ .../vs-varying-mat3-col-row-wr.shader_test | 126 ++++++ .../vs-varying-mat3-col-wr.shader_test | 73 ++++ .../vs-varying-mat3-row-wr.shader_test | 75 ++++ .../vs-varying-mat3-wr.shader_test | 56 +++ .../vs-varying-mat4-col-row-wr.shader_test | 183 ++++++++ .../vs-varying-mat4-col-wr.shader_test | 81 ++++ .../vs-varying-mat4-row-wr.shader_test | 83 ++++ .../vs-varying-mat4-wr.shader_test | 56 +++ tests/spec/glsl-1.10/variable-index-write.sh | 471 +++++++++++++++++++++ .../fs-temp-array-mat2-col-row-wr.shader_test | 78 ++++ .../fs-temp-array-mat2-col-wr.shader_test | 59 +++ ...fs-temp-array-mat2-index-col-row-wr.shader_test | 149 +++++++ .../fs-temp-array-mat2-index-col-wr.shader_test | 94 ++++ .../fs-temp-array-mat2-index-row-wr.shader_test | 95 +++++ .../fs-temp-array-mat2-index-wr.shader_test | 67 +++ .../fs-temp-array-mat2-row-wr.shader_test | 60 +++ .../fs-temp-array-mat2-wr.shader_test | 50 +++ .../fs-temp-array-mat3-col-row-wr.shader_test | 119 ++++++ .../fs-temp-array-mat3-col-wr.shader_test | 67 +++ ...fs-temp-array-mat3-index-col-row-wr.shader_test | 272 ++++++++++++ .../fs-temp-array-mat3-index-col-wr.shader_test | 118 ++++++ .../fs-temp-array-mat3-index-row-wr.shader_test | 119 ++++++ .../fs-temp-array-mat3-index-wr.shader_test | 67 +++ .../fs-temp-array-mat3-row-wr.shader_test | 68 +++ .../fs-temp-array-mat3-wr.shader_test | 50 +++ .../fs-temp-array-mat4-col-row-wr.shader_test | 176 ++++++++ .../fs-temp-array-mat4-col-wr.shader_test | 75 ++++ ...fs-temp-array-mat4-index-col-row-wr.shader_test | 443 +++++++++++++++++++ .../fs-temp-array-mat4-index-col-wr.shader_test | 142 +++++++ .../fs-temp-array-mat4-index-row-wr.shader_test | 143 +++++++ .../fs-temp-array-mat4-index-wr.shader_test | 67 +++ .../fs-temp-array-mat4-row-wr.shader_test | 76 ++++ .../fs-temp-array-mat4-wr.shader_test | 50 +++ .../fs-temp-mat2-col-row-wr.shader_test | 73 ++++ .../fs-temp-mat2-col-wr.shader_test | 54 +++ .../fs-temp-mat2-row-wr.shader_test | 55 +++ .../variable-indexing/fs-temp-mat2-wr.shader_test | 45 ++ .../fs-temp-mat3-col-row-wr.shader_test | 114 +++++ .../fs-temp-mat3-col-wr.shader_test | 62 +++ .../fs-temp-mat3-row-wr.shader_test | 63 +++ .../variable-indexing/fs-temp-mat3-wr.shader_test | 45 ++ .../fs-temp-mat4-col-row-wr.shader_test | 171 ++++++++ .../fs-temp-mat4-col-wr.shader_test | 70 +++ .../fs-temp-mat4-row-wr.shader_test | 71 ++++ .../variable-indexing/fs-temp-mat4-wr.shader_test | 45 ++ .../vs-temp-array-mat2-col-row-wr.shader_test | 80 ++++ .../vs-temp-array-mat2-col-wr.shader_test | 61 +++ ...vs-temp-array-mat2-index-col-row-wr.shader_test | 151 +++++++ .../vs-temp-array-mat2-index-col-wr.shader_test | 96 +++++ .../vs-temp-array-mat2-index-row-wr.shader_test | 97 +++++ .../vs-temp-array-mat2-index-wr.shader_test | 69 +++ .../vs-temp-array-mat2-row-wr.shader_test | 62 +++ .../vs-temp-array-mat2-wr.shader_test | 52 +++ .../vs-temp-array-mat3-col-row-wr.shader_test | 121 ++++++ .../vs-temp-array-mat3-col-wr.shader_test | 69 +++ ...vs-temp-array-mat3-index-col-row-wr.shader_test | 274 ++++++++++++ .../vs-temp-array-mat3-index-col-wr.shader_test | 120 ++++++ .../vs-temp-array-mat3-index-row-wr.shader_test | 121 ++++++ .../vs-temp-array-mat3-index-wr.shader_test | 69 +++ .../vs-temp-array-mat3-row-wr.shader_test | 70 +++ .../vs-temp-array-mat3-wr.shader_test | 52 +++ .../vs-temp-array-mat4-col-row-wr.shader_test | 178 ++++++++ .../vs-temp-array-mat4-col-wr.shader_test | 77 ++++ ...vs-temp-array-mat4-index-col-row-wr.shader_test | 445 +++++++++++++++++++ .../vs-temp-array-mat4-index-col-wr.shader_test | 144 +++++++ .../vs-temp-array-mat4-index-row-wr.shader_test | 145 +++++++ .../vs-temp-array-mat4-index-wr.shader_test | 69 +++ .../vs-temp-array-mat4-row-wr.shader_test | 78 ++++ .../vs-temp-array-mat4-wr.shader_test | 52 +++ .../vs-temp-mat2-col-row-wr.shader_test | 75 ++++ .../vs-temp-mat2-col-wr.shader_test | 56 +++ .../vs-temp-mat2-row-wr.shader_test | 57 +++ .../variable-indexing/vs-temp-mat2-wr.shader_test | 47 ++ .../vs-temp-mat3-col-row-wr.shader_test | 116 +++++ .../vs-temp-mat3-col-wr.shader_test | 64 +++ .../vs-temp-mat3-row-wr.shader_test | 65 +++ .../variable-indexing/vs-temp-mat3-wr.shader_test | 47 ++ .../vs-temp-mat4-col-row-wr.shader_test | 173 ++++++++ .../vs-temp-mat4-col-wr.shader_test | 72 ++++ .../vs-temp-mat4-row-wr.shader_test | 73 ++++ .../variable-indexing/vs-temp-mat4-wr.shader_test | 47 ++ .../vs-varying-array-mat2-col-row-wr.shader_test | 92 ++++ .../vs-varying-array-mat2-col-wr.shader_test | 72 ++++ ...varying-array-mat2-index-col-row-wr.shader_test | 163 +++++++ .../vs-varying-array-mat2-index-col-wr.shader_test | 107 +++++ .../vs-varying-array-mat2-index-row-wr.shader_test | 109 +++++ .../vs-varying-array-mat2-index-wr.shader_test | 80 ++++ .../vs-varying-array-mat2-row-wr.shader_test | 74 ++++ .../vs-varying-array-mat2-wr.shader_test | 63 +++ .../vs-varying-array-mat3-col-row-wr.shader_test | 133 ++++++ .../vs-varying-array-mat3-col-wr.shader_test | 80 ++++ ...varying-array-mat3-index-col-row-wr.shader_test | 286 +++++++++++++ .../vs-varying-array-mat3-index-col-wr.shader_test | 131 ++++++ .../vs-varying-array-mat3-index-row-wr.shader_test | 133 ++++++ .../vs-varying-array-mat3-index-wr.shader_test | 80 ++++ .../vs-varying-array-mat3-row-wr.shader_test | 82 ++++ .../vs-varying-array-mat3-wr.shader_test | 63 +++ .../vs-varying-array-mat4-col-row-wr.shader_test | 190 +++++++++ .../vs-varying-array-mat4-col-wr.shader_test | 88 ++++ ...varying-array-mat4-index-col-row-wr.shader_test | 457 ++++++++++++++++++++ .../vs-varying-array-mat4-index-col-wr.shader_test | 155 +++++++ .../vs-varying-array-mat4-index-row-wr.shader_test | 157 +++++++ .../vs-varying-array-mat4-index-wr.shader_test | 80 ++++ .../vs-varying-array-mat4-row-wr.shader_test | 90 ++++ .../vs-varying-array-mat4-wr.shader_test | 63 +++ .../vs-varying-mat2-col-row-wr.shader_test | 85 ++++ .../vs-varying-mat2-col-wr.shader_test | 65 +++ .../vs-varying-mat2-row-wr.shader_test | 67 +++ .../vs-varying-mat2-wr.shader_test | 56 +++ .../vs-varying-mat3-col-row-wr.shader_test | 126 ++++++ .../vs-varying-mat3-col-wr.shader_test | 73 ++++ .../vs-varying-mat3-row-wr.shader_test | 75 ++++ .../vs-varying-mat3-wr.shader_test | 56 +++ .../vs-varying-mat4-col-row-wr.shader_test | 183 ++++++++ .../vs-varying-mat4-col-wr.shader_test | 81 ++++ .../vs-varying-mat4-row-wr.shader_test | 83 ++++ .../vs-varying-mat4-wr.shader_test | 56 +++ 217 files changed, 23163 insertions(+) create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-row-wr.shader_test create mode 100644 tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-wr.shader_test create mode 100755 tests/spec/glsl-1.10/variable-index-write.sh create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-col-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-col-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-row-wr.shader_test create mode 100644 tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-wr.shader_test 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 + diff --git a/tests/spec/glsl-1.10/variable-index-write.sh b/tests/spec/glsl-1.10/variable-index-write.sh new file mode 100755 index 00000000..c7b29708 --- /dev/null +++ b/tests/spec/glsl-1.10/variable-index-write.sh @@ -0,0 +1,471 @@ +#!/bin/sh + +# Emit global variable declarations for either the vertex shader or the +# fragment shader. +function emit_globals +{ + matrix_dim=$1 + array_dim=$2 + mode=$3 + index_value=$4 + col="[$5]" + value_type=$6 + + v=${version/./} + if [ $v -ge 120 ]; then + base_type="mat${matrix_dim}x${matrix_dim}" + else + base_type="mat${matrix_dim}" + fi + + type=$base_type + dim="" + if [ $array_dim -ne 0 ]; then + if [ $v -ge 120 ]; then + type="${type}[$array_dim]" + else + dim="[${array_dim}]" + fi + fi + + echo "uniform ${base_type} src_matrix;" + echo "uniform vec${matrix_dim} v;" + echo "uniform vec${matrix_dim} expect;" + + if [ $array_dim -ne 0 ]; then + echo "uniform int index;" + fi + + if [ "x$value_type" = "xfloat" ]; then + echo "uniform int row;" + fi + + echo "uniform int col;" + echo "uniform ${value_type} value;" + + if [ "x$mode" = "xvarying" ]; then + echo "varying ${type} dst_matrix${dim};" + fi + echo +} + + +function emit_set_matrix +{ + matrix_dim=$1 + array_dim=$2 + mode=$3 + index_value=$4 + col="[$5]" + value_type=$6 + + v=${version/./} + if [ $v -ge 120 ]; then + base_type="mat${matrix_dim}x${matrix_dim}" + else + base_type="mat${matrix_dim}" + fi + + type=$base_type + dim="" + if [ $array_dim -ne 0 ]; then + if [ $v -ge 120 ]; then + type="${type}[$array_dim]" + else + dim="[${array_dim}]" + fi + fi + + if [ "x$mode" = "xtemp" ]; then + echo -n " ${type} dst_matrix${dim}" + lhs="" + else + lhs=" dst_matrix" + fi + + if [ $array_dim -ne 0 ]; then + if [ $v -ge 120 ]; then + echo -n "${lhs} = ${type}(" + for i in $(seq $array_dim); do + if [ $i -ne 1 ]; then + echo -n ", " + fi + echo -n "${base_type}(0.0)" + done + echo ");" + else + if [ "x$mode" = "xtemp" ]; then + echo ";" + fi + + for i in $(seq 0 $((array_dim - 1))); do + echo " dst_matrix[$i] = ${base_type}(0.0);" + done + fi + elif [ "x$mode" = "xtemp" ]; then + echo ";" + fi + + echo +} + + +function emit_transform +{ + matrix_dim=$1 + array_dim=$2 + mode=$3 + index_value=$4 + col="[$5]" + value_type=$6 + + if [ "x$value_type" = "xfloat" ]; then + row="[row]" + else + row="" + fi + + cat <= 1.10" + echo + + echo "[vertex shader]" + echo "#version ${version/./}" + echo "void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }" + echo + + emit_fs $* + emit_test_vectors $* +} + + +function emit_vs_wr_test +{ + matrix_dim=$1 + array_dim=$2 + mode=$3 + + echo "# Test generated by:" + echo "# ${cmd}" + echo + echo "[require]" + echo "GLSL >= ${version}" + echo + + echo "[vertex shader]" + echo "#version ${version/./}" + emit_globals $* + + echo "void main()" + echo "{" + echo " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;" + echo + + emit_set_matrix $* + emit_transform $* + + if [ "x$mode" != "xvarying" ] ; then + echo " gl_FrontColor = (distance(dst_matrix${idx} * v, expect) < 1e-6)" + echo " ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);" + fi + + echo "}" + echo + + if [ "x$mode" != "xvarying" ];then + echo "[fragment shader]" + echo "#version ${version/./}" + echo "void main() { gl_FragColor = gl_Color; }" + echo + else + emit_fs $* + fi + + emit_test_vectors $* +} + + +cmd="$0 $*" + +if [ "x$1" = "x" ]; then + version="1.10" +else + case "$1" in + 1.[12]0) version="$1";; + *) + echo "Bogus GLSL version \"$1\" specified." + exit 1 + ;; + esac +fi + +for mode in temp varying; do + # More than 3 is unlikely to work for the varying tests due to using too + # many varying vectors. mat4[3] uses 12 varying vectors by itself. + for array_dim in 0 3; do + if [ $array_dim -ne 0 ]; then + arr="array-" + idx_txt="index-" + else + arr="" + idx_txt="" + fi + + for matrix_dim in 2 3 4; do + # Fragment shaders cannot write varyings + if [ "x$mode" != "xvarying" ]; then + emit_fs_wr_test $matrix_dim $array_dim $mode index col float \ + > fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-row-wr.shader_test + + emit_fs_wr_test $matrix_dim $array_dim $mode index 1 float \ + > fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}row-wr.shader_test + + emit_fs_wr_test $matrix_dim $array_dim $mode index col vec${matrix_dim} \ + > fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-wr.shader_test + + emit_fs_wr_test $matrix_dim $array_dim $mode index 1 vec${matrix_dim} \ + > fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}wr.shader_test + + if [ $array_dim -ne 0 ]; then + emit_fs_wr_test $matrix_dim $array_dim $mode 1 col float \ + > fs-${mode}-${arr}mat${matrix_dim}-col-row-wr.shader_test + + emit_fs_wr_test $matrix_dim $array_dim $mode 1 1 float \ + > fs-${mode}-${arr}mat${matrix_dim}-row-wr.shader_test + + emit_fs_wr_test $matrix_dim $array_dim $mode 1 col vec${matrix_dim} \ + > fs-${mode}-${arr}mat${matrix_dim}-col-wr.shader_test + + emit_fs_wr_test $matrix_dim $array_dim $mode 1 1 vec${matrix_dim} \ + > fs-${mode}-${arr}mat${matrix_dim}-wr.shader_test + fi + fi + + emit_vs_wr_test $matrix_dim $array_dim $mode index col float \ + > vs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-row-wr.shader_test + + emit_vs_wr_test $matrix_dim $array_dim $mode index 1 float \ + > vs-${mode}-${arr}mat${matrix_dim}-${idx_txt}row-wr.shader_test + + emit_vs_wr_test $matrix_dim $array_dim $mode index col vec${matrix_dim} \ + > vs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-wr.shader_test + + emit_vs_wr_test $matrix_dim $array_dim $mode index 1 vec${matrix_dim} \ + > vs-${mode}-${arr}mat${matrix_dim}-${idx_txt}wr.shader_test + + if [ $array_dim -ne 0 ]; then + emit_vs_wr_test $matrix_dim $array_dim $mode 1 col float \ + > vs-${mode}-${arr}mat${matrix_dim}-col-row-wr.shader_test + + emit_vs_wr_test $matrix_dim $array_dim $mode 1 1 float \ + > vs-${mode}-${arr}mat${matrix_dim}-row-wr.shader_test + + emit_vs_wr_test $matrix_dim $array_dim $mode 1 col vec${matrix_dim} \ + > vs-${mode}-${arr}mat${matrix_dim}-col-wr.shader_test + + emit_vs_wr_test $matrix_dim $array_dim $mode 1 1 vec${matrix_dim} \ + > vs-${mode}-${arr}mat${matrix_dim}-wr.shader_test + fi + done + done +done diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..43edb932 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test @@ -0,0 +1,78 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-col-wr.shader_test new file mode 100644 index 00000000..4c8014f3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-col-wr.shader_test @@ -0,0 +1,59 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test new file mode 100644 index 00000000..30da6b36 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test @@ -0,0 +1,149 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 85 20 10 10 +probe rgb 90 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test new file mode 100644 index 00000000..edc20f53 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test @@ -0,0 +1,94 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test new file mode 100644 index 00000000..62c891b9 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test @@ -0,0 +1,95 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-wr.shader_test new file mode 100644 index 00000000..fd1a60ca --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-wr.shader_test @@ -0,0 +1,67 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-row-wr.shader_test new file mode 100644 index 00000000..42b00917 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-row-wr.shader_test @@ -0,0 +1,60 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-wr.shader_test new file mode 100644 index 00000000..63a2453e --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-wr.shader_test @@ -0,0 +1,50 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..34e64811 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test @@ -0,0 +1,119 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-col-wr.shader_test new file mode 100644 index 00000000..c3e26507 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-col-wr.shader_test @@ -0,0 +1,67 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test new file mode 100644 index 00000000..7242afb9 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test @@ -0,0 +1,272 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 115 20 10 10 +probe rgb 120 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 115 35 10 10 +probe rgb 120 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test new file mode 100644 index 00000000..5d87de72 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test @@ -0,0 +1,118 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test new file mode 100644 index 00000000..01719e2e --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test @@ -0,0 +1,119 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-wr.shader_test new file mode 100644 index 00000000..c8a11d5f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-wr.shader_test @@ -0,0 +1,67 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-row-wr.shader_test new file mode 100644 index 00000000..49ee3f66 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-row-wr.shader_test @@ -0,0 +1,68 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-wr.shader_test new file mode 100644 index 00000000..e5dbae78 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-wr.shader_test @@ -0,0 +1,50 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..9c4c279c --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test @@ -0,0 +1,176 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-col-wr.shader_test new file mode 100644 index 00000000..eeb4d8cd --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-col-wr.shader_test @@ -0,0 +1,75 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test new file mode 100644 index 00000000..c4e3007d --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test @@ -0,0 +1,443 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 145 50 10 10 +probe rgb 150 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 175 20 10 10 +probe rgb 180 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 175 35 10 10 +probe rgb 180 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 175 50 10 10 +probe rgb 180 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 190 20 10 10 +probe rgb 195 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 190 35 10 10 +probe rgb 195 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 190 50 10 10 +probe rgb 195 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test new file mode 100644 index 00000000..79ac9f1f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test @@ -0,0 +1,142 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test new file mode 100644 index 00000000..4c307aa2 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test @@ -0,0 +1,143 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-wr.shader_test new file mode 100644 index 00000000..53e989e4 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-wr.shader_test @@ -0,0 +1,67 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-row-wr.shader_test new file mode 100644 index 00000000..64aafa7f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-row-wr.shader_test @@ -0,0 +1,76 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-wr.shader_test new file mode 100644 index 00000000..37fdb3c3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-wr.shader_test @@ -0,0 +1,50 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..3c325c9d --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-col-wr.shader_test new file mode 100644 index 00000000..8f76813d --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-row-wr.shader_test new file mode 100644 index 00000000..19e45cbc --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-wr.shader_test new file mode 100644 index 00000000..c8c8cba6 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-wr.shader_test @@ -0,0 +1,45 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; + +void main() +{ + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..1ce20536 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-col-wr.shader_test new file mode 100644 index 00000000..ac3aa671 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-row-wr.shader_test new file mode 100644 index 00000000..b0933cbb --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-wr.shader_test new file mode 100644 index 00000000..e3feddb6 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-wr.shader_test @@ -0,0 +1,45 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; + +void main() +{ + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..457b6218 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-col-wr.shader_test new file mode 100644 index 00000000..b4dc82a6 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-row-wr.shader_test new file mode 100644 index 00000000..6e996521 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-wr.shader_test new file mode 100644 index 00000000..7daa4be8 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-wr.shader_test @@ -0,0 +1,45 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; + +void main() +{ + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..ca6e905e --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test @@ -0,0 +1,80 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-col-wr.shader_test new file mode 100644 index 00000000..d997b916 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-col-wr.shader_test @@ -0,0 +1,61 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test new file mode 100644 index 00000000..b4e36d7d --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test @@ -0,0 +1,151 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 45 20 10 10 +probe rgb 50 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 85 20 10 10 +probe rgb 90 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test new file mode 100644 index 00000000..6798626b --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test @@ -0,0 +1,96 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 45 5 10 10 +probe rgb 50 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 85 5 10 10 +probe rgb 90 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test new file mode 100644 index 00000000..cded995d --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test @@ -0,0 +1,97 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 100 20 10 10 +probe rgb 105 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-wr.shader_test new file mode 100644 index 00000000..d26aae34 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-wr.shader_test @@ -0,0 +1,69 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 100 5 10 10 +probe rgb 105 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-row-wr.shader_test new file mode 100644 index 00000000..923e538f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-row-wr.shader_test @@ -0,0 +1,62 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-wr.shader_test new file mode 100644 index 00000000..7688deba --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-wr.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2[3] dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..fe77f7e5 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test @@ -0,0 +1,121 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-col-wr.shader_test new file mode 100644 index 00000000..1f74a466 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-col-wr.shader_test @@ -0,0 +1,69 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test new file mode 100644 index 00000000..5bbc7bdd --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test @@ -0,0 +1,274 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 60 20 10 10 +probe rgb 65 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 60 35 10 10 +probe rgb 65 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 115 20 10 10 +probe rgb 120 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 115 35 10 10 +probe rgb 120 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test new file mode 100644 index 00000000..1215412f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test @@ -0,0 +1,120 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 60 5 10 10 +probe rgb 65 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 115 5 10 10 +probe rgb 120 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test new file mode 100644 index 00000000..b808fd05 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test @@ -0,0 +1,121 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 130 20 10 10 +probe rgb 135 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 130 35 10 10 +probe rgb 135 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-wr.shader_test new file mode 100644 index 00000000..d1896351 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-wr.shader_test @@ -0,0 +1,69 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 130 5 10 10 +probe rgb 135 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-row-wr.shader_test new file mode 100644 index 00000000..80cf5c7f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-row-wr.shader_test @@ -0,0 +1,70 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-wr.shader_test new file mode 100644 index 00000000..3ac61ed5 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-wr.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3[3] dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..04985b6a --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test @@ -0,0 +1,178 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-col-wr.shader_test new file mode 100644 index 00000000..8b8c32c6 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-col-wr.shader_test @@ -0,0 +1,77 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test new file mode 100644 index 00000000..0f8cc45e --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test @@ -0,0 +1,445 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 75 20 10 10 +probe rgb 80 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 75 35 10 10 +probe rgb 80 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 75 50 10 10 +probe rgb 80 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 105 20 10 10 +probe rgb 110 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 105 35 10 10 +probe rgb 110 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 105 50 10 10 +probe rgb 110 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 120 20 10 10 +probe rgb 125 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 120 35 10 10 +probe rgb 125 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 120 50 10 10 +probe rgb 125 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 145 20 10 10 +probe rgb 150 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 145 35 10 10 +probe rgb 150 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 145 50 10 10 +probe rgb 150 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 175 20 10 10 +probe rgb 180 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 175 35 10 10 +probe rgb 180 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 175 50 10 10 +probe rgb 180 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 190 20 10 10 +probe rgb 195 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 190 35 10 10 +probe rgb 195 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 190 50 10 10 +probe rgb 195 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test new file mode 100644 index 00000000..c4e3b3c2 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test @@ -0,0 +1,144 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int index 1 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 75 5 10 10 +probe rgb 80 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 105 5 10 10 +probe rgb 110 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 120 5 10 10 +probe rgb 125 10 0.0 1.0 0.0 + +uniform int index 2 +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 145 5 10 10 +probe rgb 150 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 175 5 10 10 +probe rgb 180 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 190 5 10 10 +probe rgb 195 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test new file mode 100644 index 00000000..8322c9ac --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test @@ -0,0 +1,145 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int index 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + +uniform int index 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 160 20 10 10 +probe rgb 165 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 160 35 10 10 +probe rgb 165 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 160 50 10 10 +probe rgb 165 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-wr.shader_test new file mode 100644 index 00000000..1b9d5d24 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-wr.shader_test @@ -0,0 +1,69 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; + gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int index 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int index 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int index 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 160 5 10 10 +probe rgb 165 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-row-wr.shader_test new file mode 100644 index 00000000..5d461ff1 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-row-wr.shader_test @@ -0,0 +1,78 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 90 20 10 10 +probe rgb 95 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 90 35 10 10 +probe rgb 95 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 90 50 10 10 +probe rgb 95 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-wr.shader_test new file mode 100644 index 00000000..61c109de --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-wr.shader_test @@ -0,0 +1,52 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4[3] dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; + gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 90 5 10 10 +probe rgb 95 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..8c130350 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180 +uniform float value 0.241498998195656 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180 +uniform float value 0.861223395812970 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-col-wr.shader_test new file mode 100644 index 00000000..7c8215b8 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180 +uniform vec2 value 0.241498998195656 0.861223395812970 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-row-wr.shader_test new file mode 100644 index 00000000..ba47207b --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180 +uniform float value 0.603473877011433 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0 +uniform float value 0.891622340451180 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-wr.shader_test new file mode 100644 index 00000000..705e0c4d --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-wr.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat2x2 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec2 v 0.803161418975390 0.852987140792140 +uniform vec2 expect 0.708718134966688 1.452243795483797 +uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0 +uniform vec2 value 0.603473877011433 0.891622340451180 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..6e35f4e1 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.493944462129466 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.722190133917966 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.239853948232558 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504 +uniform float value 0.850846377186973 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504 +uniform float value 0.511303112962423 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0 +uniform float value 0.270815003356504 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-col-wr.shader_test new file mode 100644 index 00000000..7383b5a4 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0 +uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-row-wr.shader_test new file mode 100644 index 00000000..b8572582 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.550143078409278 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.591962645398579 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform float value 0.467616286531193 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-wr.shader_test new file mode 100644 index 00000000..d5249de0 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-wr.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat3x3 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237 +uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868 +uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504 +uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..18d5e3d9 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.922040144261674 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.158053783109488 +draw rect 5 20 10 10 +probe rgb 10 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.357016429866574 +draw rect 5 35 10 10 +probe rgb 10 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.836368810383957 +draw rect 5 50 10 10 +probe rgb 10 55 0.0 1.0 0.0 + +uniform int col 1 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + +uniform int col 2 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.350720358904176 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.912192627475775 +draw rect 35 20 10 10 +probe rgb 40 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.688544081259531 +draw rect 35 35 10 10 +probe rgb 40 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.913891056231967 +draw rect 35 50 10 10 +probe rgb 40 55 0.0 1.0 0.0 + +uniform int col 3 +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.442058176039301 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782 +uniform float value 0.829835836794679 +draw rect 50 20 10 10 +probe rgb 55 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782 +uniform float value 0.365674411003021 +draw rect 50 35 10 10 +probe rgb 55 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0 +uniform float value 0.879197364462782 +draw rect 50 50 10 10 +probe rgb 55 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-col-wr.shader_test new file mode 100644 index 00000000..e97be85c --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int col 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 +draw rect 5 5 10 10 +probe rgb 10 10 0.0 1.0 0.0 + +uniform int col 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int col 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 +draw rect 35 5 10 10 +probe rgb 40 10 0.0 1.0 0.0 + +uniform int col 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0 +uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +draw rect 50 5 10 10 +probe rgb 55 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-row-wr.shader_test new file mode 100644 index 00000000..16005f8a --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform int row 0 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.560251913703792 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + +uniform int row 1 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.171634921595771 +draw rect 20 20 10 10 +probe rgb 25 25 0.0 1.0 0.0 + +uniform int row 2 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.602494709909111 +draw rect 20 35 10 10 +probe rgb 25 40 0.0 1.0 0.0 + +uniform int row 3 +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform float value 0.693273570571311 +draw rect 20 50 10 10 +probe rgb 25 55 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-wr.shader_test new file mode 100644 index 00000000..1a12b77d --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-wr.shader_test @@ -0,0 +1,47 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4x4 dst_matrix; + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; + gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6) + ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 120 +void main() { gl_FragColor = gl_Color; } + +[test] +clear color 0.5 0.5 0.5 0.5 +clear +ortho + +uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839 +uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820 +uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782 +uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 +draw rect 20 5 10 10 +probe rgb 25 10 0.0 1.0 0.0 + diff --git a/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..238301aa --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test @@ -0,0 +1,92 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; +} + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat2-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-col-wr.shader_test new file mode 100644 index 00000000..9f8af3fc --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-col-wr.shader_test @@ -0,0 +1,72 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; +} + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test new file mode 100644 index 00000000..f80a2f14 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test @@ -0,0 +1,163 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; +} + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test new file mode 100644 index 00000000..760334c0 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test @@ -0,0 +1,107 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; +} + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test new file mode 100644 index 00000000..b5672aa1 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test @@ -0,0 +1,109 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; +} + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat2-index-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-wr.shader_test new file mode 100644 index 00000000..a11fdadc --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-wr.shader_test @@ -0,0 +1,80 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; +} + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat2-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-row-wr.shader_test new file mode 100644 index 00000000..0960afb7 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-row-wr.shader_test @@ -0,0 +1,74 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; +} + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat2-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-wr.shader_test new file mode 100644 index 00000000..7f78d727 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-wr.shader_test @@ -0,0 +1,63 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat2x2[3](mat2x2(0.0), mat2x2(0.0), mat2x2(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; +} + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int index; +uniform int col; +uniform vec2 value; +varying mat2x2[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..368072e2 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test @@ -0,0 +1,133 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; +} + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat3-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-col-wr.shader_test new file mode 100644 index 00000000..662cc059 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-col-wr.shader_test @@ -0,0 +1,80 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; +} + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test new file mode 100644 index 00000000..93d6daac --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test @@ -0,0 +1,286 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; +} + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test new file mode 100644 index 00000000..6d0f0179 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test @@ -0,0 +1,131 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; +} + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test new file mode 100644 index 00000000..a2bfd3b3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test @@ -0,0 +1,133 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; +} + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat3-index-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-wr.shader_test new file mode 100644 index 00000000..8053a3f1 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-wr.shader_test @@ -0,0 +1,80 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; +} + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat3-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-row-wr.shader_test new file mode 100644 index 00000000..e03fb02f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-row-wr.shader_test @@ -0,0 +1,82 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; +} + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat3-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-wr.shader_test new file mode 100644 index 00000000..2533b078 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-wr.shader_test @@ -0,0 +1,63 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat3x3[3](mat3x3(0.0), mat3x3(0.0), mat3x3(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; +} + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int index; +uniform int col; +uniform vec3 value; +varying mat3x3[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..a66680fc --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test @@ -0,0 +1,190 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col][row] = value; +} + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat4-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-col-wr.shader_test new file mode 100644 index 00000000..97bc778f --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-col-wr.shader_test @@ -0,0 +1,88 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][col] = value; +} + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test new file mode 100644 index 00000000..886b8d19 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test @@ -0,0 +1,457 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col][row] = value; +} + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test new file mode 100644 index 00000000..aed292a7 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test @@ -0,0 +1,155 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][col] = value; +} + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test new file mode 100644 index 00000000..e55473f4 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test @@ -0,0 +1,157 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1][row] = value; +} + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat4-index-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-wr.shader_test new file mode 100644 index 00000000..488ff4ba --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-wr.shader_test @@ -0,0 +1,80 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[index] = src_matrix; + dst_matrix[index][1] = value; +} + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat4-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-row-wr.shader_test new file mode 100644 index 00000000..13d1b0bb --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-row-wr.shader_test @@ -0,0 +1,90 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1][row] = value; +} + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-array-mat4-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-wr.shader_test new file mode 100644 index 00000000..7481a6e4 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-wr.shader_test @@ -0,0 +1,63 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + dst_matrix = mat4x4[3](mat4x4(0.0), mat4x4(0.0), mat4x4(0.0)); + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + * + * NOTE: This test assumes that reads of arrays using non-constant + * indicies works correctly. If reads and writes happen to fail in an + * identical manner, this test may give false positives. + */ + dst_matrix[1] = src_matrix; + dst_matrix[1][1] = value; +} + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int index; +uniform int col; +uniform vec4 value; +varying mat4x4[3] dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-col-row-wr.shader_test new file mode 100644 index 00000000..f72dd3cb --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; +} + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-mat2-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-col-wr.shader_test new file mode 100644 index 00000000..67715e01 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; +} + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-mat2-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-row-wr.shader_test new file mode 100644 index 00000000..e1b744c9 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; +} + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-mat2-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-wr.shader_test new file mode 100644 index 00000000..1cf54d62 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-wr.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; +} + +[fragment shader] +#version 120 +uniform mat2x2 src_matrix; +uniform vec2 v; +uniform vec2 expect; +uniform int col; +uniform vec2 value; +varying mat2x2 dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-col-row-wr.shader_test new file mode 100644 index 00000000..d990c377 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; +} + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-mat3-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-col-wr.shader_test new file mode 100644 index 00000000..a1fff20e --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; +} + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-mat3-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-row-wr.shader_test new file mode 100644 index 00000000..780f0d26 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; +} + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-mat3-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-wr.shader_test new file mode 100644 index 00000000..c1e99542 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-wr.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; +} + +[fragment shader] +#version 120 +uniform mat3x3 src_matrix; +uniform vec3 v; +uniform vec3 expect; +uniform int col; +uniform vec3 value; +varying mat3x3 dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-col-row-wr.shader_test new file mode 100644 index 00000000..ad72cc24 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col][row] = value; +} + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-mat4-col-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-col-wr.shader_test new file mode 100644 index 00000000..8be146b3 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[col] = value; +} + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-mat4-row-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-row-wr.shader_test new file mode 100644 index 00000000..e78e4192 --- /dev/null +++ b/tests/spec/glsl-1.20/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.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1][row] = value; +} + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int row; +uniform int col; +uniform float value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_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.20/execution/variable-indexing/vs-varying-mat4-wr.shader_test b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-wr.shader_test new file mode 100644 index 00000000..5de207f3 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-wr.shader_test @@ -0,0 +1,56 @@ +# Test generated by: +# ../../../glsl-1.10/variable-index-write.sh 1.20 + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + + /* Patch the supplied matrix with the supplied value. If the resulting + * matrix is correct, it will transform the input vector to the expected + * value. Verify that the distance between the result and the expected + * vector is less than epsilon. + */ + dst_matrix = src_matrix; + dst_matrix[1] = value; +} + +[fragment shader] +#version 120 +uniform mat4x4 src_matrix; +uniform vec4 v; +uniform vec4 expect; +uniform int col; +uniform vec4 value; +varying mat4x4 dst_matrix; + +void main() +{ + gl_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 + -- cgit v1.2.3