mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
22 lines
333 B
Text
22 lines
333 B
Text
|
// 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;
|
||
|
}
|