summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2026-04-12 20:55:22 -0500
committerGitHub <noreply@github.com>2026-04-12 20:55:22 -0500
commitb62bfe4b30a03077790b61fd8bc4bcadcb0b673b (patch)
tree2a3b5909479267586f06f3bfb35a01f671cf0e75 /Source/Core
parent6ed8dec7ac6fd5113adc3664c10875fe452b4efe (diff)
parentfdbc2883ef3984f9f766aaca0dbae0cf3844e8d2 (diff)
Merge pull request #14336 from SuperSamus/arbitrary-mipmap-disables-gpu-decoding
VideoCommon: Invert interaction between Arbitrary Mipmap Detection and GPU Texture Decoding (the former disables the latter)
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/Config/Config.h8
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp2
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp61
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.h4
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/GraphicsPane.h2
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp10
-rw-r--r--Source/Core/VideoCommon/VideoConfig.h3
7 files changed, 39 insertions, 51 deletions
diff --git a/Source/Core/Common/Config/Config.h b/Source/Core/Common/Config/Config.h
index b749986f7e..d5357e194d 100644
--- a/Source/Core/Common/Config/Config.h
+++ b/Source/Core/Common/Config/Config.h
@@ -62,6 +62,14 @@ T Get(LayerType layer, const Info<T>& info)
}
template <typename T>
+T Get(const Layer* game_layer, const Info<T>& setting)
+{
+ if (game_layer != nullptr)
+ return game_layer->Get(setting);
+ return Get(setting);
+}
+
+template <typename T>
T Get(const Info<T>& info)
{
CachedValue<T> cached = info.GetCachedValue();
diff --git a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp
index 98089e6d3d..8e127f454b 100644
--- a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp
+++ b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp
@@ -33,7 +33,7 @@ AdvancedWidget::AdvancedWidget(GraphicsPane* gfx_pane) : m_game_layer{gfx_pane->
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [this](Core::State state) {
OnEmulationStateChanged(state != Core::State::Uninitialized);
});
- connect(m_manual_texture_sampling, &QCheckBox::toggled,
+ connect(m_manual_texture_sampling, &QCheckBox::toggled, gfx_pane,
[gfx_pane] { emit gfx_pane->UseFastTextureSamplingChanged(); });
OnBackendChanged();
diff --git a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp
index 57a7eb634f..276a75d9da 100644
--- a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp
+++ b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp
@@ -41,11 +41,11 @@ EnhancementsWidget::EnhancementsWidget(GraphicsPane* gfx_pane)
// BackendChanged is called by parent on window creation.
connect(gfx_pane, &GraphicsPane::BackendChanged, this, &EnhancementsWidget::OnBackendChanged);
connect(gfx_pane, &GraphicsPane::UseFastTextureSamplingChanged, this, [this] {
- m_texture_filtering_combo->setEnabled(ReadSetting(Config::GFX_HACK_FAST_TEXTURE_SAMPLING));
- });
- connect(gfx_pane, &GraphicsPane::UseGPUTextureDecodingChanged, this, [this] {
- m_arbitrary_mipmap_detection->setEnabled(!ReadSetting(Config::GFX_ENABLE_GPU_TEXTURE_DECODING));
+ m_texture_filtering_combo->setEnabled(
+ Get(m_game_layer, Config::GFX_HACK_FAST_TEXTURE_SAMPLING));
});
+ connect(m_arbitrary_mipmap_detection, &QCheckBox::toggled, gfx_pane,
+ [gfx_pane] { emit gfx_pane->UpdateGPUTextureDecoding(); });
}
constexpr int ANISO_1x = std::to_underlying(AnisotropicFilteringMode::Force1x);
@@ -82,8 +82,8 @@ void EnhancementsWidget::CreateWidgets()
// If the current scale is greater than the max scale in the ini, add sufficient options so that
// when the settings are saved we don't lose the user-modified value from the ini.
- const int max_efb_scale =
- std::max(ReadSetting(Config::GFX_EFB_SCALE), ReadSetting(Config::GFX_MAX_EFB_SCALE));
+ const int max_efb_scale = std::max(Get(m_game_layer, Config::GFX_EFB_SCALE),
+ Get(m_game_layer, Config::GFX_MAX_EFB_SCALE));
for (int scale = static_cast<int>(resolution_options.size()); scale <= max_efb_scale; scale++)
{
const QString scale_text = QString::number(scale);
@@ -129,7 +129,7 @@ void EnhancementsWidget::CreateWidgets()
m_texture_filtering_combo->Add(tr("Force Linear and 16x Anisotropic"), ANISO_16X,
FILTERING_LINEAR);
m_texture_filtering_combo->Refresh();
- m_texture_filtering_combo->setEnabled(ReadSetting(Config::GFX_HACK_FAST_TEXTURE_SAMPLING));
+ m_texture_filtering_combo->setEnabled(Get(m_game_layer, Config::GFX_HACK_FAST_TEXTURE_SAMPLING));
m_output_resampling_combo = new ConfigChoice(
{tr("Default"), tr("Bilinear"), tr("Bicubic: B-Spline"), tr("Bicubic: Mitchell-Netravali"),
@@ -162,7 +162,8 @@ void EnhancementsWidget::CreateWidgets()
m_arbitrary_mipmap_detection =
new ConfigBool(tr("Arbitrary Mipmap Detection"),
Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION, m_game_layer);
- m_arbitrary_mipmap_detection->setEnabled(!ReadSetting(Config::GFX_ENABLE_GPU_TEXTURE_DECODING));
+ m_arbitrary_mipmap_detection->setEnabled(
+ !Get(m_game_layer, Config::GFX_ENABLE_GPU_TEXTURE_DECODING));
m_hdr = new ConfigBool(tr("HDR Post-Processing"), Config::GFX_ENHANCE_HDR_OUTPUT, m_game_layer);
int row = 0;
@@ -241,7 +242,7 @@ void EnhancementsWidget::CreateWidgets()
m_3d_depth_value->setText(QString::asprintf("%.0f", m_3d_depth->GetValue()));
m_3d_convergence_value->setText(QString::asprintf("%.2f", m_3d_convergence->GetValue()));
- auto current_stereo_mode = ReadSetting(Config::GFX_STEREO_MODE);
+ auto current_stereo_mode = Get(m_game_layer, Config::GFX_STEREO_MODE);
if (current_stereo_mode != StereoMode::SBS && current_stereo_mode != StereoMode::TAB)
m_3d_per_eye_resolution->hide();
@@ -254,8 +255,8 @@ void EnhancementsWidget::CreateWidgets()
void EnhancementsWidget::ConnectWidgets()
{
- connect(m_3d_mode, &QComboBox::currentIndexChanged, [this] {
- auto current_stereo_mode = ReadSetting(Config::GFX_STEREO_MODE);
+ connect(m_3d_mode, &QComboBox::currentIndexChanged, this, [this] {
+ auto current_stereo_mode = Get(m_game_layer, Config::GFX_STEREO_MODE);
LoadPostProcessingShaders();
if (current_stereo_mode == StereoMode::SBS || current_stereo_mode == StereoMode::TAB)
@@ -279,18 +280,9 @@ void EnhancementsWidget::ConnectWidgets()
});
}
-template <typename T>
-T EnhancementsWidget::ReadSetting(const Config::Info<T>& setting) const
-{
- if (m_game_layer != nullptr)
- return m_game_layer->Get(setting);
- else
- return Config::Get(setting);
-}
-
void EnhancementsWidget::LoadPostProcessingShaders()
{
- auto stereo_mode = ReadSetting(Config::GFX_STEREO_MODE);
+ auto stereo_mode = Get(m_game_layer, Config::GFX_STEREO_MODE);
const QSignalBlocker blocker(m_post_processing_effect);
m_post_processing_effect->clear();
@@ -307,7 +299,7 @@ void EnhancementsWidget::LoadPostProcessingShaders()
if (stereo_mode != StereoMode::Anaglyph && stereo_mode != StereoMode::Passive)
m_post_processing_effect->addItem(tr("(off)"), QStringLiteral(""));
- auto selected_shader = ReadSetting(Config::GFX_ENHANCE_POST_SHADER);
+ auto selected_shader = Get(m_game_layer, Config::GFX_ENHANCE_POST_SHADER);
bool found = false;
@@ -337,7 +329,8 @@ void EnhancementsWidget::LoadPostProcessingShaders()
m_post_processing_effect->setCurrentIndex(index);
// Save forced shader, but avoid forcing an option into a game ini layer.
- if (m_game_layer == nullptr && ReadSetting(Config::GFX_ENHANCE_POST_SHADER) != selected_shader)
+ if (m_game_layer == nullptr &&
+ Get(m_game_layer, Config::GFX_ENHANCE_POST_SHADER) != selected_shader)
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_POST_SHADER, selected_shader);
}
@@ -380,7 +373,7 @@ void EnhancementsWidget::OnBackendChanged()
void EnhancementsWidget::ShaderChanged()
{
- auto shader = ReadSetting(Config::GFX_ENHANCE_POST_SHADER);
+ auto shader = Get(m_game_layer, Config::GFX_ENHANCE_POST_SHADER);
if (shader == "(off)" || shader == "")
{
@@ -406,18 +399,6 @@ void EnhancementsWidget::ShaderChanged()
}
}
-void EnhancementsWidget::OnConfigChanged()
-{
- // Only used for the GameConfigWidget. Bypasses graphics window signals and backend info due to it
- // being global.
- m_texture_filtering_combo->setEnabled(ReadSetting(Config::GFX_HACK_FAST_TEXTURE_SAMPLING));
- m_arbitrary_mipmap_detection->setEnabled(!ReadSetting(Config::GFX_ENABLE_GPU_TEXTURE_DECODING));
- UpdateAntialiasingOptions();
-
- // Needs to update after deleting a key for 3d settings.
- LoadPostProcessingShaders();
-}
-
void EnhancementsWidget::UpdateAntialiasingOptions()
{
const QSignalBlocker blocker(m_antialiasing_combo);
@@ -570,9 +551,9 @@ void EnhancementsWidget::AddDescriptions()
"effects.<br><br>May have false positives that result in blurry textures at increased "
"internal "
"resolution, such as in games that use very low resolution mipmaps. Disabling this can also "
- "reduce stutter in games that frequently load new textures.<br><br>This setting is disabled "
- "when GPU Texture Decoding is enabled.<br><br><dolphin_emphasis>If unsure, leave this "
- "unchecked.</dolphin_emphasis>");
+ "reduce stutter in games that frequently load new textures.<br><br>If this setting is "
+ "enabled, GPU Texture Decoding will be disabled.<br><br><dolphin_emphasis>If "
+ "unsure, leave this unchecked.</dolphin_emphasis>");
static const char TR_HDR_DESCRIPTION[] = QT_TR_NOOP(
"Enables scRGB HDR output (if supported by your graphics backend and monitor)."
" Fullscreen might be required."
@@ -637,7 +618,7 @@ void EnhancementsWidget::ConfigureColorCorrection()
void EnhancementsWidget::ConfigurePostProcessingShader()
{
- const std::string shader = ReadSetting(Config::GFX_ENHANCE_POST_SHADER);
+ const std::string shader = Get(m_game_layer, Config::GFX_ENHANCE_POST_SHADER);
PostProcessingConfigWindow dialog(this, shader);
dialog.exec();
}
diff --git a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.h b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.h
index 6309c6af0e..02205f526f 100644
--- a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.h
+++ b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.h
@@ -29,9 +29,6 @@ public:
explicit EnhancementsWidget(GraphicsPane* gfx_pane);
private:
- template <typename T>
- T ReadSetting(const Config::Info<T>& setting) const;
-
void CreateWidgets();
void ConnectWidgets();
void AddDescriptions();
@@ -40,7 +37,6 @@ private:
void UpdateAntialiasingOptions();
void LoadPostProcessingShaders();
void ShaderChanged();
- void OnConfigChanged();
void ConfigureColorCorrection();
void ConfigurePostProcessingShader();
diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsPane.h b/Source/Core/DolphinQt/Config/Graphics/GraphicsPane.h
index ffc55600ca..37ed7f8435 100644
--- a/Source/Core/DolphinQt/Config/Graphics/GraphicsPane.h
+++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsPane.h
@@ -23,7 +23,7 @@ public:
signals:
void BackendChanged(const QString& backend);
void UseFastTextureSamplingChanged();
- void UseGPUTextureDecodingChanged();
+ void UpdateGPUTextureDecoding();
private:
void CreateMainLayout();
diff --git a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp
index 6d1108774a..61df287dbb 100644
--- a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp
+++ b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp
@@ -27,8 +27,10 @@ HacksWidget::HacksWidget(GraphicsPane* gfx_pane) : m_game_layer{gfx_pane->GetCon
connect(gfx_pane, &GraphicsPane::BackendChanged, this, &HacksWidget::OnBackendChanged);
OnBackendChanged(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND)));
- connect(m_gpu_texture_decoding, &QCheckBox::toggled,
- [gfx_pane] { emit gfx_pane->UseGPUTextureDecodingChanged(); });
+ connect(gfx_pane, &GraphicsPane::UpdateGPUTextureDecoding, this, [this] {
+ m_gpu_texture_decoding->setEnabled(
+ !Get(m_game_layer, Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION));
+ });
}
void HacksWidget::CreateWidgets()
@@ -214,8 +216,8 @@ void HacksWidget::AddDescriptions()
static const char TR_GPU_DECODING_DESCRIPTION[] = QT_TR_NOOP(
"Enables texture decoding using the GPU instead of the CPU.<br><br>This may result in "
"performance gains in some scenarios, or on systems where the CPU is the "
- "bottleneck.<br><br>If this setting is enabled, Arbitrary Mipmap Detection will be "
- "disabled.<br><br>"
+ "bottleneck.<br><br>This setting is disabled when Arbitrary Mipmap Detection is "
+ "enabled.<br><br>"
"<dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
static const char TR_FAST_DEPTH_CALC_DESCRIPTION[] = QT_TR_NOOP(
"Uses a less accurate algorithm to calculate depth values.<br><br>Causes issues in a few "
diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h
index 3f82e3afe7..2d0ab116a1 100644
--- a/Source/Core/VideoCommon/VideoConfig.h
+++ b/Source/Core/VideoCommon/VideoConfig.h
@@ -364,7 +364,8 @@ struct VideoConfig final
}
bool UseGPUTextureDecoding() const
{
- return g_backend_info.bSupportsGPUTextureDecoding && bEnableGPUTextureDecoding;
+ return g_backend_info.bSupportsGPUTextureDecoding && bEnableGPUTextureDecoding &&
+ !bArbitraryMipmapDetection;
}
bool UseVertexRounding() const { return bVertexRounding && iEFBScale != 1; }
bool ManualTextureSamplingWithCustomTextureSizes() const