From ed1ac6df4a0ce2e59d8a7eb2050209e6b5f74382 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 20 Jan 2020 17:26:57 +1000 Subject: [PATCH] Frontend: Fix error in swap chain ResizeBuffers() --- src/duckstation-qt/d3d11displaywindow.cpp | 3 ++- src/duckstation/d3d11_host_display.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/duckstation-qt/d3d11displaywindow.cpp b/src/duckstation-qt/d3d11displaywindow.cpp index f66419db9..706a83b9d 100644 --- a/src/duckstation-qt/d3d11displaywindow.cpp +++ b/src/duckstation-qt/d3d11displaywindow.cpp @@ -184,7 +184,8 @@ void D3D11DisplayWindow::onWindowResized(int width, int height) m_swap_chain_rtv.Reset(); - HRESULT hr = m_swap_chain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, 0); + HRESULT hr = m_swap_chain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, + m_allow_tearing_supported ? DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING : 0); if (FAILED(hr)) Log_ErrorPrintf("ResizeBuffers() failed: 0x%08X", hr); diff --git a/src/duckstation/d3d11_host_display.cpp b/src/duckstation/d3d11_host_display.cpp index 1ff4ccb30..df72a0918 100644 --- a/src/duckstation/d3d11_host_display.cpp +++ b/src/duckstation/d3d11_host_display.cpp @@ -182,7 +182,8 @@ void D3D11HostDisplay::WindowResized() m_swap_chain_rtv.Reset(); - HRESULT hr = m_swap_chain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, 0); + HRESULT hr = m_swap_chain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, + m_allow_tearing_supported ? DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING : 0); if (FAILED(hr)) Log_ErrorPrintf("ResizeBuffers() failed: 0x%08X", hr);