Do not reset the renderer on SDL_RENDER_TARGETS_RESET

We only need to do this on a SDL_RENDER_DEVICE_RESET where we lose the whole device.

This also reverts a56efe5 since this change is not needed when handling the reset events properly.
This commit is contained in:
Cameron Gutman
2026-01-31 13:00:23 -06:00
parent a2122e17c6
commit 5020fc6f48
6 changed files with 15 additions and 17 deletions

View File

@@ -2156,7 +2156,6 @@ void Session::exec()
// Fall through
case SDL_RENDER_DEVICE_RESET:
case SDL_RENDER_TARGETS_RESET:
if (event.type != SDL_WINDOWEVENT) {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
@@ -2182,6 +2181,12 @@ 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 device loss or an internal error).
SDL_PumpEvents();
SDL_FlushEvent(SDL_RENDER_DEVICE_RESET);
{
// If the stream exceeds the display refresh rate (plus some slack),
// forcefully disable V-sync to allow the stream to render faster
@@ -2219,13 +2224,6 @@ 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();