in shader:
uniform vec3 BrickColor[2], MortarColor;
uniform vec2 BrickSize;
uniform vec2 BrickPct;
uniform mat3 myMat;
in order to set these uniform, app do like this:
float fv[6] =
{
1.0, 0.3, 0.2,
0.5, 0.4, 0.6
};
float fm[9] =
{
1.0, 2.0, 3.0,
4.0, 5.0, 6.0,
7.0, 8.0, 9.0
};
glUniformMatrix3fvARB(glGetUniformLocationARB(brickProg, "myMat"), 1, GL_FALSE, fm);
glUniform3fvARB(glGetUniformLocationARB(brickProg, "BrickColor"), 2, fv);
the result is:
BrickColor[0] = 1.0, 0.3, 0.2
BrickColor[1] = 0.5, 0.4, 0.6
***myMat = 0.5, 0.4, 0.6,
4.0, 5.0, 6.0,
7.0, 8.0, 9.0
It seems that only 1 vec3 is allocated to the BrickColor array other than 2 vec3 while linking shader. So brickColor[1] and mat[0] share the memory, and the first column is writen by BrickColor[1] in this example.
Is this a bug?