From 3ae78b8e762787a3114baeabec2dd0178562ed1c Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Tue, 31 Jan 2023 00:49:23 +1300 Subject: Also use events for config changed --- Source/Core/VideoCommon/VideoConfig.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'Source/Core/VideoCommon/VideoConfig.cpp') diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index 86cfc97ade..7f710730bc 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -256,6 +256,9 @@ void CheckForConfigChanges() const u32 old_game_mod_changes = g_ActiveConfig.graphics_mod_config ? g_ActiveConfig.graphics_mod_config->GetChangeCount() : 0; const bool old_graphics_mods_enabled = g_ActiveConfig.bGraphicMods; + const AspectMode old_suggested_aspect_mode = g_ActiveConfig.suggested_aspect_mode; + const bool old_widescreen_hack = g_ActiveConfig.bWidescreenHack; + const auto old_post_processing_shader = g_ActiveConfig.sPostProcessingShader; UpdateActiveConfig(); FreeLook::UpdateActiveConfig(); @@ -301,22 +304,21 @@ void CheckForConfigChanges() changed_bits |= CONFIG_CHANGE_BIT_BBOX; if (g_renderer->CalculateTargetSize()) changed_bits |= CONFIG_CHANGE_BIT_TARGET_SIZE; - - g_presenter->CheckForConfigChanges(changed_bits); + if (old_suggested_aspect_mode != g_ActiveConfig.suggested_aspect_mode) + changed_bits |= CONFIG_CHANGE_BIT_ASPECT_RATIO; + if (old_widescreen_hack != g_ActiveConfig.bWidescreenHack) + changed_bits |= CONFIG_CHANGE_BIT_ASPECT_RATIO; + if (old_post_processing_shader != g_ActiveConfig.sPostProcessingShader) + changed_bits |= CONFIG_CHANGE_BIT_POST_PROCESSING_SHADER; // No changes? if (changed_bits == 0) return; - // Notify the backend of the changes, if any. - g_gfx->OnConfigChanged(changed_bits); + // Notify all listeners + ConfigChangedEvent::Trigger(changed_bits); - // If there's any shader changes, wait for the GPU to finish before destroying anything. - if (changed_bits & (CONFIG_CHANGE_BIT_HOST_CONFIG | CONFIG_CHANGE_BIT_MULTISAMPLES)) - { - g_gfx->WaitForGPUIdle(); - g_gfx->SetPipeline(nullptr); - } + // TODO: Move everything else to the ConfigChanged event // Framebuffer changed? if (changed_bits & (CONFIG_CHANGE_BIT_MULTISAMPLES | CONFIG_CHANGE_BIT_STEREO_MODE | -- cgit v1.2.3