From eebd7da443abf75a7c44796e8759d264cc7f03e4 Mon Sep 17 00:00:00 2001 From: "Patrick A. Ferry" Date: Sat, 3 Jan 2015 01:28:49 +0000 Subject: [PATCH 1/2] Fix stretching with Virtual XFB in D3D This change matches the behaviour of OpenGL. This should make Ty the Tasmanian Tiger 3 stretch across the whole screen. There are other games with this same issue but I have not any. See issue #6750 for details --- Source/Core/VideoBackends/D3D/Render.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index 5644eae9fb..efff0d94da 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -766,6 +766,8 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co sourceRc.right = (int)xfbSource->texWidth; sourceRc.bottom = (int)xfbSource->texHeight; + sourceRc.right -= fbStride - fbWidth; + BlitScreen(sourceRc, drawRc, xfbSource->tex, xfbSource->texWidth, xfbSource->texHeight, Gamma); } } From 069a0864c0b2c187a8a18b8175d14793a558e6f6 Mon Sep 17 00:00:00 2001 From: "Patrick A. Ferry" Date: Sat, 3 Jan 2015 22:05:22 +0000 Subject: [PATCH 2/2] Scale the offset to the IR scale The offset between fbStride and fbWidth will need to be scaled by IR scale. --- Source/Core/VideoBackends/D3D/Render.cpp | 2 +- Source/Core/VideoBackends/OGL/Render.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index efff0d94da..4d658e94c1 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -766,7 +766,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co sourceRc.right = (int)xfbSource->texWidth; sourceRc.bottom = (int)xfbSource->texHeight; - sourceRc.right -= fbStride - fbWidth; + sourceRc.right -= Renderer::EFBToScaledX(fbStride - fbWidth); BlitScreen(sourceRc, drawRc, xfbSource->tex, xfbSource->texWidth, xfbSource->texHeight, Gamma); } diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 3fecbac10d..0ba6e4eb6b 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -1503,7 +1503,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co sourceRc.top = xfbSource->sourceRc.top; sourceRc.bottom = xfbSource->sourceRc.bottom; - sourceRc.right -= fbStride - fbWidth; + sourceRc.right -= Renderer::EFBToScaledX(fbStride - fbWidth); BlitScreen(sourceRc, drawRc, xfbSource->texture, xfbSource->texWidth, xfbSource->texHeight); }