summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2012-03-23 23:20:19 +1100
committerskidau <skidau@gmail.com>2012-03-23 23:20:19 +1100
commit41bcf657f89d912bb048247767c211f63eb13e94 (patch)
tree68c60f5993ea3fc8fceed123c2c1c832f946033a /Source/Core
parentc4fbb6e3771960b1bb1f28571612e4c60d0c9817 (diff)
Adjusted the DX9 offset of the Sampling address to more closely match what we are seeing in games.
Fixes issue 5305.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/VideoCommon/Src/PixelShaderGen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
index 3ef923dc3e..da78c01741 100644
--- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
@@ -1106,9 +1106,9 @@ void SampleTexture(char *&p, const char *destination, const char *texcoords, con
WRITE(p, "%s=Tex%d.Sample(samp%d, %s.xy * "I_TEXDIMS"[%d].xy).%s;\n", destination, texmap,texmap, texcoords, texmap, texswap);
else if (ApiType & API_D3D9)
{
- // D3D9 uses different pixel to texel mapping, so we need to offset our sampling address by half a pixel (assuming native and virtual texture dimensions match each other, otherwise some math is involved).
+ // D3D9 uses different pixel to texel mapping, so we need to offset our sampling address.
// Read the MSDN article "Directly Mapping Texels to Pixels (Direct3D 9)" for further info.
- WRITE(p, "%s=tex2D(samp%d, (%s.xy + 0.5f*"I_VTEXSCALE"[%d].%s) * "I_TEXDIMS"[%d].xy).%s;\n", destination, texmap, texcoords, texmap/2, (texmap&1)?"zw":"xy", texmap, texswap);
+ WRITE(p, "%s=tex2D(samp%d, (%s.xy + 0.0005f*"I_VTEXSCALE"[%d].%s) * "I_TEXDIMS"[%d].xy).%s;\n", destination, texmap, texcoords, texmap/2, (texmap&1)?"zw":"xy", texmap, texswap);
}
else
WRITE(p, "%s=tex2D(samp%d, %s.xy * "I_TEXDIMS"[%d].xy).%s;\n", destination, texmap, texcoords, texmap, texswap);