From 4d254b13bee632e3f5c274e0a7d1aa919238d6a1 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 5 Jun 2023 17:01:29 +0200 Subject: [PATCH] [dxgi] Unlock presenter lock early during presentation If SetGammaControl and Present are called at the same time, we'll otherwise have a deadlock due to reversed lock order. Fixes #3458. --- src/dxgi/dxgi_swapchain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dxgi/dxgi_swapchain.cpp b/src/dxgi/dxgi_swapchain.cpp index e713dc1af..4a78d38f7 100644 --- a/src/dxgi/dxgi_swapchain.cpp +++ b/src/dxgi/dxgi_swapchain.cpp @@ -288,9 +288,9 @@ namespace dxvk { return DXGI_ERROR_INVALID_CALL; std::lock_guard lockWin(m_lockWindow); - std::lock_guard lockBuf(m_lockBuffer); try { + std::lock_guard lockBuf(m_lockBuffer); HRESULT hr = m_presenter->Present(SyncInterval, PresentFlags, nullptr); if (hr != S_OK || (PresentFlags & DXGI_PRESENT_TEST))