summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/TextureConversionShader.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2013-11-25 16:34:08 +0100
committerdegasus <wickmarkus@web.de>2013-11-25 16:34:08 +0100
commit64a1969e36960ab066c2130a276d005aa272bba9 (patch)
tree366e5070540b286d05ac96f5c346c0e6d9bf4ccb /Source/Core/VideoCommon/Src/TextureConversionShader.cpp
parent2a2f2fd4ebd29fec3de1498946d3374598d8fb6a (diff)
TextureConverter: fix scoping
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureConversionShader.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/TextureConversionShader.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp
index bf625223dd..92c38ca77d 100644
--- a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp
+++ b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp
@@ -89,7 +89,9 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
WRITE(p, "{\n"
" int2 sampleUv;\n"
- " int2 uv1 = int2(gl_FragCoord.xy);\n");
+ " int2 uv1 = int2(gl_FragCoord.xy);\n"
+ " float2 uv0 = float2(0.0, 0.0);\n"
+ );
WRITE(p, " uv1.x = uv1.x * %d;\n", samples);
@@ -110,16 +112,14 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
void WriteSampleColor(char*& p, const char* colorComp, const char* dest, API_TYPE ApiType)
{
- WRITE(p,
- "{\n" // sampleUv is the sample position in (int)gx_coords
- "float2 uv = float2(sampleUv) + int2(%d,0);\n" // pixel offset (if more than one pixel is samped)
- "uv *= " I_COLORS".w;\n" // scale by two (if wanted)
- "uv += " I_COLORS".xy;\n" // move to copyed rect
- "uv += float2(0.5, 0.5);\n" // move to center of pixel
- "uv /= float2(%d, %d);\n" // normlize to [0:1]
- "uv.y = 1.0-uv.y;\n" // ogl foo (disable this line for d3d)
- "%s = texture(samp0, uv).%s;\n"
- "}\n",
+ WRITE(p, // sampleUv is the sample position in (int)gx_coords
+ "uv0 = float2(sampleUv) + int2(%d,0);\n" // pixel offset (if more than one pixel is samped)
+ "uv0 *= " I_COLORS".w;\n" // scale by two (if wanted)
+ "uv0 += " I_COLORS".xy;\n" // move to copyed rect
+ "uv0 += float2(0.5, 0.5);\n" // move to center of pixel
+ "uv0 /= float2(%d, %d);\n" // normlize to [0:1]
+ "uv0.y = 1.0-uv0.y;\n" // ogl foo (disable this line for d3d)
+ "%s = texture(samp0, uv0).%s;\n",
s_incrementSampleXCount, EFB_WIDTH, EFB_HEIGHT, dest, colorComp
);
}