From a511882cb8569823c4b63b9d07763d6c04ff1a9b Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 6 Dec 2020 23:46:23 +1000 Subject: [PATCH] D3D11HostDisplay: Add an option to force a blit/discard swap chain --- src/duckstation-qt/advancedsettingswidget.cpp | 7 +++++++ src/frontend-common/d3d11_host_display.cpp | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/duckstation-qt/advancedsettingswidget.cpp b/src/duckstation-qt/advancedsettingswidget.cpp index 85af7d448..74b3ee856 100644 --- a/src/duckstation-qt/advancedsettingswidget.cpp +++ b/src/duckstation-qt/advancedsettingswidget.cpp @@ -175,6 +175,10 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(QtHostInterface* host_interface, 0); addBooleanTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("Increase Timer Resolution"), "Main", "IncreaseTimerResolution", true); +#ifdef WIN32 + addBooleanTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("Use Blit Swap Chain"), "Display", + "UseBlitSwapChain", false); +#endif } AdvancedSettingsWidget::~AdvancedSettingsWidget() = default; @@ -195,4 +199,7 @@ void AdvancedSettingsWidget::onResetToDefaultClicked() setBooleanTweakOption(m_ui.tweakOptionTable, 11, false); setIntRangeTweakOption(m_ui.tweakOptionTable, 12, 0); setBooleanTweakOption(m_ui.tweakOptionTable, 13, true); +#ifdef WIN32 + setBooleanTweakOption(m_ui.tweakOptionTable, 14, false); +#endif } diff --git a/src/frontend-common/d3d11_host_display.cpp b/src/frontend-common/d3d11_host_display.cpp index 90c9d1994..be183dd70 100644 --- a/src/frontend-common/d3d11_host_display.cpp +++ b/src/frontend-common/d3d11_host_display.cpp @@ -394,7 +394,8 @@ bool D3D11HostDisplay::CreateSwapChain(const DXGI_MODE_DESC* fullscreen_mode) if (m_window_info.type != WindowInfo::Type::Win32) return false; - m_using_flip_model_swap_chain = true; + m_using_flip_model_swap_chain = + fullscreen_mode || !g_host_interface->GetBoolSettingValue("Display", "UseBlitSwapChain", false); const HWND window_hwnd = reinterpret_cast(m_window_info.window_handle); RECT client_rc{};