Skip to content

Commit

Permalink
[dxgi] Unlock presenter lock early during presentation
Browse files Browse the repository at this point in the history
If SetGammaControl and Present are called at the same time, we'll
otherwise have a deadlock due to reversed lock order.

Fixes doitsujin#3458.
  • Loading branch information
doitsujin committed Jun 5, 2023
1 parent d241daa commit 4d254b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dxgi/dxgi_swapchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,9 @@ namespace dxvk {
return DXGI_ERROR_INVALID_CALL;

std::lock_guard<dxvk::recursive_mutex> lockWin(m_lockWindow);
std::lock_guard<dxvk::mutex> lockBuf(m_lockBuffer);

try {
std::lock_guard<dxvk::mutex> lockBuf(m_lockBuffer);
HRESULT hr = m_presenter->Present(SyncInterval, PresentFlags, nullptr);

if (hr != S_OK || (PresentFlags & DXGI_PRESENT_TEST))
Expand Down

0 comments on commit 4d254b1

Please sign in to comment.