1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-15 07:29:17 +01:00

[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.
This commit is contained in:
Philip Rebohle 2023-06-05 17:01:29 +02:00
parent d241daa0b1
commit 4d254b13be

View File

@ -288,9 +288,9 @@ namespace dxvk {
return DXGI_ERROR_INVALID_CALL; return DXGI_ERROR_INVALID_CALL;
std::lock_guard<dxvk::recursive_mutex> lockWin(m_lockWindow); std::lock_guard<dxvk::recursive_mutex> lockWin(m_lockWindow);
std::lock_guard<dxvk::mutex> lockBuf(m_lockBuffer);
try { try {
std::lock_guard<dxvk::mutex> lockBuf(m_lockBuffer);
HRESULT hr = m_presenter->Present(SyncInterval, PresentFlags, nullptr); HRESULT hr = m_presenter->Present(SyncInterval, PresentFlags, nullptr);
if (hr != S_OK || (PresentFlags & DXGI_PRESENT_TEST)) if (hr != S_OK || (PresentFlags & DXGI_PRESENT_TEST))