D3D9: Fix texel to pixel mapping when sampling textures properly.

This commit is contained in:
NeoBrainX
2012-03-24 16:30:00 +01:00
parent fee98b426b
commit 7a1744575d
5 changed files with 16 additions and 3 deletions

View File

@ -306,7 +306,11 @@ void VertexShaderManager::SetConstants()
if (bViewportChanged)
{
bViewportChanged = false;
SetVSConstant4f(C_DEPTHPARAMS,xfregs.viewport.farZ / 16777216.0f,xfregs.viewport.zRange / 16777216.0f,0.0f,0.0f);
SetVSConstant4f(C_DEPTHPARAMS,
xfregs.viewport.farZ / 16777216.0f,
xfregs.viewport.zRange / 16777216.0f,
-1.f / (float)g_renderer->EFBToScaledX((int)ceil(2.0f * xfregs.viewport.wd)),
1.f / (float)g_renderer->EFBToScaledY((int)ceil(-2.0f * xfregs.viewport.ht)));
// This is so implementation-dependent that we can't have it here.
UpdateViewport(s_viewportCorrection);
bProjectionChanged = true;