bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-in.txt

27 lines
1.3 KiB
Text
Raw Normal View History

2012-04-03 23:30:07 -04:00
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);
}
vec4 xlat_main( in vec4 uv );
vec4 xlat_main( in vec4 uv ) {
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;
}
varying vec4 xlv_TEXCOORD0;
void main() {
vec4 xl_retval;
xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
gl_FragData[0] = vec4( xl_retval);
}