[idd] serialize monitor replugs with swap chain teardown

Keep the replug lifecycle gated until the old swap chain has drained and
released its pending frame, and the replacement swap chain is fully
initialized. Coalesce additional requests into a follow-up replug to
prevent overlapping topology changes and IddCx release-frame timeout
bugchecks.
This commit is contained in:
Geoffrey McRae
2026-07-18 04:30:21 +10:00
parent de68e5ae97
commit 5adc22ebca
5 changed files with 108 additions and 16 deletions

View File

@@ -78,6 +78,7 @@ void CIndirectMonitorContext::AssignSwapChain(IDDCX_SWAPCHAIN swapChain, LUID re
break;
}
m_devContext->OnSwapChainAssigned();
std::unique_ptr<CSwapChainProcessor> processor(new CSwapChainProcessor(
m_monitor, m_devContext, swapChain, dx11Device, dx12Device, newFrameEvent));
@@ -103,7 +104,11 @@ void CIndirectMonitorContext::UnassignSwapChain()
dx12Device = std::move(m_dx12Device);
ReleaseSRWLockExclusive(&m_lock);
const bool hadSwapChain = !!processor;
processor.reset();
dx11Device.reset();
dx12Device.reset();
}
if (hadSwapChain)
m_devContext->OnSwapChainReleased();
}