bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-in.txt
2013-03-17 11:29:03 -07:00

19 lines
445 B
Text

// Used to expose bugs in constant variable optimization,
// when variables were deemed constant not taking into
// account branches or previous dereferences of them.
uniform float mode;
float func (float c) {
if (mode == 2.0)
return c;
if (mode == 3.0)
discard;
if (mode == 10.0)
c = 0.1;
return c;
}
void main() {
vec4 c = gl_FragCoord;
c.x = func(c.x);
gl_FragColor = c;
}