mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-11 09:58:10 +00:00
[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:
@@ -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;
|
||||
}
|
Reference in New Issue
Block a user