From a56efe5c365e757db89dfe0b365775e05bd02b2d Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 30 Jan 2026 20:39:53 -0600 Subject: [PATCH] Fix infinite renderer resets on SDL3 using direct3d renderer --- app/streaming/session.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index e150a0e7..e4768801 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -2182,13 +2182,6 @@ void Session::exec() updateOptimalWindowDisplayMode(); } - // Now that the old decoder is dead, flush any events it may - // have queued to reset itself (if this reset was the result - // of state loss). - SDL_PumpEvents(); - SDL_FlushEvent(SDL_RENDER_DEVICE_RESET); - SDL_FlushEvent(SDL_RENDER_TARGETS_RESET); - { // If the stream exceeds the display refresh rate (plus some slack), // forcefully disable V-sync to allow the stream to render faster @@ -2226,6 +2219,13 @@ void Session::exec() } } + // Flush any events queued by the renderer to reset itself. These are + // usually from the old renderer, but they can also be queued by the + // new renderer in certain cases (like SDL3's direct3d9 renderer). + SDL_PumpEvents(); + SDL_FlushEvent(SDL_RENDER_DEVICE_RESET); + SDL_FlushEvent(SDL_RENDER_TARGETS_RESET); + // Request an IDR frame to complete the reset LiRequestIdrFrame();