mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-09 08:41:31 +00:00
[idd] d3d12: harvest completed command slots
Check a busy slot fence before waiting for its thread-pool callback. This lets the caller complete finished GPU work inline and avoids a scheduler delay before the allocator and command list can be reused.
This commit is contained in:
@@ -510,6 +510,12 @@ CD3D12CommandSlot * CD3D12CommandQueue::Acquire(UINT slotIndex)
|
||||
const ULONGLONG deadline = GetTickCount64() + 100;
|
||||
for (;;)
|
||||
{
|
||||
if (m_slots[slotIndex].Acquire())
|
||||
return &m_slots[slotIndex];
|
||||
|
||||
// The GPU may already be finished while its thread-pool callback is
|
||||
// still pending. Complete it here before sleeping on callback dispatch.
|
||||
m_slots[slotIndex].OnCompletion(false);
|
||||
if (m_slots[slotIndex].Acquire())
|
||||
return &m_slots[slotIndex];
|
||||
if (m_failed.load(std::memory_order_acquire))
|
||||
|
||||
Reference in New Issue
Block a user