According to the GLSL spec the only way to access members of a matrix is using array subscripting syntax:
5.6 Matrix Components
The components of a matrix can be accessed using array subscripting syntax. Applying a single subscript
to a matrix treats the matrix as an array of column vectors, and selects a single column, whose type is a
vector of the same size as the matrix. The leftmost column is column 0. A second subscript would then
operate on the column vector, as defined earlier for vectors. Hence, two subscripts select a column and
then a row.
m = vec4(2.0); // sets the second column to all 2.0
m = 1.0; // sets the upper left element to 1.0
m = 2.0; // sets the 4th element of the third column to 2.0
Behavior is undefined when accessing a component outside the bounds of a matrix with a non-constant
expression. It is an error to access a matrix with a constant expression that is outside the bounds of the
It should not work when using a uniform buffer as well. It seems the NVIDIA compiler is taking another path there.
If you change to it should work.