diff --git a/idd/LGIdd/CSwapChainProcessor.cpp b/idd/LGIdd/CSwapChainProcessor.cpp index 6415337a..cab09002 100644 --- a/idd/LGIdd/CSwapChainProcessor.cpp +++ b/idd/LGIdd/CSwapChainProcessor.cpp @@ -1403,17 +1403,6 @@ bool CSwapChainProcessor::SwapChainNewFrame(ComPtr acquiredBuffer 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}; bool noImageUpdate = false; if (moveRegionCount || dirtyRectCount > ARRAYSIZE(dirtyRects)) @@ -1688,7 +1677,25 @@ bool CSwapChainProcessor::SwapChainNewFrame(ComPtr acquiredBuffer SetFullPendingDamage(); 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)) { computeSlot->Cancel();