[idd] driver: reduce CopyQueue contention

This commit is contained in:
Geoffrey McRae 2025-03-30 23:18:14 +00:00
parent f4df3f0ec7
commit 57a2f68931
2 changed files with 9 additions and 7 deletions

View File

@ -172,14 +172,15 @@ bool CD3D12Device::HeapTest()
CD3D12CommandQueue * CD3D12Device::GetCopyQueue()
{
for(int c = 0; c < 100; ++c)
// try for up to a maximum of 100ms to find a free copy queue
for (int c = 0; c < 100; ++c)
{
for (int i = 0; i < ARRAYSIZE(m_copyQueue); ++i)
{
auto& queue = m_copyQueue[i];
if (!queue.IsReady())
continue;
auto& queue = m_copyQueue[m_copyQueueIndex++];
if (m_copyQueueIndex == ARRAYSIZE(m_copyQueue))
m_copyQueueIndex = 0;
if (queue.IsReady())
{
queue.Reset();
return &queue;
}

View File

@ -29,7 +29,8 @@ struct CD3D12Device
ComPtr<ID3D12Device3> m_device;
ComPtr<ID3D12Heap > m_ivshmemHeap;
CD3D12CommandQueue m_copyQueue[2];
CD3D12CommandQueue m_copyQueue[4];
unsigned m_copyQueueIndex = 0;
CD3D12CommandQueue m_computeQueue;
bool HeapTest();