summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D12/Render.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2016-02-21 18:55:55 +1000
committerStenzek <stenzek@gmail.com>2016-02-28 17:18:44 +1000
commit9efe66509d9923c8dedb5948808a4d2c0c7d802e (patch)
treef2b269a58aad4a91eb82bf6b70e5846d9e6df5c0 /Source/Core/VideoBackends/D3D12/Render.cpp
parent1d909ec7a422b261588e860486b01db85e94fa6e (diff)
D3D12: Fix crash/errors when switching MSAA modes while running
Diffstat (limited to 'Source/Core/VideoBackends/D3D12/Render.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D12/Render.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/D3D12/Render.cpp b/Source/Core/VideoBackends/D3D12/Render.cpp
index 4f763a68cb..bf80081ff5 100644
--- a/Source/Core/VideoBackends/D3D12/Render.cpp
+++ b/Source/Core/VideoBackends/D3D12/Render.cpp
@@ -984,9 +984,16 @@ void Renderer::SwapImpl(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height
s_last_stereo_mode != (g_ActiveConfig.iStereoMode > 0))
{
s_last_xfb_mode = g_ActiveConfig.bUseRealXFB;
- s_last_multisamples = g_ActiveConfig.iMultisamples;
- StaticShaderCache::InvalidateMSAAShaders();
+ // Block on any changes until the GPU catches up, so we can free resources safely.
+ D3D::command_list_mgr->ExecuteQueuedWork(true);
+
+ if (s_last_multisamples != g_ActiveConfig.iMultisamples)
+ {
+ s_last_multisamples = g_ActiveConfig.iMultisamples;
+ StaticShaderCache::InvalidateMSAAShaders();
+ gx_state_cache.OnMSAASettingsChanged();
+ }
if (window_resized)
{