This commit is contained in:
Martino Fontana 2026-03-20 23:40:55 -05:00 committed by GitHub
commit 8d2a4ccbbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 42 additions and 92 deletions

View File

@ -15,8 +15,3 @@ EFBEmulateFormatChanges = True
[Video_Enhancements]
ArbitraryMipmapDetection = True
[Video_Settings]
# Allow the ArbitraryMipmapDetection setting to take effect.
EnableGPUTextureDecoding = False

View File

@ -21,10 +21,5 @@ MissingColorValue = 0x00000000
ForceTextureFiltering = 0
ArbitraryMipmapDetection = True
[Video_Settings]
# Allow the ArbitraryMipmapDetection setting to take effect.
EnableGPUTextureDecoding = False
[Video_Stereoscopy]
StereoConvergence = 732

View File

@ -10,7 +10,7 @@
# Add action replay cheats here.
[Video_Hacks]
# The game logic itself is ignoring VI interrupts
# The game logic itself is ignoring VI interrupts
# and keeps updating shadow video registers.
# Because of this, it is incompatible with VISkip.
@ -23,9 +23,5 @@ VISkip = False
CPUCull = True
# Allow the ArbitraryMipmapDetection setting to take effect.
EnableGPUTextureDecoding = False
[Video_Enhancements]
ArbitraryMipmapDetection = True

View File

@ -13,7 +13,7 @@
EFBAccessEnable = True
EFBToTextureEnable = False
# The game logic itself is ignoring VI interrupts
# The game logic itself is ignoring VI interrupts
# and keeps updating shadow video registers.
# Because of this, it is incompatible with VISkip.
@ -24,8 +24,3 @@ ArbitraryMipmapDetection = True
[Video_Stereoscopy]
StereoConvergence = 115
[Video_Settings]
# Allow the ArbitraryMipmapDetection setting to take effect.
EnableGPUTextureDecoding = False

View File

@ -15,8 +15,3 @@ EFBAccessDeferInvalidation = True
[Video_Enhancements]
ArbitraryMipmapDetection = True
[Video_Settings]
# Allow the ArbitraryMipmapDetection setting to take effect.
EnableGPUTextureDecoding = False

View File

@ -12,7 +12,7 @@
[Video_Hacks]
EFBAccessEnable = True
# The game logic itself is ignoring VI interrupts
# The game logic itself is ignoring VI interrupts
# and keeps updating shadow video registers.
# Because of this, it is incompatible with VISkip.
@ -25,9 +25,5 @@ VISkip = False
CPUCull = True
# Allow the ArbitraryMipmapDetection setting to take effect.
EnableGPUTextureDecoding = False
[Video_Enhancements]
ArbitraryMipmapDetection = True

View File

@ -17,8 +17,3 @@ ArbitraryMipmapDetection = True
[Video_Stereoscopy]
StereoConvergence = 929
[Video_Settings]
# Allow the ArbitraryMipmapDetection setting to take effect.
EnableGPUTextureDecoding = False

View File

@ -13,8 +13,3 @@ EFBEmulateFormatChanges = True
[Video_Enhancements]
ArbitraryMipmapDetection = True
[Video_Settings]
# Allow the ArbitraryMipmapDetection setting to take effect.
EnableGPUTextureDecoding = False

View File

@ -61,6 +61,14 @@ T Get(LayerType layer, const Info<T>& info)
return GetLayer(layer)->Get(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)
{

View File

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

View File

@ -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();
}

View File

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

View File

@ -23,7 +23,7 @@ public:
signals:
void BackendChanged(const QString& backend);
void UseFastTextureSamplingChanged();
void UseGPUTextureDecodingChanged();
void UpdateGPUTextureDecoding();
private:
void CreateMainLayout();

View File

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

View File

@ -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