Open tksuoran opened 8 years ago
Hmm, it turns out the device which rejected the shader was actually incorrectly rejecting indexing with loop index in fragment shader, no matter what form. So I no longer care about this issue, although it would be nice to know if it is valid issue or not.
It was intended that glslangValidator check this, however it appears that the check was implemented incorrectly and is too lax. It also allows a global variable as a loop index, which the spec language clearly prohibits.
In https://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf it is stated that
Strictly reading the specification, type-specifier is required. If I have the following fragment shader code
int i; for (i = 0; i < 2; ++i)
I cannot use i to index uniform arrays, because type-specifier is missing inside for. I have observed that glslang allows indexing uniform arrays in this case. I would like glslang to report an error.