Shaders below reproduce this bug on Galaxy S7 Edge with adreno 530 inside.
Vertex Shader:
uniform mediump vec4 Array[20];
attribute vec4 Position;
varying mediump vec4 Out;
void main() {
gl_Position = Array[1] + Position;
Out = Array[4];
}
Fragment Shader
uniform mediump vec4 Array[20];
varying mediump vec4 Out;
void main() {
gl_FragColor = Out + Array[3];
}
Compile the shaders and attach them to the same program object.
Use API glGetActiveUniform check uniform "Array[", we get the wrong num 4, but the right answer must be 5 or more.
It seems that when both vs & fs references the same array uniform, the linked program use the number that fs actually used instead of max(vs used, fs used)
We have confirmed this is an open issue and should be able to provide an update in future drivers. Thanks for bringing it to our attention