gsdx-ogl: don't declare a sampler variable

Nvidia was complaining on the fxaa shader. In doubt I also replaced it in Asmodean's shader
This commit is contained in:
Gregory Hainaut 2014-11-20 22:07:44 +01:00
parent 60f7ec03c2
commit d21e6ff45f
3 changed files with 11 additions and 14 deletions

View File

@ -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);

View File

@ -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

View File

@ -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"