Skip to content

Commit

Permalink
Fix DLFG RecreateSwapchain livelock
Browse files Browse the repository at this point in the history
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

See merge request lightspeedrtx/dxvk-remix-nv!1172
  • Loading branch information
nv-nfreybler committed Nov 19, 2024
2 parents a088b16 + c20df83 commit dbe69dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/dxvk/rtx_render/rtx_dlfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dbe69dc

Please sign in to comment.