Skip to content

Commit

Permalink
[d3d9] Hook up new hasSwapChain changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua-Ashton committed Dec 16, 2019
1 parent 83acd22 commit 2d01fb4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/d3d9/d3d9_swapchain.cpp
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down

0 comments on commit 2d01fb4

Please sign in to comment.