From 2d01fb4e046f627f46b33e0c05aa0e5914d75b5f Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Mon, 16 Dec 2019 01:41:36 +0000 Subject: [PATCH] [d3d9] Hook up new hasSwapChain changes --- src/d3d9/d3d9_swapchain.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/d3d9/d3d9_swapchain.cpp b/src/d3d9/d3d9_swapchain.cpp index 6b9e7f493..466b1e240 100644 --- a/src/d3d9/d3d9_swapchain.cpp +++ b/src/d3d9/d3d9_swapchain.cpp @@ -122,6 +122,7 @@ namespace dxvk { m_dirty |= vsync != m_vsync; m_dirty |= UpdatePresentRegion(pSourceRect, pDestRect); m_dirty |= recreate; + m_dirty |= !m_presenter->hasSwapChain(); m_vsync = vsync; m_dialogChanged = false; @@ -133,6 +134,12 @@ namespace dxvk { if (std::exchange(m_dirty, false)) RecreateSwapChain(vsync); + // We aren't going to device loss simply because + // 99% of D3D9 games don't handle this properly and + // just end up crashing (like with alt-tab loss) + if (!m_presenter->hasSwapChain()) + return D3D_OK; + PresentImage(presentInterval); return D3D_OK; } catch (const DxvkError& e) {