diff options
Diffstat (limited to 'Source/Core/VideoBackends/D3D/Render.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/Render.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index cf2a0a77ff..5644eae9fb 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -40,12 +40,13 @@ namespace DX11 { -static u32 s_LastAA = 0; +static u32 s_last_multisample_mode = 0; static Television s_television; static bool s_last_fullscreen_mode = false; -static bool s_LastStereo = 0; +static bool s_last_stereo_mode = 0; +static bool s_last_xfb_mode = false; ID3D11Buffer* access_efb_cbuf = nullptr; ID3D11BlendState* clearblendstates[4] = {nullptr}; @@ -227,10 +228,11 @@ Renderer::Renderer(void *&window_handle) UpdateDrawRectangle(s_backbuffer_width, s_backbuffer_height); - s_LastAA = g_ActiveConfig.iMultisampleMode; - s_LastEFBScale = g_ActiveConfig.iEFBScale; + s_last_multisample_mode = g_ActiveConfig.iMultisampleMode; + s_last_efb_scale = g_ActiveConfig.iEFBScale; s_last_fullscreen_mode = g_ActiveConfig.bFullscreen; - s_LastStereo = g_ActiveConfig.iStereoMode > 0; + s_last_stereo_mode = g_ActiveConfig.iStereoMode > 0; + s_last_xfb_mode = g_ActiveConfig.bUseRealXFB; CalculateTargetSize(s_backbuffer_width, s_backbuffer_height); SetupDeviceObjects(); @@ -744,8 +746,8 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co int xfbWidth = xfbSource->srcWidth; int hOffset = ((s32)xfbSource->srcAddr - (s32)xfbAddr) / ((s32)fbStride * 2); - drawRc.top = targetRc.bottom - (hOffset + xfbHeight) * targetRc.GetHeight() / fbHeight; - drawRc.bottom = targetRc.bottom - hOffset * targetRc.GetHeight() / fbHeight; + drawRc.top = targetRc.top + hOffset * targetRc.GetHeight() / fbHeight; + drawRc.bottom = targetRc.top + (hOffset + xfbHeight) * targetRc.GetHeight() / fbHeight; drawRc.left = targetRc.left + (targetRc.GetWidth() - xfbWidth * targetRc.GetWidth() / fbStride) / 2; drawRc.right = targetRc.left + (targetRc.GetWidth() + xfbWidth * targetRc.GetWidth() / fbStride) / 2; @@ -878,7 +880,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co } } - bool xfbchanged = false; + bool xfbchanged = s_last_xfb_mode != g_ActiveConfig.bUseRealXFB; if (FramebufferManagerBase::LastXfbWidth() != fbStride || FramebufferManagerBase::LastXfbHeight() != fbHeight) { @@ -896,11 +898,12 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co if (xfbchanged || windowResized || fullscreen_changed || - s_LastEFBScale != g_ActiveConfig.iEFBScale || - s_LastAA != g_ActiveConfig.iMultisampleMode || - s_LastStereo != (g_ActiveConfig.iStereoMode > 0)) + s_last_efb_scale != g_ActiveConfig.iEFBScale || + s_last_multisample_mode != g_ActiveConfig.iMultisampleMode || + s_last_stereo_mode != (g_ActiveConfig.iStereoMode > 0)) { - s_LastAA = g_ActiveConfig.iMultisampleMode; + s_last_xfb_mode = g_ActiveConfig.bUseRealXFB; + s_last_multisample_mode = g_ActiveConfig.iMultisampleMode; PixelShaderCache::InvalidateMSAAShaders(); if (windowResized || fullscreen_changed) @@ -928,8 +931,8 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co UpdateDrawRectangle(s_backbuffer_width, s_backbuffer_height); - s_LastEFBScale = g_ActiveConfig.iEFBScale; - s_LastStereo = g_ActiveConfig.iStereoMode > 0; + s_last_efb_scale = g_ActiveConfig.iEFBScale; + s_last_stereo_mode = g_ActiveConfig.iStereoMode > 0; CalculateTargetSize(s_backbuffer_width, s_backbuffer_height); D3D::context->OMSetRenderTargets(1, &D3D::GetBackBuffer()->GetRTV(), nullptr); |
