[idd] capture: defer interop synchronization

Signal the shared D3D11 source only after a retained candidate and its
command slots have been acquired. Superseded source frames no longer queue
a fence that no Direct3D 12 work will consume.
This commit is contained in:
Geoffrey McRae
2026-08-06 11:39:44 +10:00
parent 0a04dc4964
commit da7d6b4011

View File

@@ -1403,17 +1403,6 @@ bool CSwapChainProcessor::SwapChainNewFrame(ComPtr<IDXGIResource> acquiredBuffer
return false; return false;
} }
/**
* Even though we have not performed any copy/draw operations we still need to
* use a fence. Because we share this texture with DirectX12 it is able to
* read from it before the desktop duplication API has finished updating it.
*/
if (!srcRes->Signal())
{
SetFullPendingDamage();
return false;
}
RECT dirtyRects[LG_MAX_DIRTY_RECTS] = {0}; RECT dirtyRects[LG_MAX_DIRTY_RECTS] = {0};
bool noImageUpdate = false; bool noImageUpdate = false;
if (moveRegionCount || dirtyRectCount > ARRAYSIZE(dirtyRects)) if (moveRegionCount || dirtyRectCount > ARRAYSIZE(dirtyRects))
@@ -1688,7 +1677,25 @@ bool CSwapChainProcessor::SwapChainNewFrame(ComPtr<IDXGIResource> acquiredBuffer
SetFullPendingDamage(); SetFullPendingDamage();
return false; return false;
} }
}
/**
* Even though we have not performed any copy/draw operations we still need
* to use a fence. Because we share this texture with DirectX12 it is able to
* read from it before IddCx has finished updating it.
*/
if (!srcRes->Signal())
{
if (computeSlot)
computeSlot->Cancel();
copySlot->Cancel();
ReleaseCandidate(candidateIndex);
SetFullPendingDamage();
return false;
}
if (computeSlot)
{
if (!srcRes->Sync(*computeSlot)) if (!srcRes->Sync(*computeSlot))
{ {
computeSlot->Cancel(); computeSlot->Cancel();