diff --git a/bin/shaders/GSdx.fx b/bin/shaders/GSdx.fx index c13f11ac5b..6e6af4d52e 100644 --- a/bin/shaders/GSdx.fx +++ b/bin/shaders/GSdx.fx @@ -515,13 +515,12 @@ float4 FxaaPixelShader(float2 pos, FxaaTex tex, float2 fxaaRcpFrame, float fxaaS float4 FxaaPass(float4 FxaaColor, float2 texcoord) { - FxaaTex tex; - #if(GLSL == 1) tex = TextureSampler; - vec2 PixelSize = textureSize(tex, 0); - FxaaColor = FxaaPixelShader(texcoord, tex, 1.0/PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin); + FxaaColor = FxaaPixelShader(texcoord, TextureSampler, pixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin); #else + FxaaTex tex; + tex.tex = Texture; tex.smpl = TextureSampler; FxaaColor = FxaaPixelShader(texcoord, tex, pixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin); diff --git a/plugins/GSdx/res/fxaa.fx b/plugins/GSdx/res/fxaa.fx index a5e7572c97..108e316553 100644 --- a/plugins/GSdx/res/fxaa.fx +++ b/plugins/GSdx/res/fxaa.fx @@ -527,9 +527,9 @@ float4 FxaaPass(float4 FxaaColor, float2 uv0) float4 FxaaPass(float4 FxaaColor : COLOR0, float2 uv0 : TEXCOORD0) #endif { - FxaaTex tex; #if (SHADER_MODEL >= 0x400) + FxaaTex tex; tex.tex = Texture; tex.smpl = TextureSampler; @@ -538,12 +538,11 @@ float4 FxaaPass(float4 FxaaColor : COLOR0, float2 uv0 : TEXCOORD0) #elif (FXAA_GLSL_130 == 1) - tex = TextureSampler; - vec2 PixelSize = textureSize(tex, 0); - FxaaColor = FxaaPixelShader(uv0, tex, 1.0/PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin); + vec2 PixelSize = textureSize(TextureSampler, 0); + FxaaColor = FxaaPixelShader(uv0, TextureSampler, 1.0/PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin); #else - + FxaaTex tex; tex = TextureSampler; FxaaColor = FxaaPixelShader(uv0, tex, PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin); #endif diff --git a/plugins/GSdx/res/glsl_source.h b/plugins/GSdx/res/glsl_source.h index 287c963e26..29d9df3235 100644 --- a/plugins/GSdx/res/glsl_source.h +++ b/plugins/GSdx/res/glsl_source.h @@ -2053,9 +2053,9 @@ static const char* fxaa_fx = "float4 FxaaPass(float4 FxaaColor : COLOR0, float2 uv0 : TEXCOORD0)\n" "#endif\n" "{\n" - " FxaaTex tex;\n" "\n" " #if (SHADER_MODEL >= 0x400)\n" + " FxaaTex tex;\n" " tex.tex = Texture;\n" " tex.smpl = TextureSampler;\n" "\n" @@ -2064,12 +2064,11 @@ static const char* fxaa_fx = "\n" " #elif (FXAA_GLSL_130 == 1)\n" "\n" - " tex = TextureSampler;\n" - " vec2 PixelSize = textureSize(tex, 0);\n" - " FxaaColor = FxaaPixelShader(uv0, tex, 1.0/PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);\n" + " vec2 PixelSize = textureSize(TextureSampler, 0);\n" + " FxaaColor = FxaaPixelShader(uv0, TextureSampler, 1.0/PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);\n" "\n" " #else\n" - "\n" + " FxaaTex tex;\n" " tex = TextureSampler;\n" " FxaaColor = FxaaPixelShader(uv0, tex, PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);\n" " #endif\n"