FullscreenUI: Fix crash reloading postfx shaders

This commit is contained in:
Stenzek 2025-01-08 15:29:56 +10:00
parent 45afc8f7b1
commit 87743c776d
No known key found for this signature in database
1 changed files with 10 additions and 2 deletions

View File

@ -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"));