mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-11 01:48:09 +00:00
[idd] driver: fix deadlock caused by command queue completion callback
The callback runs in a random thread, we can't call directx methods safely from it, so move reset so it's called automatically when a free copy list is obtained.
This commit is contained in:
@@ -108,7 +108,8 @@ CD3D12Device::InitResult CD3D12Device::Init(CIVSHMEM &ivshmem, UINT64 &alignSize
|
||||
}
|
||||
|
||||
for(int i = 0; i < ARRAYSIZE(m_copyQueue); ++i)
|
||||
if (!m_copyQueue[i].Init(m_device.Get(), D3D12_COMMAND_LIST_TYPE_COPY, L"Copy"))
|
||||
if (!m_copyQueue[i].Init(m_device.Get(), D3D12_COMMAND_LIST_TYPE_COPY, L"Copy",
|
||||
m_indirectCopy ? CD3D12CommandQueue::NORMAL : CD3D12CommandQueue::FAST))
|
||||
return InitResult::FAILURE;
|
||||
|
||||
//if (!m_computeQueue.Init(m_device.Get(), D3D12_COMMAND_LIST_TYPE_COMPUTE, L"Compute"))
|
||||
@@ -176,8 +177,11 @@ CD3D12CommandQueue * CD3D12Device::GetCopyQueue()
|
||||
for (int i = 0; i < ARRAYSIZE(m_copyQueue); ++i)
|
||||
{
|
||||
auto& queue = m_copyQueue[i];
|
||||
if (queue.IsReady())
|
||||
return &queue;
|
||||
if (!queue.IsReady())
|
||||
continue;
|
||||
|
||||
queue.Reset();
|
||||
return &queue;
|
||||
}
|
||||
Sleep(1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user