From b969d8910372cab367483adad80419adf5c472ae Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Sat, 24 Sep 2022 23:50:41 -0700 Subject: [PATCH 1/2] Disable Texture Filtering dropdown when Manual Texture Sampling is checked See https://bugs.dolphin-emu.org/issues/13049 --- Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp | 4 ++++ .../Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp | 7 ++++++- Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp index 32b24440b6..afdedc3ea0 100644 --- a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp @@ -36,6 +36,10 @@ AdvancedWidget::AdvancedWidget(GraphicsWindow* parent) connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [this](Core::State state) { OnEmulationStateChanged(state != Core::State::Uninitialized); }); + connect(m_manual_texture_sampling, &QCheckBox::toggled, [this, parent] { + SaveSettings(); + emit parent->UseFastTextureSamplingChanged(); + }); OnBackendChanged(); OnEmulationStateChanged(Core::GetState() != Core::State::Uninitialized); diff --git a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp index f181780749..6edbffc0e9 100644 --- a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp @@ -39,6 +39,8 @@ EnhancementsWidget::EnhancementsWidget(GraphicsWindow* parent) : m_block_save(fa AddDescriptions(); connect(parent, &GraphicsWindow::BackendChanged, [this](const QString& backend) { LoadSettings(); }); + connect(parent, &GraphicsWindow::UseFastTextureSamplingChanged, this, + &EnhancementsWidget::LoadSettings); } constexpr int TEXTURE_FILTERING_DEFAULT = 0; @@ -292,6 +294,8 @@ void EnhancementsWidget::LoadPPShaders() void EnhancementsWidget::LoadSettings() { m_block_save = true; + m_texture_filtering_combo->setEnabled(Config::Get(Config::GFX_HACK_FAST_TEXTURE_SAMPLING)); + // Anti-Aliasing const u32 aa_selection = Config::Get(Config::GFX_MSAA); @@ -488,7 +492,8 @@ void EnhancementsWidget::AddDescriptions() "that are at oblique viewing angles. Force Nearest and Force Linear override the texture " "scaling filter selected by the game.

Any option except 'Default' will alter the look " "of the game's textures and might cause issues in a small number of " - "games.

If unsure, select 'Default'."); + "games.

This option is incompatible with Manual Texture Sampling.

" + "If unsure, select 'Default'."); static const char TR_OUTPUT_RESAMPLING_DESCRIPTION[] = QT_TR_NOOP("Affects how the game output is scaled to the window resolution." "
The performance mostly depends on the number of samples each method uses." diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.h b/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.h index 5949a2dda3..bc935d79e1 100644 --- a/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.h +++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.h @@ -24,6 +24,7 @@ public: signals: void BackendChanged(const QString& backend); + void UseFastTextureSamplingChanged(); private: void CreateMainLayout(); From d0afe36269478d518e3769ebae768cdd076f3d1d Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Sat, 24 Sep 2022 23:59:38 -0700 Subject: [PATCH 2/2] Disable Arbitrary Mipmap Detection checkbox when GPU Texture Decoding is enabled See https://bugs.dolphin-emu.org/issues/13049 --- .../Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp | 3 +++ Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.h | 1 + Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp | 8 ++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp index 6edbffc0e9..175a659510 100644 --- a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp @@ -41,6 +41,8 @@ EnhancementsWidget::EnhancementsWidget(GraphicsWindow* parent) : m_block_save(fa [this](const QString& backend) { LoadSettings(); }); connect(parent, &GraphicsWindow::UseFastTextureSamplingChanged, this, &EnhancementsWidget::LoadSettings); + connect(parent, &GraphicsWindow::UseGPUTextureDecodingChanged, this, + &EnhancementsWidget::LoadSettings); } constexpr int TEXTURE_FILTERING_DEFAULT = 0; @@ -295,6 +297,7 @@ void EnhancementsWidget::LoadSettings() { m_block_save = true; m_texture_filtering_combo->setEnabled(Config::Get(Config::GFX_HACK_FAST_TEXTURE_SAMPLING)); + m_arbitrary_mipmap_detection->setEnabled(!Config::Get(Config::GFX_ENABLE_GPU_TEXTURE_DECODING)); // Anti-Aliasing diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.h b/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.h index bc935d79e1..97673563b5 100644 --- a/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.h +++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.h @@ -25,6 +25,7 @@ public: signals: void BackendChanged(const QString& backend); void UseFastTextureSamplingChanged(); + void UseGPUTextureDecodingChanged(); private: void CreateMainLayout(); diff --git a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp index 9441966f0e..cfdfa866a4 100644 --- a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp @@ -31,6 +31,10 @@ HacksWidget::HacksWidget(GraphicsWindow* parent) connect(parent, &GraphicsWindow::BackendChanged, this, &HacksWidget::OnBackendChanged); OnBackendChanged(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND))); connect(&Settings::Instance(), &Settings::ConfigChanged, this, &HacksWidget::LoadSettings); + connect(m_gpu_texture_decoding, &QCheckBox::toggled, [this, parent] { + SaveSettings(); + emit parent->UseGPUTextureDecodingChanged(); + }); } void HacksWidget::CreateWidgets() @@ -264,8 +268,8 @@ void HacksWidget::AddDescriptions() static const char TR_GPU_DECODING_DESCRIPTION[] = QT_TR_NOOP( "Enables texture decoding using the GPU instead of the CPU.

This may result in " "performance gains in some scenarios, or on systems where the CPU is the " - "bottleneck.

If unsure, leave this " - "unchecked."); + "bottleneck.

This option is incompatible with Arbitrary Mipmap Detection.

" + "If unsure, leave this unchecked."); static const char TR_FAST_DEPTH_CALC_DESCRIPTION[] = QT_TR_NOOP( "Uses a less accurate algorithm to calculate depth values.

Causes issues in a few " "games, but can result in a decent speed increase depending on the game and/or "