bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-irES.txt
2012-10-07 20:41:18 -07:00

101 lines
2.4 KiB
Text

struct v2f {
highp vec4 pos;
highp vec4 uv;
highp vec3 ray;
};
struct appdata {
highp vec4 vertex;
highp vec3 normal;
};
varying highp vec3 xlv_TEXCOORD1;
varying highp vec4 xlv_TEXCOORD0;
uniform highp mat4 glstate_matrix_mvp;
uniform highp mat4 glstate_matrix_modelview0;
uniform highp vec4 _ProjectionParams;
attribute lowp vec4 _glesColor;
attribute highp vec4 _glesMultiTexCoord1;
attribute highp vec4 _glesMultiTexCoord0;
attribute mediump vec3 _glesNormal;
attribute highp vec4 _glesVertex;
vec4 ComputeScreenPos (
in highp vec4 pos_1
)
{
highp vec4 o_2;
highp vec4 tmpvar_3;
tmpvar_3 = (pos_1 * 0.5);
o_2 = tmpvar_3;
highp vec2 tmpvar_4;
tmpvar_4.x = o_2.x;
tmpvar_4.y = (o_2.y * _ProjectionParams.x);
highp vec2 tmpvar_5;
tmpvar_5 = (tmpvar_4 + o_2.w);
o_2.xy = tmpvar_5.xy.xy;
highp vec2 tmpvar_6;
tmpvar_6 = pos_1.zw;
o_2.zw = tmpvar_6.xxxy.zw;
return o_2;
}
v2f xlat_main (
in appdata v_7
)
{
v2f o_8;
highp vec4 tmpvar_9;
tmpvar_9 = (glstate_matrix_mvp * v_7.vertex);
o_8.pos = tmpvar_9;
highp vec4 tmpvar_10;
tmpvar_10 = ComputeScreenPos (o_8.pos);
highp vec4 tmpvar_11;
tmpvar_11 = tmpvar_10;
o_8.uv = tmpvar_11;
highp vec3 tmpvar_12;
tmpvar_12 = ((glstate_matrix_modelview0 * v_7.vertex).xyz * vec3(-1.0, -1.0, 1.0));
o_8.ray = tmpvar_12;
highp vec3 tmpvar_13;
tmpvar_13 = vec3(float((v_7.normal.z != 0.0)));
highp vec3 tmpvar_14;
tmpvar_14 = mix (o_8.ray, v_7.normal, tmpvar_13);
highp vec3 tmpvar_15;
tmpvar_15 = tmpvar_14;
o_8.ray = tmpvar_15;
return o_8;
}
void main ()
{
appdata xlt_v_16;
v2f xl_retval_17;
highp vec4 tmpvar_18;
tmpvar_18 = _glesVertex.xyzw;
highp vec4 tmpvar_19;
tmpvar_19 = tmpvar_18;
xlt_v_16.vertex = tmpvar_19;
highp vec3 tmpvar_20;
tmpvar_20 = _glesNormal.xyz;
highp vec3 tmpvar_21;
tmpvar_21 = tmpvar_20;
xlt_v_16.normal = tmpvar_21;
v2f tmpvar_22;
tmpvar_22 = xlat_main (xlt_v_16);
v2f tmpvar_23;
tmpvar_23 = tmpvar_22;
xl_retval_17 = tmpvar_23;
highp vec4 tmpvar_24;
tmpvar_24 = xl_retval_17.pos.xyzw;
highp vec4 tmpvar_25;
tmpvar_25 = tmpvar_24;
gl_Position = tmpvar_25;
highp vec4 tmpvar_26;
tmpvar_26 = xl_retval_17.uv.xyzw;
highp vec4 tmpvar_27;
tmpvar_27 = tmpvar_26;
xlv_TEXCOORD0 = tmpvar_27;
highp vec3 tmpvar_28;
tmpvar_28 = xl_retval_17.ray.xyz;
highp vec3 tmpvar_29;
tmpvar_29 = tmpvar_28;
xlv_TEXCOORD1 = tmpvar_29;
}