bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES3.txt
2014-10-11 12:32:43 -07:00

28 lines
1.3 KiB
Text

#version 300 es
out lowp vec4 _fragData;
vec2 xll_vecTSel (bvec2 a, vec2 b, vec2 c) {
return vec2 (a.x ? b.x : c.x, a.y ? b.y : c.y);
}
vec3 xll_vecTSel (bvec3 a, vec3 b, vec3 c) {
return vec3 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z);
}
vec4 xll_vecTSel (bvec4 a, vec4 b, vec4 c) {
return vec4 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z, a.w ? b.w : c.w);
}
mediump vec4 xlat_main( in highp vec4 uv );
mediump vec4 xlat_main( in highp vec4 uv ) {
highp vec4 a;
a = vec4( 0.000000);
a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1.00000, 2.00000, 3.00000, 4.00000), vec4( 5.00000, 6.00000, 7.00000, 8.00000));
a += xll_vecTSel (greaterThan( uv, vec4( 0.500000, 0.500000, 0.500000, 0.500000)), vec4( 1.00000, 2.00000, 3.00000, 4.00000), vec4( 5.00000, 6.00000, 7.00000, 8.00000));
a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1.00000, 1.00000, 1.00000, 1.00000), vec4( 2.00000, 2.00000, 2.00000, 2.00000));
a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1), vec4( 2));
a += xll_vecTSel (bvec4( fract( uv ) ), vec4( 1.00000, 1.00000, 1.00000, 1.00000), vec4( 2.00000, 2.00000, 2.00000, 2.00000));
return a;
}
in highp vec4 xlv_TEXCOORD0;
void main() {
mediump vec4 xl_retval;
xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
_fragData = vec4( xl_retval);
}