bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-in.txt
2014-03-29 16:26:01 -07:00

22 lines
333 B
Plaintext

// https://github.com/aras-p/glsl-optimizer/issues/49
uniform int loopNum;
void main() {
int myIdx;
vec4 r = vec4(0.0);
myIdx = 1;
for ( ; myIdx < loopNum; ++myIdx) {
r.x += 1.0;
r.y += 2.0;
r.z += 3.0;
}
myIdx = 2;
for ( ; myIdx < loopNum; ++myIdx) {
r.x += 1.0;
r.y += 2.0;
r.z += 3.0;
}
gl_FragColor = r;
}