[idd] publish frames after copy submission

Submit the D3D12 copy before exposing the frame through LGMP, preventing
clients from waiting on work that has not yet been queued. Track the
last published buffer separately for safe subscriber resends and handle
submission failures.
This commit is contained in:
Geoffrey McRae
2026-07-17 23:49:57 +10:00
parent 21b978e1df
commit d0bc4f3e07
3 changed files with 38 additions and 16 deletions

View File

@@ -224,7 +224,8 @@ bool CSwapChainProcessor::SwapChainThreadCore()
if (frameNumber != lastFrameNumber)
{
lastFrameNumber = frameNumber;
SwapChainNewFrame(surface, dirtyRectCount, colorSpace, sdrWhiteLevel);
if (!SwapChainNewFrame(surface, dirtyRectCount, colorSpace, sdrWhiteLevel))
DEBUG_WARN("Failed to submit frame");
// report that all GPU processing for this frame has been queued
hr = IddCxSwapChainFinishedProcessingFrame(m_hSwapChain);
@@ -582,9 +583,10 @@ bool CSwapChainProcessor::SwapChainNewFrame(ComPtr<IDXGIResource> acquiredBuffer
memcpy(m_dirtyRects, currentDirtyRects, nbDirtyRects * sizeof(*m_dirtyRects));
m_nbDirtyRects = nbDirtyRects;
copyQueue->Execute();
if (!copyQueue->Execute())
return false;
return true;
return m_devContext->PublishFrameBuffer(buffer.frameIndex);
}
DWORD CALLBACK CSwapChainProcessor::_CursorThread(LPVOID arg)