bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-ir.txt
2014-02-10 23:06:13 -08:00

92 lines
2.1 KiB
Text

struct v2f_img {
vec4 pos;
vec2 uv;
};
uniform vec4 _AdaptParams;
uniform sampler2D _CurTex;
uniform sampler2D _MainTex;
vec4 frag (
in v2f_img i_1
)
{
vec4 valNew_2;
vec2 delta_3;
vec2 valCur_4;
vec2 valAdapted_5;
vec4 tmpvar_6;
tmpvar_6 = texture2D (_MainTex, i_1.uv);
vec2 tmpvar_7;
tmpvar_7 = tmpvar_6.xy;
valAdapted_5 = tmpvar_7;
vec4 tmpvar_8;
tmpvar_8 = texture2D (_CurTex, i_1.uv);
vec2 tmpvar_9;
tmpvar_9 = tmpvar_8.xy;
valCur_4 = tmpvar_9;
vec2 tmpvar_10;
tmpvar_10 = ((valCur_4 - valAdapted_5) * _AdaptParams.x);
delta_3 = tmpvar_10;
float tmpvar_11;
tmpvar_11 = sign (delta_3.x);
float tmpvar_12;
tmpvar_12 = abs (delta_3.x);
float tmpvar_13;
tmpvar_13 = max (0.00392157, tmpvar_12);
float tmpvar_14;
tmpvar_14 = (tmpvar_11 * tmpvar_13);
delta_3.x = tmpvar_14;
float tmpvar_15;
tmpvar_15 = sign (delta_3.y);
float tmpvar_16;
tmpvar_16 = abs (delta_3.y);
float tmpvar_17;
tmpvar_17 = max (0.00392157, tmpvar_16);
float tmpvar_18;
tmpvar_18 = (tmpvar_15 * tmpvar_17);
delta_3.y = vec2(tmpvar_18).y;
vec2 tmpvar_19;
tmpvar_19 = (valAdapted_5 + delta_3);
valNew_2.xy = tmpvar_19.xy.xy;
float tmpvar_20;
tmpvar_20 = max (valNew_2.x, _AdaptParams.z);
float tmpvar_21;
tmpvar_21 = tmpvar_20;
valNew_2.x = tmpvar_21;
float tmpvar_22;
tmpvar_22 = min (valNew_2.y, _AdaptParams.y);
float tmpvar_23;
tmpvar_23 = tmpvar_22;
valNew_2.y = vec2(tmpvar_23).y;
float tmpvar_24;
tmpvar_24 = ((valNew_2.x - valNew_2.y) + 0.01);
valNew_2.z = vec3(tmpvar_24).z;
float tmpvar_25;
tmpvar_25 = (valNew_2.y / valNew_2.z);
valNew_2.w = vec4(tmpvar_25).w;
return valNew_2;
}
void main ()
{
v2f_img xlt_i_26;
vec4 xl_retval_27;
vec4 tmpvar_28;
tmpvar_28 = vec4(0.0, 0.0, 0.0, 0.0);
xlt_i_26.pos = tmpvar_28;
vec2 tmpvar_29;
tmpvar_29 = gl_TexCoord[0].xy;
vec2 tmpvar_30;
tmpvar_30 = tmpvar_29;
xlt_i_26.uv = tmpvar_30;
vec4 tmpvar_31;
tmpvar_31 = frag (xlt_i_26);
vec4 tmpvar_32;
tmpvar_32 = tmpvar_31;
xl_retval_27 = tmpvar_32;
vec4 tmpvar_33;
tmpvar_33 = xl_retval_27.xyzw;
vec4 tmpvar_34;
tmpvar_34 = tmpvar_33;
gl_FragData[0] = tmpvar_34;
}