[idd] driver: very experimental change to syncronization

This may get reverted, at this point it's an experiment for the
testers to trial.
This commit is contained in:
Geoffrey McRae
2025-03-30 02:47:40 +00:00
parent 7afb9b93eb
commit b58171c3e1
10 changed files with 137 additions and 40 deletions

View File

@@ -107,8 +107,9 @@ CD3D12Device::InitResult CD3D12Device::Init(CIVSHMEM &ivshmem, UINT64 &alignSize
DEBUG_INFO("Using IVSHMEM as a D3D12Heap");
}
if (!m_copyQueue.Init(m_device.Get(), D3D12_COMMAND_LIST_TYPE_COPY, L"Copy"))
return InitResult::FAILURE;
for(int i = 0; i < ARRAYSIZE(m_copyQueue); ++i)
if (!m_copyQueue[i].Init(m_device.Get(), D3D12_COMMAND_LIST_TYPE_COPY, L"Copy"))
return InitResult::FAILURE;
//if (!m_computeQueue.Init(m_device.Get(), D3D12_COMMAND_LIST_TYPE_COMPUTE, L"Compute"))
//return InitResult::FAILURE;
@@ -167,3 +168,24 @@ bool CD3D12Device::HeapTest()
return true;
}
CD3D12CommandQueue * CD3D12Device::GetCopyQueue()
{
HANDLE waitOn[ARRAYSIZE(m_copyQueue)];
for (int i = 0; i < ARRAYSIZE(m_copyQueue); ++i)
{
auto& queue = m_copyQueue[i];
if (queue.IsReady())
return &queue;
waitOn[i] = queue.GetEvent();
}
DEBUG_TRACE("Wait");
DWORD ready = WaitForMultipleObjects(ARRAYSIZE(waitOn), waitOn, FALSE, INFINITE);
if (ready < ARRAYSIZE(waitOn))
return &m_copyQueue[ready];
return nullptr;
}