diff options
| author | slx7R4GDZM <slx7R4GDZM@hotmail.com> | 2014-10-14 22:21:36 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2014-10-14 22:25:31 -0400 |
| commit | 5a3f19aeaf11575f142d9fdd2a90a96572b0ea7c (patch) | |
| tree | 2a11f45f914b414dee60877b476045a0f683a21c /Source/Core/VideoBackends/D3D/Render.cpp | |
| parent | 8f61c6f239cf31e550daf0286b6945b8e7fc59e9 (diff) | |
Fix XFB scaling in D3D
Diffstat (limited to 'Source/Core/VideoBackends/D3D/Render.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/Render.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index 645160abda..2c059042c4 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -721,7 +721,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co } u32 xfbCount = 0; - const XFBSourceBase* const* xfbSourceList = FramebufferManager::GetXFBSource(xfbAddr, fbWidth, fbHeight, &xfbCount); + const XFBSourceBase* const* xfbSourceList = FramebufferManager::GetXFBSource(xfbAddr, fbStride, fbHeight, &xfbCount); if ((!xfbSourceList || xfbCount == 0) && g_ActiveConfig.bUseXFB && !g_ActiveConfig.bUseRealXFB) { if (g_ActiveConfig.bDumpFrames && !frame_data.empty()) @@ -763,7 +763,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co if (g_ActiveConfig.bUseXFB && g_ActiveConfig.bUseRealXFB) { // TODO: Television should be used to render Virtual XFB mode as well. - s_television.Submit(xfbAddr, fbWidth, fbHeight); + s_television.Submit(xfbAddr, fbStride, fbWidth, fbHeight); s_television.Render(); } else if (g_ActiveConfig.bUseXFB) @@ -795,12 +795,12 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co // use virtual xfb with offset int xfbHeight = xfbSource->srcHeight; int xfbWidth = xfbSource->srcWidth; - int hOffset = ((s32)xfbSource->srcAddr - (s32)xfbAddr) / ((s32)fbWidth * 2); + int hOffset = ((s32)xfbSource->srcAddr - (s32)xfbAddr) / ((s32)fbStride * 2); drawRc.top = 1.0f - (2.0f * (hOffset) / (float)fbHeight); drawRc.bottom = 1.0f - (2.0f * (hOffset + xfbHeight) / (float)fbHeight); - drawRc.left = -(xfbWidth / (float)fbWidth); - drawRc.right = (xfbWidth / (float)fbWidth); + drawRc.left = -(xfbWidth / (float)fbStride); + drawRc.right = (xfbWidth / (float)fbStride); // The following code disables auto stretch. Kept for reference. // scale draw area for a 1 to 1 pixel mapping with the draw target @@ -946,7 +946,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co UpdateActiveConfig(); TextureCache::OnConfigChanged(g_ActiveConfig); - SetWindowSize(fbWidth, fbHeight); + SetWindowSize(fbStride, fbHeight); const bool windowResized = CheckForResize(); const bool fullscreen = g_ActiveConfig.bFullscreen && @@ -968,10 +968,10 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co bool xfbchanged = false; - if (FramebufferManagerBase::LastXfbWidth() != fbWidth || FramebufferManagerBase::LastXfbHeight() != fbHeight) + if (FramebufferManagerBase::LastXfbWidth() != fbStride || FramebufferManagerBase::LastXfbHeight() != fbHeight) { xfbchanged = true; - unsigned int w = (fbWidth < 1 || fbWidth > MAX_XFB_WIDTH) ? MAX_XFB_WIDTH : fbWidth; + unsigned int w = (fbStride < 1 || fbStride > MAX_XFB_WIDTH) ? MAX_XFB_WIDTH : fbStride; unsigned int h = (fbHeight < 1 || fbHeight > MAX_XFB_HEIGHT) ? MAX_XFB_HEIGHT : fbHeight; FramebufferManagerBase::SetLastXfbWidth(w); FramebufferManagerBase::SetLastXfbHeight(h); |
