bgfx/3rdparty/glsl-optimizer/tests/fragment/complex-fxaa3-11-consolepc-ir.txt
Branimir Karadzic dee3fe5266 Initial commit.
2012-04-03 20:30:07 -07:00

320 lines
7.8 KiB
Text

#extension GL_ARB_shader_texture_lod : enable
struct v2f {
vec4 pos;
vec2 uv;
vec4 uvPosPos;
};
varying vec4 xlv_TEXCOORD1;
varying vec2 xlv_TEXCOORD0;
varying vec4 xlv_SV_POSITION;
uniform vec4 _MainTex_TexelSize;
uniform sampler2D _MainTex;
vec4 xll_tex2Dlod (
in sampler2D s,
in vec4 coord
)
{
vec4 tmpvar_1;
tmpvar_1 = texture2DLod (s, coord.xy, coord.w);
return tmpvar_1;
}
float FxaaLuma (
in vec4 rgba
)
{
return rgba.y;
}
vec4 FxaaPixelShader (
in vec2 pos,
in vec4 fxaaConsolePosPos,
in sampler2D tex,
in sampler2D fxaaConsole360TexExpBiasNegOne,
in sampler2D fxaaConsole360TexExpBiasNegTwo,
in vec2 fxaaQualityRcpFrame,
in vec4 fxaaConsoleRcpFrameOpt,
in vec4 fxaaConsoleRcpFrameOpt2,
in vec4 fxaaConsole360RcpFrameOpt2,
in float fxaaQualitySubpix,
in float fxaaQualityEdgeThreshold,
in float fxaaQualityEdgeThresholdMin,
in float fxaaConsoleEdgeSharpness,
in float fxaaConsoleEdgeThreshold,
in float fxaaConsoleEdgeThresholdMin,
in vec4 fxaaConsole360ConstDir
)
{
bool twoTap;
vec4 rgbyB;
vec4 rgbyA;
vec4 rgbyP2;
vec4 rgbyN2;
vec2 dir2;
float dirAbsMinTimesC;
vec4 rgbyP1;
vec4 rgbyN1;
vec2 dir1;
vec2 dir;
float dirSeMinusNw;
float lumaMaxSubMinM;
float dirSwMinusNe;
float lumaMaxM;
float lumaMaxScaledClamped;
float lumaMinM;
float lumaMaxScaled;
float lumaMin;
float lumaMax;
float lumaMinNeSe;
float lumaMaxNeSe;
float lumaMinNwSw;
float lumaMaxNwSw;
float lumaM;
vec4 rgbyM;
float lumaSe;
float lumaNe;
float lumaSw;
float lumaNw;
vec4 tmpvar_1;
tmpvar_1.zw = vec2(0.0, 0.0);
tmpvar_1.xy = fxaaConsolePosPos.xy.xy;
vec4 tmpvar_2;
tmpvar_2 = xll_tex2Dlod (tex, tmpvar_1);
float tmpvar_3;
tmpvar_3 = FxaaLuma (tmpvar_2);
float tmpvar_4;
tmpvar_4 = tmpvar_3;
lumaNw = tmpvar_4;
vec4 tmpvar_5;
tmpvar_5.zw = vec2(0.0, 0.0);
tmpvar_5.xy = fxaaConsolePosPos.xw.xy;
vec4 tmpvar_6;
tmpvar_6 = xll_tex2Dlod (tex, tmpvar_5);
float tmpvar_7;
tmpvar_7 = FxaaLuma (tmpvar_6);
float tmpvar_8;
tmpvar_8 = tmpvar_7;
lumaSw = tmpvar_8;
vec4 tmpvar_9;
tmpvar_9.zw = vec2(0.0, 0.0);
tmpvar_9.xy = fxaaConsolePosPos.zy.xy;
vec4 tmpvar_10;
tmpvar_10 = xll_tex2Dlod (tex, tmpvar_9);
float tmpvar_11;
tmpvar_11 = FxaaLuma (tmpvar_10);
float tmpvar_12;
tmpvar_12 = tmpvar_11;
lumaNe = tmpvar_12;
vec4 tmpvar_13;
tmpvar_13.zw = vec2(0.0, 0.0);
tmpvar_13.xy = fxaaConsolePosPos.zw.xy;
vec4 tmpvar_14;
tmpvar_14 = xll_tex2Dlod (tex, tmpvar_13);
float tmpvar_15;
tmpvar_15 = FxaaLuma (tmpvar_14);
float tmpvar_16;
tmpvar_16 = tmpvar_15;
lumaSe = tmpvar_16;
vec4 tmpvar_17;
tmpvar_17.zw = vec2(0.0, 0.0);
tmpvar_17.xy = pos.xy.xy;
vec4 tmpvar_18;
tmpvar_18 = xll_tex2Dlod (tex, tmpvar_17);
vec4 tmpvar_19;
tmpvar_19 = tmpvar_18;
rgbyM = tmpvar_19;
float tmpvar_20;
tmpvar_20 = rgbyM.y;
lumaM = tmpvar_20;
float tmpvar_21;
tmpvar_21 = max (lumaNw, lumaSw);
float tmpvar_22;
tmpvar_22 = tmpvar_21;
lumaMaxNwSw = tmpvar_22;
float tmpvar_23;
tmpvar_23 = (lumaNe + 0.00260417);
lumaNe = tmpvar_23;
float tmpvar_24;
tmpvar_24 = min (lumaNw, lumaSw);
float tmpvar_25;
tmpvar_25 = tmpvar_24;
lumaMinNwSw = tmpvar_25;
float tmpvar_26;
tmpvar_26 = max (lumaNe, lumaSe);
float tmpvar_27;
tmpvar_27 = tmpvar_26;
lumaMaxNeSe = tmpvar_27;
float tmpvar_28;
tmpvar_28 = min (lumaNe, lumaSe);
float tmpvar_29;
tmpvar_29 = tmpvar_28;
lumaMinNeSe = tmpvar_29;
float tmpvar_30;
tmpvar_30 = max (lumaMaxNeSe, lumaMaxNwSw);
float tmpvar_31;
tmpvar_31 = tmpvar_30;
lumaMax = tmpvar_31;
float tmpvar_32;
tmpvar_32 = min (lumaMinNeSe, lumaMinNwSw);
float tmpvar_33;
tmpvar_33 = tmpvar_32;
lumaMin = tmpvar_33;
float tmpvar_34;
tmpvar_34 = (lumaMax * fxaaConsoleEdgeThreshold);
lumaMaxScaled = tmpvar_34;
float tmpvar_35;
tmpvar_35 = min (lumaMin, lumaM);
float tmpvar_36;
tmpvar_36 = tmpvar_35;
lumaMinM = tmpvar_36;
float tmpvar_37;
tmpvar_37 = max (fxaaConsoleEdgeThresholdMin, lumaMaxScaled);
float tmpvar_38;
tmpvar_38 = tmpvar_37;
lumaMaxScaledClamped = tmpvar_38;
float tmpvar_39;
tmpvar_39 = max (lumaMax, lumaM);
float tmpvar_40;
tmpvar_40 = tmpvar_39;
lumaMaxM = tmpvar_40;
float tmpvar_41;
tmpvar_41 = (lumaSw - lumaNe);
dirSwMinusNe = tmpvar_41;
float tmpvar_42;
tmpvar_42 = (lumaMaxM - lumaMinM);
lumaMaxSubMinM = tmpvar_42;
float tmpvar_43;
tmpvar_43 = (lumaSe - lumaNw);
dirSeMinusNw = tmpvar_43;
if ((lumaMaxSubMinM < lumaMaxScaledClamped)) {
return rgbyM;
};
float tmpvar_44;
tmpvar_44 = (dirSwMinusNe + dirSeMinusNw);
dir.x = tmpvar_44;
float tmpvar_45;
tmpvar_45 = (dirSwMinusNe - dirSeMinusNw);
dir.y = vec2(tmpvar_45).y;
vec2 tmpvar_46;
tmpvar_46 = normalize (dir.xy);
vec2 tmpvar_47;
tmpvar_47 = tmpvar_46;
dir1 = tmpvar_47;
vec4 tmpvar_48;
tmpvar_48.zw = vec2(0.0, 0.0);
tmpvar_48.xy = (pos.xy - (dir1 * fxaaConsoleRcpFrameOpt.zw)).xy;
vec4 tmpvar_49;
tmpvar_49 = xll_tex2Dlod (tex, tmpvar_48);
vec4 tmpvar_50;
tmpvar_50 = tmpvar_49;
rgbyN1 = tmpvar_50;
vec4 tmpvar_51;
tmpvar_51.zw = vec2(0.0, 0.0);
tmpvar_51.xy = (pos.xy + (dir1 * fxaaConsoleRcpFrameOpt.zw)).xy;
vec4 tmpvar_52;
tmpvar_52 = xll_tex2Dlod (tex, tmpvar_51);
vec4 tmpvar_53;
tmpvar_53 = tmpvar_52;
rgbyP1 = tmpvar_53;
float tmpvar_54;
tmpvar_54 = abs (dir1.x);
float tmpvar_55;
tmpvar_55 = abs (dir1.y);
float tmpvar_56;
tmpvar_56 = min (tmpvar_54, tmpvar_55);
float tmpvar_57;
tmpvar_57 = (tmpvar_56 * fxaaConsoleEdgeSharpness);
dirAbsMinTimesC = tmpvar_57;
vec2 tmpvar_58;
tmpvar_58 = clamp ((dir1.xy / dirAbsMinTimesC), vec2(-2.0, -2.0), vec2(2.0, 2.0));
vec2 tmpvar_59;
tmpvar_59 = tmpvar_58;
dir2 = tmpvar_59;
vec4 tmpvar_60;
tmpvar_60.zw = vec2(0.0, 0.0);
tmpvar_60.xy = (pos.xy - (dir2 * fxaaConsoleRcpFrameOpt2.zw)).xy;
vec4 tmpvar_61;
tmpvar_61 = xll_tex2Dlod (tex, tmpvar_60);
vec4 tmpvar_62;
tmpvar_62 = tmpvar_61;
rgbyN2 = tmpvar_62;
vec4 tmpvar_63;
tmpvar_63.zw = vec2(0.0, 0.0);
tmpvar_63.xy = (pos.xy + (dir2 * fxaaConsoleRcpFrameOpt2.zw)).xy;
vec4 tmpvar_64;
tmpvar_64 = xll_tex2Dlod (tex, tmpvar_63);
vec4 tmpvar_65;
tmpvar_65 = tmpvar_64;
rgbyP2 = tmpvar_65;
vec4 tmpvar_66;
tmpvar_66 = (rgbyN1 + rgbyP1);
rgbyA = tmpvar_66;
vec4 tmpvar_67;
tmpvar_67 = (((rgbyN2 + rgbyP2) * 0.25) + (rgbyA * 0.25));
rgbyB = tmpvar_67;
bool tmpvar_68;
if ((rgbyB.y < lumaMin)) {
tmpvar_68 = bool(1);
} else {
tmpvar_68 = (rgbyB.y > lumaMax);
};
bool tmpvar_69;
tmpvar_69 = tmpvar_68;
twoTap = tmpvar_69;
if (twoTap) {
vec3 tmpvar_70;
tmpvar_70 = (rgbyA.xyz * 0.5);
rgbyB.xyz = tmpvar_70.xyz.xyz;
};
return rgbyB;
}
vec4 xlat_main (
in v2f i
)
{
float fxaaN;
float tmpvar_1;
tmpvar_1 = 0.5;
fxaaN = tmpvar_1;
vec4 tmpvar_2;
tmpvar_2.x = -(fxaaN);
tmpvar_2.y = -(fxaaN);
tmpvar_2.z = fxaaN;
tmpvar_2.w = fxaaN;
vec4 tmpvar_3;
tmpvar_3 = FxaaPixelShader (i.uv, i.uvPosPos, _MainTex, _MainTex, _MainTex, _MainTex_TexelSize.xy, (_MainTex_TexelSize.xyxy * tmpvar_2), (_MainTex_TexelSize.xyxy * vec4(-2.0, -2.0, 2.0, 2.0)), (_MainTex_TexelSize.xyxy * vec4(8.0, 8.0, -4.0, -4.0)), 0.75, 0.166, 0.0833, 8.0, 0.125, 0.05, vec4(1.0, -1.0, 0.25, -0.25));
return tmpvar_3;
}
void main ()
{
v2f xlt_i;
vec4 xl_retval;
vec4 tmpvar_1;
tmpvar_1 = xlv_SV_POSITION.xyzw;
vec4 tmpvar_2;
tmpvar_2 = tmpvar_1;
xlt_i.pos = tmpvar_2;
vec2 tmpvar_3;
tmpvar_3 = xlv_TEXCOORD0.xy;
vec2 tmpvar_4;
tmpvar_4 = tmpvar_3;
xlt_i.uv = tmpvar_4;
vec4 tmpvar_5;
tmpvar_5 = xlv_TEXCOORD1.xyzw;
vec4 tmpvar_6;
tmpvar_6 = tmpvar_5;
xlt_i.uvPosPos = tmpvar_6;
vec4 tmpvar_7;
tmpvar_7 = xlat_main (xlt_i);
vec4 tmpvar_8;
tmpvar_8 = tmpvar_7;
xl_retval = tmpvar_8;
vec4 tmpvar_9;
tmpvar_9 = xl_retval.xyzw;
vec4 tmpvar_10;
tmpvar_10 = tmpvar_9;
gl_FragData[0] = tmpvar_10;
}