mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Tweak lock order to avoid a deadlock during capture
* During capture we hold the transition lock for writing, so we need to try to lock that first (if we're going to) before locking the queue's lock. Otherwise another thread could come in and get the queue's lock while we're holding the transition lock, then we deadlock against each other.
This commit is contained in:
@@ -357,11 +357,11 @@ void WrappedID3D12CommandQueue::ExecuteCommandListsInternal(UINT NumCommandLists
|
||||
|
||||
if(IsCaptureMode(m_State))
|
||||
{
|
||||
SCOPED_LOCK(m_Lock);
|
||||
|
||||
if(!InFrameCaptureBoundary)
|
||||
m_pDevice->GetCapTransitionLock().ReadLock();
|
||||
|
||||
m_Lock.Lock();
|
||||
|
||||
bool capframe = IsActiveCapturing(m_State);
|
||||
std::set<ResourceId> refdIDs;
|
||||
|
||||
@@ -556,6 +556,8 @@ void WrappedID3D12CommandQueue::ExecuteCommandListsInternal(UINT NumCommandLists
|
||||
}
|
||||
}
|
||||
|
||||
m_Lock.Unlock();
|
||||
|
||||
if(!InFrameCaptureBoundary)
|
||||
m_pDevice->GetCapTransitionLock().ReadUnlock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user