D3D11HostDisplay: Add an option to force a blit/discard swap chain

This commit is contained in:
Connor McLaughlin 2020-12-06 23:46:23 +10:00
parent 3ccfc42b0f
commit a511882cb8
2 changed files with 9 additions and 1 deletions

View File

@ -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
}

View File

@ -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<HWND>(m_window_info.window_handle);
RECT client_rc{};