[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:
Geoffrey McRae
2025-03-30 16:52:58 +00:00
parent 3b883bf9fe
commit cadcfe4b39
5 changed files with 69 additions and 43 deletions

View File

@@ -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);
}