From 7446d3c58a52254ec5d8d1bed3824a8a5c855efa Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 26 Nov 2019 15:36:20 +0100 Subject: [PATCH] [dxgi] Don't allow changing the FRAME_LATENCY_WAITABLE_OBJECT flag --- src/dxgi/dxgi_swapchain.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dxgi/dxgi_swapchain.cpp b/src/dxgi/dxgi_swapchain.cpp index d41027747..be385a2ec 100644 --- a/src/dxgi/dxgi_swapchain.cpp +++ b/src/dxgi/dxgi_swapchain.cpp @@ -281,6 +281,11 @@ namespace dxvk { UINT SwapChainFlags) { if (!IsWindow(m_window)) return DXGI_ERROR_INVALID_CALL; + + constexpr UINT PreserveFlags = DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT; + + if ((m_desc.Flags & PreserveFlags) != (SwapChainFlags & PreserveFlags)) + return DXGI_ERROR_INVALID_CALL; std::lock_guard lock(m_lockBuffer); m_desc.Width = Width;