bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-in.txt
2014-02-10 23:06:13 -08:00

14 lines
290 B
Text

uniform sampler2D maintex;
uniform float factor;
varying vec2 uv;
void main()
{
vec4 c = texture2D (maintex, uv);
vec2 coord = c.xy;
bool cond = c.w >= 0.5;
if (!cond)
coord.x += factor;
if (cond)
coord.y += factor;
gl_FragColor = vec4(coord,0,0);
}