From 87743c776d1f528bc1771666bd2d5b7f080f57e8 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 8 Jan 2025 15:29:56 +1000 Subject: [PATCH] FullscreenUI: Fix crash reloading postfx shaders --- src/core/fullscreen_ui.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/core/fullscreen_ui.cpp b/src/core/fullscreen_ui.cpp index 1a5b90b78..4f9bbdd89 100644 --- a/src/core/fullscreen_ui.cpp +++ b/src/core/fullscreen_ui.cpp @@ -4793,8 +4793,16 @@ void FullscreenUI::DrawPostProcessingSettingsPage() FSUI_CSTR("Reloads the shaders from disk, applying any changes."), bsi->GetBoolValue("PostProcessing", "Enabled", false))) { - if (GPUThread::HasGPUBackend() && PostProcessing::ReloadShaders()) - ShowToast(std::string(), FSUI_STR("Post-processing shaders reloaded.")); + // Have to defer because of the settings lock. + if (GPUThread::HasGPUBackend()) + { + Host::RunOnCPUThread([]() { + GPUThread::RunOnThread([]() { + if (PostProcessing::ReloadShaders()) + ShowToast(std::string(), FSUI_STR("Post-processing shaders reloaded.")); + }); + }); + } } MenuHeading(FSUI_CSTR("Operations"));