bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-in.txt

22 lines
333 B
Text
Raw Normal View History

2014-03-29 19:26:01 -04:00
// 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;
}