diff --git a/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.cpp b/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.cpp index 4164fe2cdd..9d9b96482a 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.cpp +++ b/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.cpp @@ -24,6 +24,8 @@ #include "VideoCommon/PostProcessing.h" #include "VideoCommon/VideoConfig.h" +constexpr const char* DUBOIS_ALGORITHM_SHADER = "dubois"; + EnhancementsWidget::EnhancementsWidget(GraphicsWindow* parent) : GraphicsWidget(parent), m_block_save(false) { @@ -131,28 +133,19 @@ void EnhancementsWidget::ConnectWidgets() connect(m_pp_effect, static_cast(&QComboBox::currentIndexChanged), [this](int) { SaveSettings(); }); connect(m_3d_mode, static_cast(&QComboBox::currentIndexChanged), - [this](int) { SaveSettings(); }); + [this] { + m_block_save = true; + LoadPPShaders(); + m_block_save = false; + + SaveSettings(); + }); connect(m_configure_pp_effect, &QPushButton::pressed, this, &EnhancementsWidget::ConfigurePostProcessingShader); } -void EnhancementsWidget::LoadSettings() +void EnhancementsWidget::LoadPPShaders() { - m_block_save = true; - // Anti-Aliasing - - int aa_selection = Config::Get(Config::GFX_MSAA); - bool ssaa = Config::Get(Config::GFX_SSAA); - - m_aa_combo->clear(); - for (const auto& option : VideoUtils::GetAvailableAntialiasingModes(m_msaa_modes)) - m_aa_combo->addItem(option == "None" ? tr("None") : QString::fromStdString(option)); - - m_aa_combo->setCurrentText( - QString::fromStdString(std::to_string(aa_selection) + "x " + (ssaa ? "SSAA" : "MSAA"))); - m_aa_combo->setEnabled(m_aa_combo->count() > 1); - - // Post Processing Shader std::vector shaders = g_Config.stereo_mode == StereoMode::Anaglyph ? PostProcessingShaderImplementation::GetAnaglyphShaderList( @@ -187,6 +180,26 @@ void EnhancementsWidget::LoadSettings() pp_shader.LoadShader(selected_shader); m_configure_pp_effect->setEnabled(pp_shader.HasOptions()); } +} + +void EnhancementsWidget::LoadSettings() +{ + m_block_save = true; + // Anti-Aliasing + + int aa_selection = Config::Get(Config::GFX_MSAA); + bool ssaa = Config::Get(Config::GFX_SSAA); + + m_aa_combo->clear(); + for (const auto& option : VideoUtils::GetAvailableAntialiasingModes(m_msaa_modes)) + m_aa_combo->addItem(option == "None" ? tr("None") : QString::fromStdString(option)); + + m_aa_combo->setCurrentText( + QString::fromStdString(std::to_string(aa_selection) + "x " + (ssaa ? "SSAA" : "MSAA"))); + m_aa_combo->setEnabled(m_aa_combo->count() > 1); + + // Post Processing Shader + LoadPPShaders(); bool supports_stereoscopy = g_Config.backend_info.bSupportsGeometryShaders; m_3d_mode->setEnabled(supports_stereoscopy); @@ -232,6 +245,8 @@ void EnhancementsWidget::SaveSettings() { m_configure_pp_effect->setEnabled(false); } + + LoadSettings(); } void EnhancementsWidget::AddDescriptions() diff --git a/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.h b/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.h index 7997ec7ea4..ed0b90ea21 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.h +++ b/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.h @@ -26,6 +26,7 @@ private: void ConnectWidgets(); void AddDescriptions(); void ConfigurePostProcessingShader(); + void LoadPPShaders(); // Enhancements QComboBox* m_ir_combo; diff --git a/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp b/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp index 64634e2a41..bb2b2dd917 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp +++ b/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp @@ -28,6 +28,7 @@ GraphicsWindow::GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindo : QDialog(parent), m_xrr_config(xrr_config) { g_Config.Refresh(); + g_video_backend->InitBackendInfo(); CreateMainLayout();