bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-in.txt
Branimir Karadzic dee3fe5266 Initial commit.
2012-04-03 20:30:07 -07:00

17 lines
759 B
Text

vec4 xlat_main( in vec4 uv );
vec4 xlat_main( in vec4 uv ) {
vec4 c;
c = vec4( 0.000000);
c += ( (uv.x > 0.500000) ) ? ( 0.900000 ) : ( 0.100000 );
c += ( (uv.x > 0.500000) ) ? ( vec4( 0.900000, 0.900000, 0.900000, 0.900000) ) : ( vec4( 0.100000, 0.100000, 0.100000, 0.100000) );
c.xyz += ( (uv.x > 0.500000) ) ? ( vec3( 0.900000, 0.900000, 0.900000) ) : ( vec3( 0.100000, 0.100000, 0.100000) );
c.xy += ( (uv.x > 0.500000) ) ? ( vec2( 0.900000, 0.900000) ) : ( vec2( 0.100000, 0.100000) );
c.x += ( bool( fract( uv.x ) ) ) ? ( 0.900000 ) : ( 0.100000 );
return c;
}
varying vec4 xlv_TEXCOORD0;
void main() {
vec4 xl_retval;
xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
gl_FragData[0] = vec4( xl_retval);
}