summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2011-07-17 15:56:57 -0700
committerIan Romanick <ian.d.romanick@intel.com>2011-08-19 09:25:04 -0700
commitd1696bb83ff89dfdc7b6aff4c62fd01e767de4e3 (patch)
tree548e72d48bb6e8d9cba3ce308c95d3822b9a5953
parentf7747a2caf2834b7ca1cd450e613b52239fde494 (diff)
glsl-1.10 / glsl-1.20: Add non-constant index write tests
All of these tests follow a similar form. An array of matrices is set to some values that have one incorrect element. A non-constant index write is used to fix that incorrect element. The result is verified. The tests vary on: - Storage qualifier of the array/matrix (uniform, temporary, varying). - Array / not an array. - Matrix size (mat2, mat3, mat4). - Whether or not the array index is a non-constant. - Whether or not the matrix column is a non-constant. - Whether or not the matrix row is a non-constant. Since the base type is always a matrix, attributes and fragment shader outputs are not tested.
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test81
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-wr.shader_test62
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test152
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test97
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test98
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-wr.shader_test70
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-row-wr.shader_test63
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-wr.shader_test53
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test122
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-wr.shader_test70
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test275
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test121
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test122
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-wr.shader_test70
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-row-wr.shader_test71
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-wr.shader_test53
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test179
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-wr.shader_test78
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test446
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test145
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test146
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-wr.shader_test70
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-row-wr.shader_test79
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-wr.shader_test53
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-row-wr.shader_test73
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-wr.shader_test54
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-row-wr.shader_test55
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-wr.shader_test45
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-row-wr.shader_test114
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-wr.shader_test62
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-row-wr.shader_test63
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-wr.shader_test45
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-row-wr.shader_test171
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-wr.shader_test70
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-row-wr.shader_test71
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-wr.shader_test45
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test83
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-wr.shader_test64
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test154
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test99
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test100
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-wr.shader_test72
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-row-wr.shader_test65
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-wr.shader_test55
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test124
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-wr.shader_test72
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test277
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test123
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test124
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-wr.shader_test72
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-row-wr.shader_test73
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-wr.shader_test55
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test181
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-wr.shader_test80
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test448
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test147
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test148
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-wr.shader_test72
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-row-wr.shader_test81
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-wr.shader_test55
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-row-wr.shader_test75
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-wr.shader_test56
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-row-wr.shader_test57
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-wr.shader_test47
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-row-wr.shader_test116
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-wr.shader_test64
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-row-wr.shader_test65
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-wr.shader_test47
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-row-wr.shader_test173
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-wr.shader_test72
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-row-wr.shader_test73
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-wr.shader_test47
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test94
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-wr.shader_test74
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test165
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test109
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test111
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-wr.shader_test82
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-row-wr.shader_test76
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-wr.shader_test65
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test135
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-wr.shader_test82
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test288
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test133
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test135
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-wr.shader_test82
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-row-wr.shader_test84
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-wr.shader_test65
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test192
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-wr.shader_test90
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test459
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test157
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test159
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-wr.shader_test82
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-row-wr.shader_test92
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-wr.shader_test65
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-row-wr.shader_test85
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-wr.shader_test65
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-row-wr.shader_test67
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-wr.shader_test56
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-row-wr.shader_test126
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-wr.shader_test73
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-row-wr.shader_test75
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-wr.shader_test56
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-row-wr.shader_test183
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-wr.shader_test81
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-row-wr.shader_test83
-rw-r--r--tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-wr.shader_test56
-rwxr-xr-xtests/spec/glsl-1.10/variable-index-write.sh471
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test78
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-col-wr.shader_test59
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test149
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test94
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test95
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-index-wr.shader_test67
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-row-wr.shader_test60
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat2-wr.shader_test50
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test119
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-col-wr.shader_test67
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test272
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test118
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test119
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-index-wr.shader_test67
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-row-wr.shader_test68
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat3-wr.shader_test50
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test176
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-col-wr.shader_test75
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test443
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test142
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test143
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-index-wr.shader_test67
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-row-wr.shader_test76
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-array-mat4-wr.shader_test50
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-col-row-wr.shader_test73
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-col-wr.shader_test54
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-row-wr.shader_test55
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat2-wr.shader_test45
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-col-row-wr.shader_test114
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-col-wr.shader_test62
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-row-wr.shader_test63
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat3-wr.shader_test45
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-col-row-wr.shader_test171
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-col-wr.shader_test70
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-row-wr.shader_test71
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/fs-temp-mat4-wr.shader_test45
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test80
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-col-wr.shader_test61
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test151
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test96
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test97
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-index-wr.shader_test69
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-row-wr.shader_test62
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat2-wr.shader_test52
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test121
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-col-wr.shader_test69
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test274
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test120
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test121
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-index-wr.shader_test69
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-row-wr.shader_test70
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat3-wr.shader_test52
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test178
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-col-wr.shader_test77
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test445
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test144
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test145
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-index-wr.shader_test69
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-row-wr.shader_test78
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-array-mat4-wr.shader_test52
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-col-row-wr.shader_test75
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-col-wr.shader_test56
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-row-wr.shader_test57
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat2-wr.shader_test47
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-col-row-wr.shader_test116
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-col-wr.shader_test64
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-row-wr.shader_test65
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat3-wr.shader_test47
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-col-row-wr.shader_test173
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-col-wr.shader_test72
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-row-wr.shader_test73
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-temp-mat4-wr.shader_test47
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test92
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-col-wr.shader_test72
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test163
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test107
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test109
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-index-wr.shader_test80
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-row-wr.shader_test74
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat2-wr.shader_test63
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test133
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-col-wr.shader_test80
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test286
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test131
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test133
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-index-wr.shader_test80
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-row-wr.shader_test82
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat3-wr.shader_test63
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test190
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-col-wr.shader_test88
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test457
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test155
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test157
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-index-wr.shader_test80
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-row-wr.shader_test90
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-array-mat4-wr.shader_test63
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-col-row-wr.shader_test85
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-col-wr.shader_test65
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-row-wr.shader_test67
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat2-wr.shader_test56
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-col-row-wr.shader_test126
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-col-wr.shader_test73
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-row-wr.shader_test75
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat3-wr.shader_test56
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-col-row-wr.shader_test183
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-col-wr.shader_test81
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-row-wr.shader_test83
-rw-r--r--tests/spec/glsl-1.20/execution/variable-indexing/vs-varying-mat4-wr.shader_test56
217 files changed, 23163 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test
new file mode 100644
index 00000000..bcb9253f
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-row-wr.shader_test
@@ -0,0 +1,81 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col][row] = value;
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180
+uniform float value 0.241498998195656
+draw rect 45 5 10 10
+probe rgb 50 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180
+uniform float value 0.861223395812970
+draw rect 45 20 10 10
+probe rgb 50 25 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-wr.shader_test
new file mode 100644
index 00000000..b37196fd
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-col-wr.shader_test
@@ -0,0 +1,62 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+
+void main()
+{
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col] = value;
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180
+uniform vec2 value 0.241498998195656 0.861223395812970
+draw rect 45 5 10 10
+probe rgb 50 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test
new file mode 100644
index 00000000..309a336f
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-row-wr.shader_test
@@ -0,0 +1,152 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col][row] = value;
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180
+uniform float value 0.241498998195656
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180
+uniform float value 0.861223395812970
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180
+uniform float value 0.241498998195656
+draw rect 45 5 10 10
+probe rgb 50 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180
+uniform float value 0.861223395812970
+draw rect 45 20 10 10
+probe rgb 50 25 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180
+uniform float value 0.241498998195656
+draw rect 85 5 10 10
+probe rgb 90 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180
+uniform float value 0.861223395812970
+draw rect 85 20 10 10
+probe rgb 90 25 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 100 5 10 10
+probe rgb 105 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 100 20 10 10
+probe rgb 105 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test
new file mode 100644
index 00000000..db13f9b7
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-col-wr.shader_test
@@ -0,0 +1,97 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+
+void main()
+{
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col] = value;
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180
+uniform vec2 value 0.241498998195656 0.861223395812970
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180
+uniform vec2 value 0.241498998195656 0.861223395812970
+draw rect 45 5 10 10
+probe rgb 50 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180
+uniform vec2 value 0.241498998195656 0.861223395812970
+draw rect 85 5 10 10
+probe rgb 90 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 100 5 10 10
+probe rgb 105 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test
new file mode 100644
index 00000000..382861a9
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-row-wr.shader_test
@@ -0,0 +1,98 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1][row] = value;
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int index 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
+uniform int index 2
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 100 5 10 10
+probe rgb 105 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 100 20 10 10
+probe rgb 105 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-wr.shader_test
new file mode 100644
index 00000000..9a50ecd7
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-index-wr.shader_test
@@ -0,0 +1,70 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+
+void main()
+{
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1] = value;
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 100 5 10 10
+probe rgb 105 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-row-wr.shader_test
new file mode 100644
index 00000000..bdc5113b
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-row-wr.shader_test
@@ -0,0 +1,63 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1][row] = value;
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-wr.shader_test
new file mode 100644
index 00000000..364bb083
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat2-wr.shader_test
@@ -0,0 +1,53 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+
+void main()
+{
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1] = value;
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test
new file mode 100644
index 00000000..6ddd41b4
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-row-wr.shader_test
@@ -0,0 +1,122 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col][row] = value;
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.493944462129466
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.722190133917966
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.239853948232558
+draw rect 60 35 10 10
+probe rgb 65 40 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504
+uniform float value 0.850846377186973
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504
+uniform float value 0.511303112962423
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0
+uniform float value 0.270815003356504
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-wr.shader_test
new file mode 100644
index 00000000..c7156429
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-col-wr.shader_test
@@ -0,0 +1,70 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+
+void main()
+{
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col] = value;
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0
+uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test
new file mode 100644
index 00000000..4f1a8fcd
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-row-wr.shader_test
@@ -0,0 +1,275 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col][row] = value;
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.493944462129466
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.722190133917966
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.239853948232558
+draw rect 5 35 10 10
+probe rgb 10 40 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504
+uniform float value 0.850846377186973
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504
+uniform float value 0.511303112962423
+draw rect 35 20 10 10
+probe rgb 40 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0
+uniform float value 0.270815003356504
+draw rect 35 35 10 10
+probe rgb 40 40 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.493944462129466
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.722190133917966
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.239853948232558
+draw rect 60 35 10 10
+probe rgb 65 40 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504
+uniform float value 0.850846377186973
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504
+uniform float value 0.511303112962423
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0
+uniform float value 0.270815003356504
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.493944462129466
+draw rect 115 5 10 10
+probe rgb 120 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.722190133917966
+draw rect 115 20 10 10
+probe rgb 120 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.239853948232558
+draw rect 115 35 10 10
+probe rgb 120 40 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 130 5 10 10
+probe rgb 135 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 130 20 10 10
+probe rgb 135 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 130 35 10 10
+probe rgb 135 40 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504
+uniform float value 0.850846377186973
+draw rect 145 5 10 10
+probe rgb 150 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504
+uniform float value 0.511303112962423
+draw rect 145 20 10 10
+probe rgb 150 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0
+uniform float value 0.270815003356504
+draw rect 145 35 10 10
+probe rgb 150 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test
new file mode 100644
index 00000000..f46fa414
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-col-wr.shader_test
@@ -0,0 +1,121 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+
+void main()
+{
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col] = value;
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0
+uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0
+uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558
+draw rect 115 5 10 10
+probe rgb 120 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 130 5 10 10
+probe rgb 135 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0
+uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504
+draw rect 145 5 10 10
+probe rgb 150 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test
new file mode 100644
index 00000000..37734986
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-row-wr.shader_test
@@ -0,0 +1,122 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1][row] = value;
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int index 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
+uniform int index 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 130 5 10 10
+probe rgb 135 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 130 20 10 10
+probe rgb 135 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 130 35 10 10
+probe rgb 135 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-wr.shader_test
new file mode 100644
index 00000000..f104e3a3
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-index-wr.shader_test
@@ -0,0 +1,70 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+
+void main()
+{
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1] = value;
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 130 5 10 10
+probe rgb 135 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-row-wr.shader_test
new file mode 100644
index 00000000..8027907a
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-row-wr.shader_test
@@ -0,0 +1,71 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1][row] = value;
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-wr.shader_test
new file mode 100644
index 00000000..93861c97
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat3-wr.shader_test
@@ -0,0 +1,53 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+
+void main()
+{
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1] = value;
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test
new file mode 100644
index 00000000..7e035abc
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-row-wr.shader_test
@@ -0,0 +1,179 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col][row] = value;
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.922040144261674
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.158053783109488
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.357016429866574
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.836368810383957
+draw rect 75 50 10 10
+probe rgb 80 55 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 90 50 10 10
+probe rgb 95 55 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.350720358904176
+draw rect 105 5 10 10
+probe rgb 110 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.912192627475775
+draw rect 105 20 10 10
+probe rgb 110 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.688544081259531
+draw rect 105 35 10 10
+probe rgb 110 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.913891056231967
+draw rect 105 50 10 10
+probe rgb 110 55 0.0 1.0 0.0
+
+uniform int col 3
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.442058176039301
+draw rect 120 5 10 10
+probe rgb 125 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782
+uniform float value 0.829835836794679
+draw rect 120 20 10 10
+probe rgb 125 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782
+uniform float value 0.365674411003021
+draw rect 120 35 10 10
+probe rgb 125 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0
+uniform float value 0.879197364462782
+draw rect 120 50 10 10
+probe rgb 125 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-wr.shader_test
new file mode 100644
index 00000000..c6860f20
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-col-wr.shader_test
@@ -0,0 +1,78 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+
+void main()
+{
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col] = value;
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967
+draw rect 105 5 10 10
+probe rgb 110 10 0.0 1.0 0.0
+
+uniform int col 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0
+uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+draw rect 120 5 10 10
+probe rgb 125 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test
new file mode 100644
index 00000000..f408484a
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-row-wr.shader_test
@@ -0,0 +1,446 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col][row] = value;
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.922040144261674
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.158053783109488
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.357016429866574
+draw rect 5 35 10 10
+probe rgb 10 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.836368810383957
+draw rect 5 50 10 10
+probe rgb 10 55 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 20 50 10 10
+probe rgb 25 55 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.350720358904176
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.912192627475775
+draw rect 35 20 10 10
+probe rgb 40 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.688544081259531
+draw rect 35 35 10 10
+probe rgb 40 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.913891056231967
+draw rect 35 50 10 10
+probe rgb 40 55 0.0 1.0 0.0
+
+uniform int col 3
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.442058176039301
+draw rect 50 5 10 10
+probe rgb 55 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782
+uniform float value 0.829835836794679
+draw rect 50 20 10 10
+probe rgb 55 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782
+uniform float value 0.365674411003021
+draw rect 50 35 10 10
+probe rgb 55 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0
+uniform float value 0.879197364462782
+draw rect 50 50 10 10
+probe rgb 55 55 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.922040144261674
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.158053783109488
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.357016429866574
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.836368810383957
+draw rect 75 50 10 10
+probe rgb 80 55 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 90 50 10 10
+probe rgb 95 55 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.350720358904176
+draw rect 105 5 10 10
+probe rgb 110 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.912192627475775
+draw rect 105 20 10 10
+probe rgb 110 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.688544081259531
+draw rect 105 35 10 10
+probe rgb 110 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.913891056231967
+draw rect 105 50 10 10
+probe rgb 110 55 0.0 1.0 0.0
+
+uniform int col 3
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.442058176039301
+draw rect 120 5 10 10
+probe rgb 125 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782
+uniform float value 0.829835836794679
+draw rect 120 20 10 10
+probe rgb 125 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782
+uniform float value 0.365674411003021
+draw rect 120 35 10 10
+probe rgb 125 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0
+uniform float value 0.879197364462782
+draw rect 120 50 10 10
+probe rgb 125 55 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.922040144261674
+draw rect 145 5 10 10
+probe rgb 150 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.158053783109488
+draw rect 145 20 10 10
+probe rgb 150 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.357016429866574
+draw rect 145 35 10 10
+probe rgb 150 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.836368810383957
+draw rect 145 50 10 10
+probe rgb 150 55 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 160 5 10 10
+probe rgb 165 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 160 20 10 10
+probe rgb 165 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 160 35 10 10
+probe rgb 165 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 160 50 10 10
+probe rgb 165 55 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.350720358904176
+draw rect 175 5 10 10
+probe rgb 180 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.912192627475775
+draw rect 175 20 10 10
+probe rgb 180 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.688544081259531
+draw rect 175 35 10 10
+probe rgb 180 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.913891056231967
+draw rect 175 50 10 10
+probe rgb 180 55 0.0 1.0 0.0
+
+uniform int col 3
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.442058176039301
+draw rect 190 5 10 10
+probe rgb 195 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782
+uniform float value 0.829835836794679
+draw rect 190 20 10 10
+probe rgb 195 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782
+uniform float value 0.365674411003021
+draw rect 190 35 10 10
+probe rgb 195 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0
+uniform float value 0.879197364462782
+draw rect 190 50 10 10
+probe rgb 195 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test
new file mode 100644
index 00000000..74d8d953
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-col-wr.shader_test
@@ -0,0 +1,145 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+
+void main()
+{
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col] = value;
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int col 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0
+uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+draw rect 50 5 10 10
+probe rgb 55 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967
+draw rect 105 5 10 10
+probe rgb 110 10 0.0 1.0 0.0
+
+uniform int col 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0
+uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+draw rect 120 5 10 10
+probe rgb 125 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957
+draw rect 145 5 10 10
+probe rgb 150 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 160 5 10 10
+probe rgb 165 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967
+draw rect 175 5 10 10
+probe rgb 180 10 0.0 1.0 0.0
+
+uniform int col 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0
+uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+draw rect 190 5 10 10
+probe rgb 195 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test
new file mode 100644
index 00000000..473b2d7a
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-row-wr.shader_test
@@ -0,0 +1,146 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1][row] = value;
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 20 50 10 10
+probe rgb 25 55 0.0 1.0 0.0
+
+uniform int index 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 90 50 10 10
+probe rgb 95 55 0.0 1.0 0.0
+
+uniform int index 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 160 5 10 10
+probe rgb 165 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 160 20 10 10
+probe rgb 165 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 160 35 10 10
+probe rgb 165 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 160 50 10 10
+probe rgb 165 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-wr.shader_test
new file mode 100644
index 00000000..6762d63e
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-index-wr.shader_test
@@ -0,0 +1,70 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+
+void main()
+{
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1] = value;
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 160 5 10 10
+probe rgb 165 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-row-wr.shader_test
new file mode 100644
index 00000000..25bbab06
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-row-wr.shader_test
@@ -0,0 +1,79 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1][row] = value;
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 90 50 10 10
+probe rgb 95 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-wr.shader_test
new file mode 100644
index 00000000..9ddf8f87
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-array-mat4-wr.shader_test
@@ -0,0 +1,53 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+
+void main()
+{
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1] = value;
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-row-wr.shader_test
new file mode 100644
index 00000000..e8de8649
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-row-wr.shader_test
@@ -0,0 +1,73 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat2 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col][row] = value;
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180
+uniform float value 0.241498998195656
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180
+uniform float value 0.861223395812970
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-wr.shader_test
new file mode 100644
index 00000000..544b0783
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-col-wr.shader_test
@@ -0,0 +1,54 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int col;
+uniform vec2 value;
+
+void main()
+{
+ mat2 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col] = value;
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180
+uniform vec2 value 0.241498998195656 0.861223395812970
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-row-wr.shader_test
new file mode 100644
index 00000000..954b78b7
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-row-wr.shader_test
@@ -0,0 +1,55 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat2 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1][row] = value;
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-wr.shader_test
new file mode 100644
index 00000000..a23dac7f
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat2-wr.shader_test
@@ -0,0 +1,45 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int col;
+uniform vec2 value;
+
+void main()
+{
+ mat2 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1] = value;
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-row-wr.shader_test
new file mode 100644
index 00000000..4ca1f7f5
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-row-wr.shader_test
@@ -0,0 +1,114 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat3 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col][row] = value;
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.493944462129466
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.722190133917966
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.239853948232558
+draw rect 5 35 10 10
+probe rgb 10 40 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504
+uniform float value 0.850846377186973
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504
+uniform float value 0.511303112962423
+draw rect 35 20 10 10
+probe rgb 40 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0
+uniform float value 0.270815003356504
+draw rect 35 35 10 10
+probe rgb 40 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-wr.shader_test
new file mode 100644
index 00000000..410a355e
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-col-wr.shader_test
@@ -0,0 +1,62 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int col;
+uniform vec3 value;
+
+void main()
+{
+ mat3 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col] = value;
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0
+uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-row-wr.shader_test
new file mode 100644
index 00000000..4f2e2690
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-row-wr.shader_test
@@ -0,0 +1,63 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat3 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1][row] = value;
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-wr.shader_test
new file mode 100644
index 00000000..855fbedf
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat3-wr.shader_test
@@ -0,0 +1,45 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int col;
+uniform vec3 value;
+
+void main()
+{
+ mat3 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1] = value;
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-row-wr.shader_test
new file mode 100644
index 00000000..ed094bed
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-row-wr.shader_test
@@ -0,0 +1,171 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat4 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col][row] = value;
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.922040144261674
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.158053783109488
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.357016429866574
+draw rect 5 35 10 10
+probe rgb 10 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.836368810383957
+draw rect 5 50 10 10
+probe rgb 10 55 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 20 50 10 10
+probe rgb 25 55 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.350720358904176
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.912192627475775
+draw rect 35 20 10 10
+probe rgb 40 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.688544081259531
+draw rect 35 35 10 10
+probe rgb 40 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.913891056231967
+draw rect 35 50 10 10
+probe rgb 40 55 0.0 1.0 0.0
+
+uniform int col 3
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.442058176039301
+draw rect 50 5 10 10
+probe rgb 55 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782
+uniform float value 0.829835836794679
+draw rect 50 20 10 10
+probe rgb 55 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782
+uniform float value 0.365674411003021
+draw rect 50 35 10 10
+probe rgb 55 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0
+uniform float value 0.879197364462782
+draw rect 50 50 10 10
+probe rgb 55 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-wr.shader_test
new file mode 100644
index 00000000..61151289
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-col-wr.shader_test
@@ -0,0 +1,70 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int col;
+uniform vec4 value;
+
+void main()
+{
+ mat4 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col] = value;
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int col 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0
+uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+draw rect 50 5 10 10
+probe rgb 55 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-row-wr.shader_test
new file mode 100644
index 00000000..0164a105
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-row-wr.shader_test
@@ -0,0 +1,71 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ mat4 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1][row] = value;
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 20 50 10 10
+probe rgb 25 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-wr.shader_test
new file mode 100644
index 00000000..ea49ac38
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-temp-mat4-wr.shader_test
@@ -0,0 +1,45 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int col;
+uniform vec4 value;
+
+void main()
+{
+ mat4 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1] = value;
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test
new file mode 100644
index 00000000..924807d6
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-row-wr.shader_test
@@ -0,0 +1,83 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col][row] = value;
+ gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180
+uniform float value 0.241498998195656
+draw rect 45 5 10 10
+probe rgb 50 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180
+uniform float value 0.861223395812970
+draw rect 45 20 10 10
+probe rgb 50 25 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-wr.shader_test
new file mode 100644
index 00000000..4bb04e81
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-col-wr.shader_test
@@ -0,0 +1,64 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col] = value;
+ gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180
+uniform vec2 value 0.241498998195656 0.861223395812970
+draw rect 45 5 10 10
+probe rgb 50 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test
new file mode 100644
index 00000000..adaf608f
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-row-wr.shader_test
@@ -0,0 +1,154 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col][row] = value;
+ gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180
+uniform float value 0.241498998195656
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180
+uniform float value 0.861223395812970
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180
+uniform float value 0.241498998195656
+draw rect 45 5 10 10
+probe rgb 50 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180
+uniform float value 0.861223395812970
+draw rect 45 20 10 10
+probe rgb 50 25 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180
+uniform float value 0.241498998195656
+draw rect 85 5 10 10
+probe rgb 90 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180
+uniform float value 0.861223395812970
+draw rect 85 20 10 10
+probe rgb 90 25 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 100 5 10 10
+probe rgb 105 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 100 20 10 10
+probe rgb 105 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test
new file mode 100644
index 00000000..39c6dff2
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-col-wr.shader_test
@@ -0,0 +1,99 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col] = value;
+ gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180
+uniform vec2 value 0.241498998195656 0.861223395812970
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180
+uniform vec2 value 0.241498998195656 0.861223395812970
+draw rect 45 5 10 10
+probe rgb 50 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180
+uniform vec2 value 0.241498998195656 0.861223395812970
+draw rect 85 5 10 10
+probe rgb 90 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 100 5 10 10
+probe rgb 105 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test
new file mode 100644
index 00000000..e5a5c084
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-row-wr.shader_test
@@ -0,0 +1,100 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1][row] = value;
+ gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int index 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
+uniform int index 2
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 100 5 10 10
+probe rgb 105 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 100 20 10 10
+probe rgb 105 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-wr.shader_test
new file mode 100644
index 00000000..2ade3d1a
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-index-wr.shader_test
@@ -0,0 +1,72 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1] = value;
+ gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 100 5 10 10
+probe rgb 105 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-row-wr.shader_test
new file mode 100644
index 00000000..e20cf7db
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-row-wr.shader_test
@@ -0,0 +1,65 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1][row] = value;
+ gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-wr.shader_test
new file mode 100644
index 00000000..3d4e2ff6
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat2-wr.shader_test
@@ -0,0 +1,55 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat2 dst_matrix[3];
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1] = value;
+ gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test
new file mode 100644
index 00000000..5c5a2f77
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-row-wr.shader_test
@@ -0,0 +1,124 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col][row] = value;
+ gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.493944462129466
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.722190133917966
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.239853948232558
+draw rect 60 35 10 10
+probe rgb 65 40 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504
+uniform float value 0.850846377186973
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504
+uniform float value 0.511303112962423
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0
+uniform float value 0.270815003356504
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-wr.shader_test
new file mode 100644
index 00000000..743d6f40
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-col-wr.shader_test
@@ -0,0 +1,72 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col] = value;
+ gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0
+uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test
new file mode 100644
index 00000000..63c18e81
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-row-wr.shader_test
@@ -0,0 +1,277 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col][row] = value;
+ gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.493944462129466
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.722190133917966
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.239853948232558
+draw rect 5 35 10 10
+probe rgb 10 40 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504
+uniform float value 0.850846377186973
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504
+uniform float value 0.511303112962423
+draw rect 35 20 10 10
+probe rgb 40 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0
+uniform float value 0.270815003356504
+draw rect 35 35 10 10
+probe rgb 40 40 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.493944462129466
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.722190133917966
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.239853948232558
+draw rect 60 35 10 10
+probe rgb 65 40 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504
+uniform float value 0.850846377186973
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504
+uniform float value 0.511303112962423
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0
+uniform float value 0.270815003356504
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.493944462129466
+draw rect 115 5 10 10
+probe rgb 120 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.722190133917966
+draw rect 115 20 10 10
+probe rgb 120 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.239853948232558
+draw rect 115 35 10 10
+probe rgb 120 40 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 130 5 10 10
+probe rgb 135 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 130 20 10 10
+probe rgb 135 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 130 35 10 10
+probe rgb 135 40 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504
+uniform float value 0.850846377186973
+draw rect 145 5 10 10
+probe rgb 150 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504
+uniform float value 0.511303112962423
+draw rect 145 20 10 10
+probe rgb 150 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0
+uniform float value 0.270815003356504
+draw rect 145 35 10 10
+probe rgb 150 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test
new file mode 100644
index 00000000..4a2ca89c
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-col-wr.shader_test
@@ -0,0 +1,123 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col] = value;
+ gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0
+uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0
+uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558
+draw rect 115 5 10 10
+probe rgb 120 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 130 5 10 10
+probe rgb 135 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0
+uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504
+draw rect 145 5 10 10
+probe rgb 150 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test
new file mode 100644
index 00000000..def99ade
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-row-wr.shader_test
@@ -0,0 +1,124 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1][row] = value;
+ gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int index 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
+uniform int index 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 130 5 10 10
+probe rgb 135 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 130 20 10 10
+probe rgb 135 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 130 35 10 10
+probe rgb 135 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-wr.shader_test
new file mode 100644
index 00000000..b7dd57d3
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-index-wr.shader_test
@@ -0,0 +1,72 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1] = value;
+ gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 130 5 10 10
+probe rgb 135 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-row-wr.shader_test
new file mode 100644
index 00000000..1d19e560
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-row-wr.shader_test
@@ -0,0 +1,73 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1][row] = value;
+ gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-wr.shader_test
new file mode 100644
index 00000000..f34b68b6
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat3-wr.shader_test
@@ -0,0 +1,55 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat3 dst_matrix[3];
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1] = value;
+ gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test
new file mode 100644
index 00000000..66552664
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-row-wr.shader_test
@@ -0,0 +1,181 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col][row] = value;
+ gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.922040144261674
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.158053783109488
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.357016429866574
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.836368810383957
+draw rect 75 50 10 10
+probe rgb 80 55 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 90 50 10 10
+probe rgb 95 55 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.350720358904176
+draw rect 105 5 10 10
+probe rgb 110 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.912192627475775
+draw rect 105 20 10 10
+probe rgb 110 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.688544081259531
+draw rect 105 35 10 10
+probe rgb 110 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.913891056231967
+draw rect 105 50 10 10
+probe rgb 110 55 0.0 1.0 0.0
+
+uniform int col 3
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.442058176039301
+draw rect 120 5 10 10
+probe rgb 125 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782
+uniform float value 0.829835836794679
+draw rect 120 20 10 10
+probe rgb 125 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782
+uniform float value 0.365674411003021
+draw rect 120 35 10 10
+probe rgb 125 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0
+uniform float value 0.879197364462782
+draw rect 120 50 10 10
+probe rgb 125 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-wr.shader_test
new file mode 100644
index 00000000..05b0d194
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-col-wr.shader_test
@@ -0,0 +1,80 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col] = value;
+ gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967
+draw rect 105 5 10 10
+probe rgb 110 10 0.0 1.0 0.0
+
+uniform int col 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0
+uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+draw rect 120 5 10 10
+probe rgb 125 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test
new file mode 100644
index 00000000..1bec9c9d
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-row-wr.shader_test
@@ -0,0 +1,448 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col][row] = value;
+ gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.922040144261674
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.158053783109488
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.357016429866574
+draw rect 5 35 10 10
+probe rgb 10 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.836368810383957
+draw rect 5 50 10 10
+probe rgb 10 55 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 20 50 10 10
+probe rgb 25 55 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.350720358904176
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.912192627475775
+draw rect 35 20 10 10
+probe rgb 40 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.688544081259531
+draw rect 35 35 10 10
+probe rgb 40 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.913891056231967
+draw rect 35 50 10 10
+probe rgb 40 55 0.0 1.0 0.0
+
+uniform int col 3
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.442058176039301
+draw rect 50 5 10 10
+probe rgb 55 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782
+uniform float value 0.829835836794679
+draw rect 50 20 10 10
+probe rgb 55 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782
+uniform float value 0.365674411003021
+draw rect 50 35 10 10
+probe rgb 55 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0
+uniform float value 0.879197364462782
+draw rect 50 50 10 10
+probe rgb 55 55 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.922040144261674
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.158053783109488
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.357016429866574
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.836368810383957
+draw rect 75 50 10 10
+probe rgb 80 55 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 90 50 10 10
+probe rgb 95 55 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.350720358904176
+draw rect 105 5 10 10
+probe rgb 110 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.912192627475775
+draw rect 105 20 10 10
+probe rgb 110 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.688544081259531
+draw rect 105 35 10 10
+probe rgb 110 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.913891056231967
+draw rect 105 50 10 10
+probe rgb 110 55 0.0 1.0 0.0
+
+uniform int col 3
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.442058176039301
+draw rect 120 5 10 10
+probe rgb 125 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782
+uniform float value 0.829835836794679
+draw rect 120 20 10 10
+probe rgb 125 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782
+uniform float value 0.365674411003021
+draw rect 120 35 10 10
+probe rgb 125 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0
+uniform float value 0.879197364462782
+draw rect 120 50 10 10
+probe rgb 125 55 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.922040144261674
+draw rect 145 5 10 10
+probe rgb 150 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.158053783109488
+draw rect 145 20 10 10
+probe rgb 150 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.357016429866574
+draw rect 145 35 10 10
+probe rgb 150 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.836368810383957
+draw rect 145 50 10 10
+probe rgb 150 55 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 160 5 10 10
+probe rgb 165 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 160 20 10 10
+probe rgb 165 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 160 35 10 10
+probe rgb 165 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 160 50 10 10
+probe rgb 165 55 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.350720358904176
+draw rect 175 5 10 10
+probe rgb 180 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.912192627475775
+draw rect 175 20 10 10
+probe rgb 180 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.688544081259531
+draw rect 175 35 10 10
+probe rgb 180 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.913891056231967
+draw rect 175 50 10 10
+probe rgb 180 55 0.0 1.0 0.0
+
+uniform int col 3
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.442058176039301
+draw rect 190 5 10 10
+probe rgb 195 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782
+uniform float value 0.829835836794679
+draw rect 190 20 10 10
+probe rgb 195 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782
+uniform float value 0.365674411003021
+draw rect 190 35 10 10
+probe rgb 195 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0
+uniform float value 0.879197364462782
+draw rect 190 50 10 10
+probe rgb 195 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test
new file mode 100644
index 00000000..d411fe0d
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-col-wr.shader_test
@@ -0,0 +1,147 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col] = value;
+ gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int col 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0
+uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+draw rect 50 5 10 10
+probe rgb 55 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967
+draw rect 105 5 10 10
+probe rgb 110 10 0.0 1.0 0.0
+
+uniform int col 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0
+uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+draw rect 120 5 10 10
+probe rgb 125 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957
+draw rect 145 5 10 10
+probe rgb 150 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 160 5 10 10
+probe rgb 165 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967
+draw rect 175 5 10 10
+probe rgb 180 10 0.0 1.0 0.0
+
+uniform int col 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0
+uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+draw rect 190 5 10 10
+probe rgb 195 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test
new file mode 100644
index 00000000..8785feaf
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-row-wr.shader_test
@@ -0,0 +1,148 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1][row] = value;
+ gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 20 50 10 10
+probe rgb 25 55 0.0 1.0 0.0
+
+uniform int index 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 90 50 10 10
+probe rgb 95 55 0.0 1.0 0.0
+
+uniform int index 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 160 5 10 10
+probe rgb 165 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 160 20 10 10
+probe rgb 165 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 160 35 10 10
+probe rgb 165 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 160 50 10 10
+probe rgb 165 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-wr.shader_test
new file mode 100644
index 00000000..63d23291
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-index-wr.shader_test
@@ -0,0 +1,72 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1] = value;
+ gl_FrontColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 160 5 10 10
+probe rgb 165 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-row-wr.shader_test
new file mode 100644
index 00000000..5225449c
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-row-wr.shader_test
@@ -0,0 +1,81 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1][row] = value;
+ gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 90 50 10 10
+probe rgb 95 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-wr.shader_test
new file mode 100644
index 00000000..0e8d4fd5
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-array-mat4-wr.shader_test
@@ -0,0 +1,55 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat4 dst_matrix[3];
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1] = value;
+ gl_FrontColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-row-wr.shader_test
new file mode 100644
index 00000000..2514a0d7
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-row-wr.shader_test
@@ -0,0 +1,75 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat2 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col][row] = value;
+ gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180
+uniform float value 0.241498998195656
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180
+uniform float value 0.861223395812970
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-wr.shader_test
new file mode 100644
index 00000000..87430fb5
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-col-wr.shader_test
@@ -0,0 +1,56 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int col;
+uniform vec2 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat2 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col] = value;
+ gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180
+uniform vec2 value 0.241498998195656 0.861223395812970
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-row-wr.shader_test
new file mode 100644
index 00000000..838e68eb
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-row-wr.shader_test
@@ -0,0 +1,57 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat2 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1][row] = value;
+ gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-wr.shader_test
new file mode 100644
index 00000000..f601edc1
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat2-wr.shader_test
@@ -0,0 +1,47 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int col;
+uniform vec2 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat2 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1] = value;
+ gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-row-wr.shader_test
new file mode 100644
index 00000000..6236a29e
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-row-wr.shader_test
@@ -0,0 +1,116 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat3 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col][row] = value;
+ gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.493944462129466
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.722190133917966
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.239853948232558
+draw rect 5 35 10 10
+probe rgb 10 40 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504
+uniform float value 0.850846377186973
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504
+uniform float value 0.511303112962423
+draw rect 35 20 10 10
+probe rgb 40 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0
+uniform float value 0.270815003356504
+draw rect 35 35 10 10
+probe rgb 40 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-wr.shader_test
new file mode 100644
index 00000000..2d627741
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-col-wr.shader_test
@@ -0,0 +1,64 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int col;
+uniform vec3 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat3 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col] = value;
+ gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0
+uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-row-wr.shader_test
new file mode 100644
index 00000000..1fa3d11e
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-row-wr.shader_test
@@ -0,0 +1,65 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat3 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1][row] = value;
+ gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-wr.shader_test
new file mode 100644
index 00000000..ed09640e
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat3-wr.shader_test
@@ -0,0 +1,47 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int col;
+uniform vec3 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat3 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1] = value;
+ gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-row-wr.shader_test
new file mode 100644
index 00000000..4c35716d
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-row-wr.shader_test
@@ -0,0 +1,173 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat4 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col][row] = value;
+ gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.922040144261674
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.158053783109488
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.357016429866574
+draw rect 5 35 10 10
+probe rgb 10 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.836368810383957
+draw rect 5 50 10 10
+probe rgb 10 55 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 20 50 10 10
+probe rgb 25 55 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.350720358904176
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.912192627475775
+draw rect 35 20 10 10
+probe rgb 40 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.688544081259531
+draw rect 35 35 10 10
+probe rgb 40 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.913891056231967
+draw rect 35 50 10 10
+probe rgb 40 55 0.0 1.0 0.0
+
+uniform int col 3
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.442058176039301
+draw rect 50 5 10 10
+probe rgb 55 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782
+uniform float value 0.829835836794679
+draw rect 50 20 10 10
+probe rgb 55 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782
+uniform float value 0.365674411003021
+draw rect 50 35 10 10
+probe rgb 55 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0
+uniform float value 0.879197364462782
+draw rect 50 50 10 10
+probe rgb 55 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-wr.shader_test
new file mode 100644
index 00000000..db671c9a
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-col-wr.shader_test
@@ -0,0 +1,72 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int col;
+uniform vec4 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat4 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col] = value;
+ gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int col 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0
+uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+draw rect 50 5 10 10
+probe rgb 55 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-row-wr.shader_test
new file mode 100644
index 00000000..e6d9e3f2
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-row-wr.shader_test
@@ -0,0 +1,73 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat4 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1][row] = value;
+ gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 20 50 10 10
+probe rgb 25 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-wr.shader_test
new file mode 100644
index 00000000..3fae51ef
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-temp-mat4-wr.shader_test
@@ -0,0 +1,47 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int col;
+uniform vec4 value;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ mat4 dst_matrix;
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1] = value;
+ gl_FrontColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 110
+void main() { gl_FragColor = gl_Color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test
new file mode 100644
index 00000000..f811b1c2
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-row-wr.shader_test
@@ -0,0 +1,94 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180
+uniform float value 0.241498998195656
+draw rect 45 5 10 10
+probe rgb 50 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180
+uniform float value 0.861223395812970
+draw rect 45 20 10 10
+probe rgb 50 25 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-wr.shader_test
new file mode 100644
index 00000000..bf3c7c70
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-col-wr.shader_test
@@ -0,0 +1,74 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180
+uniform vec2 value 0.241498998195656 0.861223395812970
+draw rect 45 5 10 10
+probe rgb 50 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test
new file mode 100644
index 00000000..189995a7
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-row-wr.shader_test
@@ -0,0 +1,165 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180
+uniform float value 0.241498998195656
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180
+uniform float value 0.861223395812970
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180
+uniform float value 0.241498998195656
+draw rect 45 5 10 10
+probe rgb 50 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180
+uniform float value 0.861223395812970
+draw rect 45 20 10 10
+probe rgb 50 25 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180
+uniform float value 0.241498998195656
+draw rect 85 5 10 10
+probe rgb 90 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180
+uniform float value 0.861223395812970
+draw rect 85 20 10 10
+probe rgb 90 25 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 100 5 10 10
+probe rgb 105 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 100 20 10 10
+probe rgb 105 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test
new file mode 100644
index 00000000..c18124f4
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-col-wr.shader_test
@@ -0,0 +1,109 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180
+uniform vec2 value 0.241498998195656 0.861223395812970
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180
+uniform vec2 value 0.241498998195656 0.861223395812970
+draw rect 45 5 10 10
+probe rgb 50 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180
+uniform vec2 value 0.241498998195656 0.861223395812970
+draw rect 85 5 10 10
+probe rgb 90 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 100 5 10 10
+probe rgb 105 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test
new file mode 100644
index 00000000..55adf239
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-row-wr.shader_test
@@ -0,0 +1,111 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int index 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
+uniform int index 2
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 100 5 10 10
+probe rgb 105 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 100 20 10 10
+probe rgb 105 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-wr.shader_test
new file mode 100644
index 00000000..1be320e5
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-index-wr.shader_test
@@ -0,0 +1,82 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 100 5 10 10
+probe rgb 105 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-row-wr.shader_test
new file mode 100644
index 00000000..3b9ad245
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-row-wr.shader_test
@@ -0,0 +1,76 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-wr.shader_test
new file mode 100644
index 00000000..312db59a
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat2-wr.shader_test
@@ -0,0 +1,65 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat2(0.0);
+ dst_matrix[1] = mat2(0.0);
+ dst_matrix[2] = mat2(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int index;
+uniform int col;
+uniform vec2 value;
+varying mat2 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test
new file mode 100644
index 00000000..41d504ac
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-row-wr.shader_test
@@ -0,0 +1,135 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.493944462129466
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.722190133917966
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.239853948232558
+draw rect 60 35 10 10
+probe rgb 65 40 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504
+uniform float value 0.850846377186973
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504
+uniform float value 0.511303112962423
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0
+uniform float value 0.270815003356504
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-wr.shader_test
new file mode 100644
index 00000000..adb4e9fe
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-col-wr.shader_test
@@ -0,0 +1,82 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0
+uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test
new file mode 100644
index 00000000..b277be94
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-row-wr.shader_test
@@ -0,0 +1,288 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.493944462129466
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.722190133917966
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.239853948232558
+draw rect 5 35 10 10
+probe rgb 10 40 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504
+uniform float value 0.850846377186973
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504
+uniform float value 0.511303112962423
+draw rect 35 20 10 10
+probe rgb 40 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0
+uniform float value 0.270815003356504
+draw rect 35 35 10 10
+probe rgb 40 40 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.493944462129466
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.722190133917966
+draw rect 60 20 10 10
+probe rgb 65 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.239853948232558
+draw rect 60 35 10 10
+probe rgb 65 40 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504
+uniform float value 0.850846377186973
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504
+uniform float value 0.511303112962423
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0
+uniform float value 0.270815003356504
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.493944462129466
+draw rect 115 5 10 10
+probe rgb 120 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.722190133917966
+draw rect 115 20 10 10
+probe rgb 120 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.239853948232558
+draw rect 115 35 10 10
+probe rgb 120 40 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 130 5 10 10
+probe rgb 135 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 130 20 10 10
+probe rgb 135 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 130 35 10 10
+probe rgb 135 40 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504
+uniform float value 0.850846377186973
+draw rect 145 5 10 10
+probe rgb 150 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504
+uniform float value 0.511303112962423
+draw rect 145 20 10 10
+probe rgb 150 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0
+uniform float value 0.270815003356504
+draw rect 145 35 10 10
+probe rgb 150 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test
new file mode 100644
index 00000000..22a970ad
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-col-wr.shader_test
@@ -0,0 +1,133 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0
+uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558
+draw rect 60 5 10 10
+probe rgb 65 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0
+uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558
+draw rect 115 5 10 10
+probe rgb 120 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 130 5 10 10
+probe rgb 135 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0
+uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504
+draw rect 145 5 10 10
+probe rgb 150 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test
new file mode 100644
index 00000000..9c7441f0
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-row-wr.shader_test
@@ -0,0 +1,135 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int index 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
+uniform int index 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 130 5 10 10
+probe rgb 135 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 130 20 10 10
+probe rgb 135 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 130 35 10 10
+probe rgb 135 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-wr.shader_test
new file mode 100644
index 00000000..5b539732
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-index-wr.shader_test
@@ -0,0 +1,82 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 130 5 10 10
+probe rgb 135 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-row-wr.shader_test
new file mode 100644
index 00000000..81ad559a
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-row-wr.shader_test
@@ -0,0 +1,84 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-wr.shader_test
new file mode 100644
index 00000000..0e0d1bca
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat3-wr.shader_test
@@ -0,0 +1,65 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat3(0.0);
+ dst_matrix[1] = mat3(0.0);
+ dst_matrix[2] = mat3(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int index;
+uniform int col;
+uniform vec3 value;
+varying mat3 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test
new file mode 100644
index 00000000..425d4267
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-row-wr.shader_test
@@ -0,0 +1,192 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.922040144261674
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.158053783109488
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.357016429866574
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.836368810383957
+draw rect 75 50 10 10
+probe rgb 80 55 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 90 50 10 10
+probe rgb 95 55 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.350720358904176
+draw rect 105 5 10 10
+probe rgb 110 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.912192627475775
+draw rect 105 20 10 10
+probe rgb 110 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.688544081259531
+draw rect 105 35 10 10
+probe rgb 110 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.913891056231967
+draw rect 105 50 10 10
+probe rgb 110 55 0.0 1.0 0.0
+
+uniform int col 3
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.442058176039301
+draw rect 120 5 10 10
+probe rgb 125 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782
+uniform float value 0.829835836794679
+draw rect 120 20 10 10
+probe rgb 125 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782
+uniform float value 0.365674411003021
+draw rect 120 35 10 10
+probe rgb 125 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0
+uniform float value 0.879197364462782
+draw rect 120 50 10 10
+probe rgb 125 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-wr.shader_test
new file mode 100644
index 00000000..7792f823
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-col-wr.shader_test
@@ -0,0 +1,90 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][col] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967
+draw rect 105 5 10 10
+probe rgb 110 10 0.0 1.0 0.0
+
+uniform int col 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0
+uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+draw rect 120 5 10 10
+probe rgb 125 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test
new file mode 100644
index 00000000..da56d002
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-row-wr.shader_test
@@ -0,0 +1,459 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.922040144261674
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.158053783109488
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.357016429866574
+draw rect 5 35 10 10
+probe rgb 10 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.836368810383957
+draw rect 5 50 10 10
+probe rgb 10 55 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 20 50 10 10
+probe rgb 25 55 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.350720358904176
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.912192627475775
+draw rect 35 20 10 10
+probe rgb 40 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.688544081259531
+draw rect 35 35 10 10
+probe rgb 40 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.913891056231967
+draw rect 35 50 10 10
+probe rgb 40 55 0.0 1.0 0.0
+
+uniform int col 3
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.442058176039301
+draw rect 50 5 10 10
+probe rgb 55 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782
+uniform float value 0.829835836794679
+draw rect 50 20 10 10
+probe rgb 55 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782
+uniform float value 0.365674411003021
+draw rect 50 35 10 10
+probe rgb 55 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0
+uniform float value 0.879197364462782
+draw rect 50 50 10 10
+probe rgb 55 55 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.922040144261674
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.158053783109488
+draw rect 75 20 10 10
+probe rgb 80 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.357016429866574
+draw rect 75 35 10 10
+probe rgb 80 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.836368810383957
+draw rect 75 50 10 10
+probe rgb 80 55 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 90 50 10 10
+probe rgb 95 55 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.350720358904176
+draw rect 105 5 10 10
+probe rgb 110 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.912192627475775
+draw rect 105 20 10 10
+probe rgb 110 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.688544081259531
+draw rect 105 35 10 10
+probe rgb 110 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.913891056231967
+draw rect 105 50 10 10
+probe rgb 110 55 0.0 1.0 0.0
+
+uniform int col 3
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.442058176039301
+draw rect 120 5 10 10
+probe rgb 125 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782
+uniform float value 0.829835836794679
+draw rect 120 20 10 10
+probe rgb 125 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782
+uniform float value 0.365674411003021
+draw rect 120 35 10 10
+probe rgb 125 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0
+uniform float value 0.879197364462782
+draw rect 120 50 10 10
+probe rgb 125 55 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.922040144261674
+draw rect 145 5 10 10
+probe rgb 150 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.158053783109488
+draw rect 145 20 10 10
+probe rgb 150 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.357016429866574
+draw rect 145 35 10 10
+probe rgb 150 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.836368810383957
+draw rect 145 50 10 10
+probe rgb 150 55 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 160 5 10 10
+probe rgb 165 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 160 20 10 10
+probe rgb 165 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 160 35 10 10
+probe rgb 165 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 160 50 10 10
+probe rgb 165 55 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.350720358904176
+draw rect 175 5 10 10
+probe rgb 180 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.912192627475775
+draw rect 175 20 10 10
+probe rgb 180 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.688544081259531
+draw rect 175 35 10 10
+probe rgb 180 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.913891056231967
+draw rect 175 50 10 10
+probe rgb 180 55 0.0 1.0 0.0
+
+uniform int col 3
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.442058176039301
+draw rect 190 5 10 10
+probe rgb 195 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782
+uniform float value 0.829835836794679
+draw rect 190 20 10 10
+probe rgb 195 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782
+uniform float value 0.365674411003021
+draw rect 190 35 10 10
+probe rgb 195 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0
+uniform float value 0.879197364462782
+draw rect 190 50 10 10
+probe rgb 195 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test
new file mode 100644
index 00000000..7c6d108d
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-col-wr.shader_test
@@ -0,0 +1,157 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][col] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int col 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int col 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0
+uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+draw rect 50 5 10 10
+probe rgb 55 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform int col 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957
+draw rect 75 5 10 10
+probe rgb 80 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967
+draw rect 105 5 10 10
+probe rgb 110 10 0.0 1.0 0.0
+
+uniform int col 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0
+uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+draw rect 120 5 10 10
+probe rgb 125 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform int col 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957
+draw rect 145 5 10 10
+probe rgb 150 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 160 5 10 10
+probe rgb 165 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967
+draw rect 175 5 10 10
+probe rgb 180 10 0.0 1.0 0.0
+
+uniform int col 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0
+uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+draw rect 190 5 10 10
+probe rgb 195 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test
new file mode 100644
index 00000000..709c6a4a
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-row-wr.shader_test
@@ -0,0 +1,159 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 20 50 10 10
+probe rgb 25 55 0.0 1.0 0.0
+
+uniform int index 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 90 50 10 10
+probe rgb 95 55 0.0 1.0 0.0
+
+uniform int index 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 160 5 10 10
+probe rgb 165 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 160 20 10 10
+probe rgb 165 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 160 35 10 10
+probe rgb 165 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 160 50 10 10
+probe rgb 165 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-wr.shader_test
new file mode 100644
index 00000000..57b0708d
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-index-wr.shader_test
@@ -0,0 +1,82 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[index] = src_matrix;
+ dst_matrix[index][1] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[index] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int index 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int index 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int index 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 160 5 10 10
+probe rgb 165 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-row-wr.shader_test
new file mode 100644
index 00000000..d7741787
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-row-wr.shader_test
@@ -0,0 +1,92 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 90 20 10 10
+probe rgb 95 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 90 35 10 10
+probe rgb 95 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 90 50 10 10
+probe rgb 95 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-wr.shader_test
new file mode 100644
index 00000000..988f7157
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-array-mat4-wr.shader_test
@@ -0,0 +1,65 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ dst_matrix[0] = mat4(0.0);
+ dst_matrix[1] = mat4(0.0);
+ dst_matrix[2] = mat4(0.0);
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+ */
+ dst_matrix[1] = src_matrix;
+ dst_matrix[1][1] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int index;
+uniform int col;
+uniform vec4 value;
+varying mat4 dst_matrix[3];
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix[1] * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 90 5 10 10
+probe rgb 95 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-row-wr.shader_test
new file mode 100644
index 00000000..0f607195
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-row-wr.shader_test
@@ -0,0 +1,85 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat2 dst_matrix;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat2 dst_matrix;
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 0.861223395812970 0.603473877011433 0.891622340451180
+uniform float value 0.241498998195656
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 666.0 0.603473877011433 0.891622340451180
+uniform float value 0.861223395812970
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-wr.shader_test
new file mode 100644
index 00000000..f1706ba0
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-col-wr.shader_test
@@ -0,0 +1,65 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int col;
+uniform vec2 value;
+varying mat2 dst_matrix;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int col;
+uniform vec2 value;
+varying mat2 dst_matrix;
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 666.0 777.0 0.603473877011433 0.891622340451180
+uniform vec2 value 0.241498998195656 0.861223395812970
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-row-wr.shader_test
new file mode 100644
index 00000000..37791e74
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-row-wr.shader_test
@@ -0,0 +1,67 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat2 dst_matrix;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat2 dst_matrix;
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 0.891622340451180
+uniform float value 0.603473877011433
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 0.603473877011433 666.0
+uniform float value 0.891622340451180
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-wr.shader_test
new file mode 100644
index 00000000..66fad047
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat2-wr.shader_test
@@ -0,0 +1,56 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int col;
+uniform vec2 value;
+varying mat2 dst_matrix;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat2 src_matrix;
+uniform vec2 v;
+uniform vec2 expect;
+uniform int col;
+uniform vec2 value;
+varying mat2 dst_matrix;
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec2 v 0.803161418975390 0.852987140792140
+uniform vec2 expect 0.708718134966688 1.452243795483797
+uniform mat2x2 src_matrix 0.241498998195656 0.861223395812970 666.0 777.0
+uniform vec2 value 0.603473877011433 0.891622340451180
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-row-wr.shader_test
new file mode 100644
index 00000000..b70b3c2c
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-row-wr.shader_test
@@ -0,0 +1,126 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat3 dst_matrix;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat3 dst_matrix;
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.493944462129466
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 666.0 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.722190133917966
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 666.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.239853948232558
+draw rect 5 35 10 10
+probe rgb 10 40 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 0.511303112962423 0.270815003356504
+uniform float value 0.850846377186973
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 666.0 0.270815003356504
+uniform float value 0.511303112962423
+draw rect 35 20 10 10
+probe rgb 40 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 666.0
+uniform float value 0.270815003356504
+draw rect 35 35 10 10
+probe rgb 40 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-wr.shader_test
new file mode 100644
index 00000000..bc5e3e46
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-col-wr.shader_test
@@ -0,0 +1,73 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int col;
+uniform vec3 value;
+varying mat3 dst_matrix;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int col;
+uniform vec3 value;
+varying mat3 dst_matrix;
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 666.0 777.0 888.0 0.550143078409278 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.493944462129466 0.722190133917966 0.239853948232558
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 0.467616286531193 666.0 777.0 888.0
+uniform vec3 value 0.850846377186973 0.511303112962423 0.270815003356504
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-row-wr.shader_test
new file mode 100644
index 00000000..859d9f33
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-row-wr.shader_test
@@ -0,0 +1,75 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat3 dst_matrix;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat3 dst_matrix;
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 0.591962645398579 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.550143078409278
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 666.0 0.467616286531193 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.591962645398579
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 0.550143078409278 0.591962645398579 666.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform float value 0.467616286531193
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-wr.shader_test
new file mode 100644
index 00000000..770fbdc8
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat3-wr.shader_test
@@ -0,0 +1,56 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int col;
+uniform vec3 value;
+varying mat3 dst_matrix;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat3 src_matrix;
+uniform vec3 v;
+uniform vec3 expect;
+uniform int col;
+uniform vec3 value;
+varying mat3 dst_matrix;
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec3 v 0.681652305322399 0.210426138878113 0.185916924650237
+uniform vec3 expect 0.610649606928364 0.711906885823636 0.312244778977868
+uniform mat3x3 src_matrix 0.493944462129466 0.722190133917966 0.239853948232558 666.0 777.0 888.0 0.850846377186973 0.511303112962423 0.270815003356504
+uniform vec3 value 0.550143078409278 0.591962645398579 0.467616286531193
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-row-wr.shader_test
new file mode 100644
index 00000000..97107f9a
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-row-wr.shader_test
@@ -0,0 +1,183 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat4 dst_matrix;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat4 dst_matrix;
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.922040144261674
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 666.0 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.158053783109488
+draw rect 5 20 10 10
+probe rgb 10 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 666.0 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.357016429866574
+draw rect 5 35 10 10
+probe rgb 10 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 666.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.836368810383957
+draw rect 5 50 10 10
+probe rgb 10 55 0.0 1.0 0.0
+
+uniform int col 1
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 20 50 10 10
+probe rgb 25 55 0.0 1.0 0.0
+
+uniform int col 2
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.350720358904176
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 666.0 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.912192627475775
+draw rect 35 20 10 10
+probe rgb 40 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 666.0 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.688544081259531
+draw rect 35 35 10 10
+probe rgb 40 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 666.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.913891056231967
+draw rect 35 50 10 10
+probe rgb 40 55 0.0 1.0 0.0
+
+uniform int col 3
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.442058176039301
+draw rect 50 5 10 10
+probe rgb 55 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 666.0 0.365674411003021 0.879197364462782
+uniform float value 0.829835836794679
+draw rect 50 20 10 10
+probe rgb 55 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 666.0 0.879197364462782
+uniform float value 0.365674411003021
+draw rect 50 35 10 10
+probe rgb 55 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 666.0
+uniform float value 0.879197364462782
+draw rect 50 50 10 10
+probe rgb 55 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-wr.shader_test
new file mode 100644
index 00000000..edc999ee
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-col-wr.shader_test
@@ -0,0 +1,81 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int col;
+uniform vec4 value;
+varying mat4 dst_matrix;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[col] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int col;
+uniform vec4 value;
+varying mat4 dst_matrix;
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int col 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 666.0 777.0 888.0 999.0 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957
+draw rect 5 5 10 10
+probe rgb 10 10 0.0 1.0 0.0
+
+uniform int col 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int col 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 666.0 777.0 888.0 999.0 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967
+draw rect 35 5 10 10
+probe rgb 40 10 0.0 1.0 0.0
+
+uniform int col 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 666.0 777.0 888.0 999.0
+uniform vec4 value 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+draw rect 50 5 10 10
+probe rgb 55 10 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-row-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-row-wr.shader_test
new file mode 100644
index 00000000..aeca2438
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-row-wr.shader_test
@@ -0,0 +1,83 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat4 dst_matrix;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1][row] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int row;
+uniform int col;
+uniform float value;
+varying mat4 dst_matrix;
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform int row 0
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 0.171634921595771 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.560251913703792
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
+uniform int row 1
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 666.0 0.602494709909111 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.171634921595771
+draw rect 20 20 10 10
+probe rgb 25 25 0.0 1.0 0.0
+
+uniform int row 2
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 666.0 0.693273570571311 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.602494709909111
+draw rect 20 35 10 10
+probe rgb 25 40 0.0 1.0 0.0
+
+uniform int row 3
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 0.560251913703792 0.171634921595771 0.602494709909111 666.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform float value 0.693273570571311
+draw rect 20 50 10 10
+probe rgb 25 55 0.0 1.0 0.0
+
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-wr.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-wr.shader_test
new file mode 100644
index 00000000..377bf894
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-varying-mat4-wr.shader_test
@@ -0,0 +1,56 @@
+# Test generated by:
+# ../../../glsl-1.10/variable-index-write.sh 1.10
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int col;
+uniform vec4 value;
+varying mat4 dst_matrix;
+
+void main()
+{
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+ */
+ dst_matrix = src_matrix;
+ dst_matrix[1] = value;
+}
+
+[fragment shader]
+#version 110
+uniform mat4 src_matrix;
+uniform vec4 v;
+uniform vec4 expect;
+uniform int col;
+uniform vec4 value;
+varying mat4 dst_matrix;
+
+void main()
+{
+ gl_FragColor = (distance(dst_matrix * v, expect) < 1e-6)
+ ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+uniform vec4 v 0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839
+uniform vec4 expect 1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820
+uniform mat4x4 src_matrix 0.922040144261674 0.158053783109488 0.357016429866574 0.836368810383957 666.0 777.0 888.0 999.0 0.350720358904176 0.912192627475775 0.688544081259531 0.913891056231967 0.442058176039301 0.829835836794679 0.365674411003021 0.879197364462782
+uniform vec4 value 0.560251913703792 0.171634921595771 0.602494709909111 0.693273570571311
+draw rect 20 5 10 10
+probe rgb 25 10 0.0 1.0 0.0
+
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 <<EOF
+ /* Patch the supplied matrix with the supplied value. If the resulting
+ * matrix is correct, it will transform the input vector to the expected
+ * value. Verify that the distance between the result and the expected
+ * vector is less than epsilon.
+EOF
+
+ if [ $array_dim -ne 0 ]; then
+ cat <<EOF
+ *
+ * NOTE: This test assumes that reads of arrays using non-constant
+ * indicies works correctly. If reads and writes happen to fail in an
+ * identical manner, this test may give false positives.
+EOF
+ idx="[${index_value}]"
+ else
+ idx=""
+ fi
+
+ echo " */"
+ echo " dst_matrix${idx} = src_matrix;"
+ echo " dst_matrix${idx}${col}${row} = value;"
+}
+
+
+function emit_fs
+{
+ 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 "[fragment shader]"
+ echo "#version ${version/./}"
+
+ emit_globals $*
+
+ echo "void main()"
+ echo "{"
+
+ # Assume for now that fragment shaders can only write to temporaries.
+ # There usually aren't enough MRT outputs for an array of matrices
+ # anyway. Just like with vertex shader array inputs (attribute arrays),
+ # we'll probably need a non-shader_runner test to exercise that path.
+ if [ "x$mode" = "xtemp" ]; then
+ emit_set_matrix $*
+ emit_transform $*
+ fi
+
+ echo " gl_FragColor = (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);"
+ echo "}"
+ echo
+}
+
+
+function emit_test_vectors
+{
+ matrix_dim=$1
+ array_dim=$2
+ mode=$3
+ index_value=$4
+ col=$5
+ value_type=$6
+
+ cat <<EOF
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+EOF
+
+ # NOTE: shader_runner uses the matCxR names even for GLSL 1.10
+ type="mat${matrix_dim}x${matrix_dim}"
+
+ # Random input vector, a random matrix, and the result of multiplying that
+ # vector by that matrix. Naturally, the matrices are listed in OpenGL
+ # column-major order
+ case "${matrix_dim}x${matrix_dim}" in
+ "2x2")
+ vec="0.803161418975390 0.852987140792140"
+ exp="0.708718134966688 1.452243795483797"
+ mat="0.241498998195656 0.861223395812970
+ 0.603473877011433 0.891622340451180"
+ ;;
+ "3x3")
+ vec="0.681652305322399 0.210426138878113 0.185916924650237"
+ exp="0.610649606928364 0.711906885823636 0.312244778977868"
+ mat="0.493944462129466 0.722190133917966 0.239853948232558
+ 0.550143078409278 0.591962645398579 0.467616286531193
+ 0.850846377186973 0.511303112962423 0.270815003356504"
+ ;;
+ "4x4")
+ vec="0.0394868046587045 0.8922408276905568 0.3337495624366961 0.8732295730825839"
+ exp="1.03935908892461 1.18846180713529 1.10078681232072 1.72434439561820"
+ mat="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 0.879197364462782"
+ ;;
+ esac
+
+ # Trim out the extra whitespace from the matrix data. The extra space
+ # (above) makes it easier to read, but it makes it harder to generate
+ # sensible test scripts.
+ mat=$(echo $mat | tr '\n' ' ' | sed 's/[[:space:]]\+/ /g;s/[[:space:]]*$//g')
+
+ if [ $array_dim -eq 0 ]; then
+ sizes="1"
+ elif [ "x$index_value" = "xindex" ]; then
+ sizes=$(seq $array_dim)
+ else
+ sizes="2"
+ fi
+
+ if [ "x$value_type" = "xfloat" ]; then
+ rows=$(seq $matrix_dim)
+ bad="666.0"
+ else
+ rows=1
+ case $matrix_dim in
+ 2) bad="666.0 777.0";;
+ 3) bad="666.0 777.0 888.0";;
+ 4) bad="666.0 777.0 888.0 999.0";;
+ esac
+ fi
+
+ if [ "x$col" = "xcol" ]; then
+ columns=$(seq $matrix_dim)
+ else
+ columns="2"
+ fi
+
+ for i in $sizes; do
+ if [ $array_dim -ne 0 -a "x$index_value" = "xindex" ]; then
+ echo "uniform int index $((i-1))"
+ fi
+
+ x_base=$(((i - 1) * (15 * matrix_dim + 10)))
+ for c in $columns; do
+ if [ "x$col" = "xcol" ]; then
+ echo "uniform int col $((c-1))"
+ fi
+
+ for r in $rows; do
+ if [ "x$value_type" = "xfloat" ]; then
+ echo "uniform int row $((r-1))"
+ fi
+
+ d=$((matrix_dim * (c-1) + (r-1) + 1))
+ if [ "x$value_type" = "xfloat" ]; then
+ v=$(echo $mat | cut -d' ' -f$d)
+ else
+ v=$(echo $mat | cut -d' ' -f$d-$((d+matrix_dim-1)))
+ fi
+
+ echo "uniform vec${matrix_dim} v ${vec}"
+ echo "uniform vec${matrix_dim} expect ${exp}"
+ echo "uniform ${type} src_matrix ${mat/$v/$bad}"
+ echo "uniform ${value_type} value $v"
+
+ x=$((x_base + 15 * c - 10))
+ y=$((15 * r - 10))
+ echo "draw rect $x $y 10 10"
+
+ x=$(($x + 5))
+ y=$(($y + 5))
+ echo "probe rgb $x $y 0.0 1.0 0.0"
+ echo
+ done
+ done
+ done
+}
+
+
+function emit_fs_wr_test
+{
+ echo "# Test generated by:"
+ echo "# ${cmd}"
+ echo
+ echo "[require]"
+ echo "GLSL >= 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
+