From 75f07cb28c9dd0a422f7e5f2fbcbd5cc9a081d7a Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sat, 29 Mar 2025 00:56:16 +0000 Subject: [PATCH] [idd] driver: improve reInit logic on failure --- idd/LGIdd/CIndirectMonitorContext.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/idd/LGIdd/CIndirectMonitorContext.cpp b/idd/LGIdd/CIndirectMonitorContext.cpp index 806787fe..049f0c5b 100644 --- a/idd/LGIdd/CIndirectMonitorContext.cpp +++ b/idd/LGIdd/CIndirectMonitorContext.cpp @@ -39,6 +39,7 @@ CIndirectMonitorContext::~CIndirectMonitorContext() void CIndirectMonitorContext::AssignSwapChain(IDDCX_SWAPCHAIN swapChain, LUID renderAdapter, HANDLE newFrameEvent) { +reInit: m_swapChain.reset(); m_dx11Device = std::make_shared(renderAdapter); if (FAILED(m_dx11Device->Init())) @@ -59,9 +60,9 @@ void CIndirectMonitorContext::AssignSwapChain(IDDCX_SWAPCHAIN swapChain, LUID re return; case CD3D12Device::RETRY: - WdfObjectDelete(swapChain); - m_devContext->ReplugMonitor(); - return; + m_dx12Device.reset(); + m_dx11Device.reset(); + goto reInit; } if (!m_devContext->SetupLGMP(alignSize))