From c20df83bc34e036adfa3a19b12c21419102880e7 Mon Sep 17 00:00:00 2001 From: Nicholas Freybler Date: Tue, 19 Nov 2024 12:59:36 -0800 Subject: [PATCH] Fix DLFG RecreateSwapchain livelock Reset m_lastPresentStatus on DLFG recreateSwapChain - There existed a livelock in D3D9SwapChainEx::PresentImage when DLFG was enabled - If the DLFG Presenter fails to acquireNextImage, we enter a loop attempting to RecreateSwapChain - In that loop, the next call to acquireNextImage early-outs on a failed previous present status - Loop then reruns because the present status is kept as a failing - Fix: DLFG RecreateSwapchain needs to reset the present status to success to break the loop --- src/dxvk/rtx_render/rtx_dlfg.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dxvk/rtx_render/rtx_dlfg.cpp b/src/dxvk/rtx_render/rtx_dlfg.cpp index 6dba222d..af472614 100644 --- a/src/dxvk/rtx_render/rtx_dlfg.cpp +++ b/src/dxvk/rtx_render/rtx_dlfg.cpp @@ -220,6 +220,10 @@ namespace dxvk { if (res != VK_SUCCESS) { return res; } + + // Reset present status since we recreated the swapchain. This ensures we try to acquire + // during the next present instead of returning a stale error value. + m_lastPresentStatus = VK_SUCCESS; createBackbuffers(); return res;