[d3d9] Defer dialog mode swapchain recreation decision to Present

Avoids unnecessary swapchain recreations if the game calls SetDialogBoxMode multiple times per frame
This commit is contained in:
Joshua Ashton 2020-01-10 04:30:55 +00:00
parent 9647e449d2
commit 3ebd4b28a3
2 changed files with 4 additions and 5 deletions

View File

@ -115,7 +115,7 @@ namespace dxvk {
bool recreate = false;
recreate |= m_presenter == nullptr;
recreate |= window != m_window;
recreate |= m_dialogChanged;
recreate |= m_dialog != m_lastDialog;
m_window = window;
@ -127,7 +127,7 @@ namespace dxvk {
m_vsync = vsync;
m_dialogChanged = false;
m_lastDialog = m_dialog;
try {
if (recreate)
@ -400,8 +400,7 @@ namespace dxvk {
// However it doesn't appear to error at all in any of my tests of these
// cases described in the documentation.
m_dialogChanged = m_dialog != bEnableDialogs;
m_dialog = bEnableDialogs;
m_dialog = bEnableDialogs;
return D3D_OK;
}

View File

@ -146,7 +146,7 @@ namespace dxvk {
bool m_vsync = true;
bool m_dialog;
bool m_dialogChanged = false;
bool m_lastDialog = false;
HWND m_window = nullptr;
HMONITOR m_monitor = nullptr;