bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt

293 lines
8.6 KiB
Text
Raw Normal View History

2012-10-07 23:41:18 -04:00
#extension GL_ARB_shader_texture_lod : enable
uniform sampler2D _MainTex;
2014-02-11 02:06:13 -05:00
uniform vec4 _MainTex_TexelSize;
varying vec2 xlv_TEXCOORD0;
2012-10-07 23:41:18 -04:00
void main ()
{
vec2 rcpFrame_1;
rcpFrame_1 = _MainTex_TexelSize.xy;
vec3 tmpvar_2;
bool doneP_4;
bool doneN_5;
float lumaEndP_6;
float lumaEndN_7;
vec2 offNP_8;
vec2 posP_9;
vec2 posN_10;
float gradientN_11;
float lengthSign_12;
2014-10-11 15:32:43 -04:00
vec3 rgbL_13;
float lumaS_14;
float lumaN_15;
2012-10-07 23:41:18 -04:00
vec4 tmpvar_16;
2014-10-11 15:32:43 -04:00
tmpvar_16.zw = vec2(0.0, 0.0);
tmpvar_16.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy));
2012-10-07 23:41:18 -04:00
vec4 tmpvar_17;
2014-10-11 15:32:43 -04:00
tmpvar_17 = texture2DLod (_MainTex, tmpvar_16.xy, 0.0);
2012-10-07 23:41:18 -04:00
vec4 tmpvar_18;
2014-10-11 15:32:43 -04:00
tmpvar_18.zw = vec2(0.0, 0.0);
tmpvar_18.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy));
2012-10-07 23:41:18 -04:00
vec4 tmpvar_19;
2014-10-11 15:32:43 -04:00
tmpvar_19 = texture2DLod (_MainTex, tmpvar_18.xy, 0.0);
2012-10-07 23:41:18 -04:00
vec4 tmpvar_20;
2014-10-11 15:32:43 -04:00
tmpvar_20 = texture2DLod (_MainTex, xlv_TEXCOORD0, 0.0);
2012-10-07 23:41:18 -04:00
vec4 tmpvar_21;
2014-10-11 15:32:43 -04:00
tmpvar_21.zw = vec2(0.0, 0.0);
tmpvar_21.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy));
2012-10-07 23:41:18 -04:00
vec4 tmpvar_22;
2014-10-11 15:32:43 -04:00
tmpvar_22 = texture2DLod (_MainTex, tmpvar_21.xy, 0.0);
2012-10-07 23:41:18 -04:00
vec4 tmpvar_23;
2014-10-11 15:32:43 -04:00
tmpvar_23.zw = vec2(0.0, 0.0);
tmpvar_23.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy));
vec4 tmpvar_24;
tmpvar_24 = texture2DLod (_MainTex, tmpvar_23.xy, 0.0);
2012-10-07 23:41:18 -04:00
float tmpvar_25;
2015-04-03 02:30:48 -04:00
tmpvar_25 = ((tmpvar_17.y * 1.963211) + tmpvar_17.x);
2014-10-11 15:32:43 -04:00
lumaN_15 = tmpvar_25;
2012-10-07 23:41:18 -04:00
float tmpvar_26;
2015-04-03 02:30:48 -04:00
tmpvar_26 = ((tmpvar_19.y * 1.963211) + tmpvar_19.x);
2012-10-07 23:41:18 -04:00
float tmpvar_27;
2015-04-03 02:30:48 -04:00
tmpvar_27 = ((tmpvar_20.y * 1.963211) + tmpvar_20.x);
2012-10-07 23:41:18 -04:00
float tmpvar_28;
2015-04-03 02:30:48 -04:00
tmpvar_28 = ((tmpvar_22.y * 1.963211) + tmpvar_22.x);
2012-10-07 23:41:18 -04:00
float tmpvar_29;
2015-04-03 02:30:48 -04:00
tmpvar_29 = ((tmpvar_24.y * 1.963211) + tmpvar_24.x);
2014-10-11 15:32:43 -04:00
lumaS_14 = tmpvar_29;
2012-10-07 23:41:18 -04:00
float tmpvar_30;
2014-10-11 15:32:43 -04:00
tmpvar_30 = max (max (tmpvar_27, tmpvar_25), max (max (tmpvar_26, tmpvar_29), tmpvar_28));
2012-10-07 23:41:18 -04:00
float tmpvar_31;
2014-10-11 15:32:43 -04:00
tmpvar_31 = (tmpvar_30 - min (min (tmpvar_27, tmpvar_25), min (
min (tmpvar_26, tmpvar_29)
, tmpvar_28)));
float tmpvar_32;
2015-04-03 02:30:48 -04:00
tmpvar_32 = max (0.04166667, (tmpvar_30 * 0.125));
2014-10-11 15:32:43 -04:00
if ((tmpvar_31 < tmpvar_32)) {
tmpvar_2 = tmpvar_20.xyz;
2012-10-07 23:41:18 -04:00
} else {
2014-10-11 15:32:43 -04:00
float tmpvar_33;
tmpvar_33 = min (0.75, (max (0.0,
2014-02-11 02:06:13 -05:00
((abs((
2014-10-11 15:32:43 -04:00
(((tmpvar_25 + tmpvar_26) + (tmpvar_28 + tmpvar_29)) * 0.25)
- tmpvar_27)) / tmpvar_31) - 0.25)
2015-04-03 02:30:48 -04:00
) * 1.333333));
2012-10-07 23:41:18 -04:00
vec4 tmpvar_34;
2014-10-11 15:32:43 -04:00
tmpvar_34.zw = vec2(0.0, 0.0);
tmpvar_34.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy);
2012-10-07 23:41:18 -04:00
vec4 tmpvar_35;
2014-10-11 15:32:43 -04:00
tmpvar_35 = texture2DLod (_MainTex, tmpvar_34.xy, 0.0);
2012-10-07 23:41:18 -04:00
vec4 tmpvar_36;
2014-10-11 15:32:43 -04:00
tmpvar_36.zw = vec2(0.0, 0.0);
tmpvar_36.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy));
2012-10-07 23:41:18 -04:00
vec4 tmpvar_37;
2014-10-11 15:32:43 -04:00
tmpvar_37 = texture2DLod (_MainTex, tmpvar_36.xy, 0.0);
2012-10-07 23:41:18 -04:00
vec4 tmpvar_38;
2014-10-11 15:32:43 -04:00
tmpvar_38.zw = vec2(0.0, 0.0);
tmpvar_38.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy));
2012-10-07 23:41:18 -04:00
vec4 tmpvar_39;
2014-10-11 15:32:43 -04:00
tmpvar_39 = texture2DLod (_MainTex, tmpvar_38.xy, 0.0);
2012-10-07 23:41:18 -04:00
vec4 tmpvar_40;
2014-10-11 15:32:43 -04:00
tmpvar_40.zw = vec2(0.0, 0.0);
tmpvar_40.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy);
vec4 tmpvar_41;
tmpvar_41 = texture2DLod (_MainTex, tmpvar_40.xy, 0.0);
rgbL_13 = (((tmpvar_17.xyz + tmpvar_19.xyz) + (tmpvar_20.xyz + tmpvar_22.xyz)) + ((tmpvar_24.xyz + tmpvar_35.xyz) + (
(tmpvar_37.xyz + tmpvar_39.xyz)
+ tmpvar_41.xyz)));
2015-04-03 02:30:48 -04:00
rgbL_13 = (rgbL_13 * vec3(0.1111111, 0.1111111, 0.1111111));
2012-10-07 23:41:18 -04:00
float tmpvar_42;
2015-04-03 02:30:48 -04:00
tmpvar_42 = ((tmpvar_35.y * 1.963211) + tmpvar_35.x);
2012-10-07 23:41:18 -04:00
float tmpvar_43;
2015-04-03 02:30:48 -04:00
tmpvar_43 = ((tmpvar_37.y * 1.963211) + tmpvar_37.x);
2012-10-07 23:41:18 -04:00
float tmpvar_44;
2015-04-03 02:30:48 -04:00
tmpvar_44 = ((tmpvar_39.y * 1.963211) + tmpvar_39.x);
2012-10-07 23:41:18 -04:00
float tmpvar_45;
2015-04-03 02:30:48 -04:00
tmpvar_45 = ((tmpvar_41.y * 1.963211) + tmpvar_41.x);
2012-10-07 23:41:18 -04:00
bool tmpvar_46;
2014-02-11 02:06:13 -05:00
tmpvar_46 = (((
2014-10-11 15:32:43 -04:00
abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_26)) + (0.25 * tmpvar_44)))
2014-02-11 02:06:13 -05:00
+
2014-10-11 15:32:43 -04:00
abs((((0.5 * tmpvar_25) - tmpvar_27) + (0.5 * tmpvar_29)))
2014-02-11 02:06:13 -05:00
) + abs(
2014-10-11 15:32:43 -04:00
(((0.25 * tmpvar_43) + (-0.5 * tmpvar_28)) + (0.25 * tmpvar_45))
2014-02-11 02:06:13 -05:00
)) >= ((
2014-10-11 15:32:43 -04:00
abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_25)) + (0.25 * tmpvar_43)))
2014-02-11 02:06:13 -05:00
+
2014-10-11 15:32:43 -04:00
abs((((0.5 * tmpvar_26) - tmpvar_27) + (0.5 * tmpvar_28)))
2014-02-11 02:06:13 -05:00
) + abs(
2014-10-11 15:32:43 -04:00
(((0.25 * tmpvar_44) + (-0.5 * tmpvar_29)) + (0.25 * tmpvar_45))
2014-02-11 02:06:13 -05:00
)));
2012-10-07 23:41:18 -04:00
float tmpvar_47;
if (tmpvar_46) {
tmpvar_47 = -(_MainTex_TexelSize.y);
} else {
tmpvar_47 = -(_MainTex_TexelSize.x);
};
lengthSign_12 = tmpvar_47;
if (!(tmpvar_46)) {
2014-10-11 15:32:43 -04:00
lumaN_15 = tmpvar_26;
2012-10-07 23:41:18 -04:00
};
if (!(tmpvar_46)) {
2014-10-11 15:32:43 -04:00
lumaS_14 = tmpvar_28;
2012-10-07 23:41:18 -04:00
};
float tmpvar_48;
2014-10-11 15:32:43 -04:00
tmpvar_48 = abs((lumaN_15 - tmpvar_27));
2012-10-07 23:41:18 -04:00
gradientN_11 = tmpvar_48;
float tmpvar_49;
2014-10-11 15:32:43 -04:00
tmpvar_49 = abs((lumaS_14 - tmpvar_27));
lumaN_15 = ((lumaN_15 + tmpvar_27) * 0.5);
lumaS_14 = ((lumaS_14 + tmpvar_27) * 0.5);
bool tmpvar_50;
tmpvar_50 = (tmpvar_48 >= tmpvar_49);
if (!(tmpvar_50)) {
lumaN_15 = lumaS_14;
2012-10-07 23:41:18 -04:00
};
2014-10-11 15:32:43 -04:00
if (!(tmpvar_50)) {
2012-10-07 23:41:18 -04:00
gradientN_11 = tmpvar_49;
};
2014-10-11 15:32:43 -04:00
if (!(tmpvar_50)) {
2014-02-11 02:06:13 -05:00
lengthSign_12 = -(tmpvar_47);
2012-10-07 23:41:18 -04:00
};
2014-10-11 15:32:43 -04:00
float tmpvar_51;
2012-10-07 23:41:18 -04:00
if (tmpvar_46) {
2014-10-11 15:32:43 -04:00
tmpvar_51 = 0.0;
2012-10-07 23:41:18 -04:00
} else {
2014-10-11 15:32:43 -04:00
tmpvar_51 = (lengthSign_12 * 0.5);
2012-10-07 23:41:18 -04:00
};
2014-10-11 15:32:43 -04:00
posN_10.x = (xlv_TEXCOORD0.x + tmpvar_51);
float tmpvar_52;
2012-10-07 23:41:18 -04:00
if (tmpvar_46) {
2014-10-11 15:32:43 -04:00
tmpvar_52 = (lengthSign_12 * 0.5);
2012-10-07 23:41:18 -04:00
} else {
2014-10-11 15:32:43 -04:00
tmpvar_52 = 0.0;
2012-10-07 23:41:18 -04:00
};
2014-10-11 15:32:43 -04:00
posN_10.y = (xlv_TEXCOORD0.y + tmpvar_52);
2012-10-07 23:41:18 -04:00
gradientN_11 = (gradientN_11 * 0.25);
posP_9 = posN_10;
2014-10-11 15:32:43 -04:00
vec2 tmpvar_53;
2012-10-07 23:41:18 -04:00
if (tmpvar_46) {
2014-10-11 15:32:43 -04:00
vec2 tmpvar_54;
tmpvar_54.y = 0.0;
tmpvar_54.x = rcpFrame_1.x;
tmpvar_53 = tmpvar_54;
2012-10-07 23:41:18 -04:00
} else {
2014-10-11 15:32:43 -04:00
vec2 tmpvar_55;
tmpvar_55.x = 0.0;
tmpvar_55.y = rcpFrame_1.y;
tmpvar_53 = tmpvar_55;
2012-10-07 23:41:18 -04:00
};
2014-10-11 15:32:43 -04:00
offNP_8 = tmpvar_53;
lumaEndN_7 = lumaN_15;
lumaEndP_6 = lumaN_15;
2013-03-17 14:29:03 -04:00
doneN_5 = bool(0);
doneP_4 = bool(0);
2014-10-11 15:32:43 -04:00
posN_10 = (posN_10 - tmpvar_53);
posP_9 = (posP_9 + tmpvar_53);
2014-02-11 02:06:13 -05:00
for (int i_3 = 0; i_3 < 16; i_3++) {
2012-10-07 23:41:18 -04:00
if (!(doneN_5)) {
2014-10-11 15:32:43 -04:00
vec4 tmpvar_56;
tmpvar_56 = texture2DLod (_MainTex, posN_10, 0.0);
2015-04-03 02:30:48 -04:00
lumaEndN_7 = ((tmpvar_56.y * 1.963211) + tmpvar_56.x);
2012-10-07 23:41:18 -04:00
};
if (!(doneP_4)) {
2014-10-11 15:32:43 -04:00
vec4 tmpvar_57;
tmpvar_57 = texture2DLod (_MainTex, posP_9, 0.0);
2015-04-03 02:30:48 -04:00
lumaEndP_6 = ((tmpvar_57.y * 1.963211) + tmpvar_57.x);
2012-10-07 23:41:18 -04:00
};
2014-10-11 15:32:43 -04:00
bool tmpvar_58;
2012-10-07 23:41:18 -04:00
if (doneN_5) {
2014-10-11 15:32:43 -04:00
tmpvar_58 = bool(1);
2012-10-07 23:41:18 -04:00
} else {
2014-10-11 15:32:43 -04:00
tmpvar_58 = (abs((lumaEndN_7 - lumaN_15)) >= gradientN_11);
2012-10-07 23:41:18 -04:00
};
2014-10-11 15:32:43 -04:00
doneN_5 = tmpvar_58;
bool tmpvar_59;
2012-10-07 23:41:18 -04:00
if (doneP_4) {
2014-10-11 15:32:43 -04:00
tmpvar_59 = bool(1);
2012-10-07 23:41:18 -04:00
} else {
2014-10-11 15:32:43 -04:00
tmpvar_59 = (abs((lumaEndP_6 - lumaN_15)) >= gradientN_11);
2012-10-07 23:41:18 -04:00
};
2014-10-11 15:32:43 -04:00
doneP_4 = tmpvar_59;
if ((tmpvar_58 && tmpvar_59)) {
2012-10-07 23:41:18 -04:00
break;
};
2014-10-11 15:32:43 -04:00
if (!(tmpvar_58)) {
2012-10-07 23:41:18 -04:00
posN_10 = (posN_10 - offNP_8);
};
2014-10-11 15:32:43 -04:00
if (!(tmpvar_59)) {
2012-10-07 23:41:18 -04:00
posP_9 = (posP_9 + offNP_8);
};
};
2014-10-11 15:32:43 -04:00
float tmpvar_60;
2012-10-07 23:41:18 -04:00
if (tmpvar_46) {
2014-10-11 15:32:43 -04:00
tmpvar_60 = (xlv_TEXCOORD0.x - posN_10.x);
2012-10-07 23:41:18 -04:00
} else {
2014-10-11 15:32:43 -04:00
tmpvar_60 = (xlv_TEXCOORD0.y - posN_10.y);
2012-10-07 23:41:18 -04:00
};
2014-10-11 15:32:43 -04:00
float tmpvar_61;
2012-10-07 23:41:18 -04:00
if (tmpvar_46) {
2014-10-11 15:32:43 -04:00
tmpvar_61 = (posP_9.x - xlv_TEXCOORD0.x);
2012-10-07 23:41:18 -04:00
} else {
2014-10-11 15:32:43 -04:00
tmpvar_61 = (posP_9.y - xlv_TEXCOORD0.y);
2012-10-07 23:41:18 -04:00
};
2014-10-11 15:32:43 -04:00
bool tmpvar_62;
tmpvar_62 = (tmpvar_60 < tmpvar_61);
float tmpvar_63;
if (tmpvar_62) {
tmpvar_63 = lumaEndN_7;
2012-10-07 23:41:18 -04:00
} else {
2014-10-11 15:32:43 -04:00
tmpvar_63 = lumaEndP_6;
2012-10-07 23:41:18 -04:00
};
2014-10-11 15:32:43 -04:00
lumaEndN_7 = tmpvar_63;
if ((((tmpvar_27 - lumaN_15) < 0.0) == ((tmpvar_63 - lumaN_15) < 0.0))) {
2012-10-07 23:41:18 -04:00
lengthSign_12 = 0.0;
};
2014-10-11 15:32:43 -04:00
float tmpvar_64;
tmpvar_64 = (tmpvar_61 + tmpvar_60);
2012-10-07 23:41:18 -04:00
float tmpvar_65;
2014-10-11 15:32:43 -04:00
if (tmpvar_62) {
tmpvar_65 = tmpvar_60;
2012-10-07 23:41:18 -04:00
} else {
2014-10-11 15:32:43 -04:00
tmpvar_65 = tmpvar_61;
2012-10-07 23:41:18 -04:00
};
2014-10-11 15:32:43 -04:00
float tmpvar_66;
tmpvar_66 = ((0.5 + (tmpvar_65 *
(-1.0 / tmpvar_64)
2014-02-11 02:06:13 -05:00
)) * lengthSign_12);
2014-10-11 15:32:43 -04:00
float tmpvar_67;
2012-10-07 23:41:18 -04:00
if (tmpvar_46) {
2014-10-11 15:32:43 -04:00
tmpvar_67 = 0.0;
2012-10-07 23:41:18 -04:00
} else {
2014-10-11 15:32:43 -04:00
tmpvar_67 = tmpvar_66;
2012-10-07 23:41:18 -04:00
};
2014-10-11 15:32:43 -04:00
float tmpvar_68;
2012-10-07 23:41:18 -04:00
if (tmpvar_46) {
2014-10-11 15:32:43 -04:00
tmpvar_68 = tmpvar_66;
2012-10-07 23:41:18 -04:00
} else {
2014-10-11 15:32:43 -04:00
tmpvar_68 = 0.0;
2012-10-07 23:41:18 -04:00
};
2014-10-11 15:32:43 -04:00
vec2 tmpvar_69;
tmpvar_69.x = (xlv_TEXCOORD0.x + tmpvar_67);
tmpvar_69.y = (xlv_TEXCOORD0.y + tmpvar_68);
vec4 tmpvar_70;
tmpvar_70 = texture2DLod (_MainTex, tmpvar_69, 0.0);
vec3 tmpvar_71;
tmpvar_71.x = -(tmpvar_33);
tmpvar_71.y = -(tmpvar_33);
tmpvar_71.z = -(tmpvar_33);
tmpvar_2 = ((tmpvar_71 * tmpvar_70.xyz) + ((rgbL_13 * vec3(tmpvar_33)) + tmpvar_70.xyz));
2012-10-07 23:41:18 -04:00
};
2014-10-11 15:32:43 -04:00
vec4 tmpvar_72;
tmpvar_72.w = 0.0;
tmpvar_72.xyz = tmpvar_2;
gl_FragData[0] = tmpvar_72;
2012-10-07 23:41:18 -04:00
}
2014-02-11 02:06:13 -05:00
2014-10-11 15:32:43 -04:00
// stats: 191 alu 12 tex 26 flow
// inputs: 1
// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
// uniforms: 1 (total size: 0)
// #0: _MainTex_TexelSize (high float) 4x1 [-1]
// textures: 1
// #0: _MainTex (high 2d) 0x0 [-1]