Fixes missing window preview on Alt+Tab

There was a crash on Alt+Tab in fullscreen for some specific driver:

https://code.wildfiregames.com/D1212

It was related only to post processing so it's time to try to enable
rendering again (but with provided option to disable it). Also without
rendering we might have some bugs in other components. See:

https://github.com/libsdl-org/SDL/issues/5033#issuecomment-981819661

The issue is reported here (first one):

https://wildfiregames.com/forum/topic/129061-two-vulkan-issues-in-a27-and-unrelated-choppiness-caused-by-control-groups/
This commit is contained in:
Vladislav Belov
2026-07-14 19:47:31 +02:00
parent b89ab85415
commit 7ee476928b
3 changed files with 13 additions and 1 deletions
+4
View File
@@ -107,6 +107,10 @@ shadowscovermap = false
renderer.scale = 1.0
renderer.upscale.technique = "fsr"
; Allows to disable rendering when the game window is out of focus. It might
; save some performance or fix old driver crashes on out of focus.
renderer.renderwhenoutoffocus = "true"
vsync = false
particles = true
fog = true
@@ -174,6 +174,12 @@
"label": "Mouse grab in window mode",
"tooltip": "Constrain mouse in the window mode to the window boundaries.",
"config": "window.mousegrabinwindowmode"
},
{
"type": "boolean",
"label": "Render out of focus",
"tooltip": "To save GPU workload, disable rendering when the game window is out of focus.",
"config": "renderer.renderwhenoutoffocus"
}
]
},
+3 -1
View File
@@ -508,7 +508,9 @@ void CRenderer::Resize(int width, int height)
bool CRenderer::ShouldRender() const
{
return !g_app_minimized && (g_app_has_focus || !g_VideoMode.IsInFullscreen());
const bool shouldRenderWhenOutOfFocus{
g_ConfigDB.Get("renderer.renderwhenoutoffocus", true)};
return !g_app_minimized && (g_app_has_focus || shouldRenderWhenOutOfFocus);
}
void CRenderer::RenderFrame(const bool needsPresent)