From 908ddf359337b858cb2dc7a411c4845b9b8fc890 Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Mon, 13 Apr 2026 12:18:03 -0700 Subject: [PATCH 1/3] HacksWidget: Move function declarations to match convention Move function declarations before variable declarations. --- .../Core/DolphinQt/Config/Graphics/HacksWidget.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.h b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.h index 58504e791e..2148c41871 100644 --- a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.h +++ b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.h @@ -22,6 +22,14 @@ public: explicit HacksWidget(GraphicsPane* gfx_pane); private: + void CreateWidgets(); + void ConnectWidgets(); + void AddDescriptions(); + + void UpdateGPUTextureDecodingEnabled(); + void UpdateDeferEFBCopiesEnabled(); + void UpdateSkipPresentingDuplicateFramesEnabled(); + void OnBackendChanged(const QString& backend_name); // EFB @@ -48,12 +56,4 @@ private: ConfigBool* m_save_texture_cache_state; Config::Layer* m_game_layer = nullptr; - - void CreateWidgets(); - void ConnectWidgets(); - void AddDescriptions(); - - void UpdateGPUTextureDecodingEnabled(); - void UpdateDeferEFBCopiesEnabled(); - void UpdateSkipPresentingDuplicateFramesEnabled(); }; From b35223e0f361cafef844913cecd9fbe01061539b Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Mon, 13 Apr 2026 13:23:12 -0700 Subject: [PATCH 2/3] HacksWidget: Merge GPU Texture Decoding disabled tooltip with BalloonTip When GPU Texture Decoding is disabled, explain why in the BalloonTip instead of spawning a separate tooltip. --- .../DolphinQt/Config/Graphics/HacksWidget.cpp | 57 +++++++++++++------ .../DolphinQt/Config/Graphics/HacksWidget.h | 3 +- 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp index 66ca11f6af..274c789c90 100644 --- a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp @@ -25,10 +25,13 @@ HacksWidget::HacksWidget(GraphicsPane* gfx_pane) : m_game_layer{gfx_pane->GetCon ConnectWidgets(); AddDescriptions(); + const auto get_backend_name = []() { return tr(Config::Get(Config::MAIN_GFX_BACKEND).data()); }; + connect(gfx_pane, &GraphicsPane::BackendChanged, this, &HacksWidget::OnBackendChanged); - OnBackendChanged(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND))); connect(gfx_pane, &GraphicsPane::UpdateGPUTextureDecoding, this, - &HacksWidget::UpdateGPUTextureDecodingEnabled); + [this, get_backend_name] { UpdateGPUTextureDecodingEnabled(get_backend_name()); }); + + OnBackendChanged(get_backend_name()); } void HacksWidget::CreateWidgets() @@ -126,16 +129,14 @@ void HacksWidget::CreateWidgets() void HacksWidget::OnBackendChanged(const QString& backend_name) { const bool bbox = g_backend_info.bSupportsBBox; - const bool gpu_texture_decoding = g_backend_info.bSupportsGPUTextureDecoding; - - UpdateGPUTextureDecodingEnabled(); m_disable_bounding_box->setEnabled(bbox); const QString tooltip = tr("%1 doesn't support this feature on your system.") .arg(tr(backend_name.toStdString().c_str())); - m_gpu_texture_decoding->setToolTip(!gpu_texture_decoding ? tooltip : QString{}); m_disable_bounding_box->setToolTip(!bbox ? tooltip : QString{}); + + UpdateGPUTextureDecodingEnabled(backend_name); } void HacksWidget::ConnectWidgets() @@ -211,12 +212,6 @@ void HacksWidget::AddDescriptions() "

This setting is unavailable when Immediately Present XFB or VBI Skip is " "enabled. In those cases, duplicate frames are never presented." "

If unsure, leave this checked."); - 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.

This setting is disabled when Arbitrary Mipmap Detection is " - "enabled.

" - "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 " @@ -253,7 +248,6 @@ void HacksWidget::AddDescriptions() m_store_xfb_copies->SetDescription(tr(TR_STORE_XFB_TO_TEXTURE_DESCRIPTION)); m_immediate_xfb->SetDescription(tr(TR_IMMEDIATE_XFB_DESCRIPTION)); m_skip_duplicate_xfbs->SetDescription(tr(TR_SKIP_DUPLICATE_XFBS_DESCRIPTION)); - m_gpu_texture_decoding->SetDescription(tr(TR_GPU_DECODING_DESCRIPTION)); m_fast_depth_calculation->SetDescription(tr(TR_FAST_DEPTH_CALC_DESCRIPTION)); m_disable_bounding_box->SetDescription(tr(TR_DISABLE_BOUNDINGBOX_DESCRIPTION)); m_save_texture_cache_state->SetDescription(tr(TR_SAVE_TEXTURE_CACHE_TO_STATE_DESCRIPTION)); @@ -261,11 +255,40 @@ void HacksWidget::AddDescriptions() m_vi_skip->SetDescription(tr(TR_VI_SKIP_DESCRIPTION)); } -void HacksWidget::UpdateGPUTextureDecodingEnabled() +void HacksWidget::UpdateGPUTextureDecodingEnabled(const QString& backend_name) { - const bool gpu_texture_decoding = g_backend_info.bSupportsGPUTextureDecoding; - m_gpu_texture_decoding->setEnabled( - gpu_texture_decoding && !Get(m_game_layer, Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION)); + 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." + "

This setting is disabled when Arbitrary Mipmap Detection is enabled.

"); + + const bool gpu_texture_decoding_supported = g_backend_info.bSupportsGPUTextureDecoding; + const bool arbitrary_mipmap_detection_enabled = + Get(m_game_layer, Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION); + const bool gpu_texture_decoding_enabled = + gpu_texture_decoding_supported && !arbitrary_mipmap_detection_enabled; + m_gpu_texture_decoding->setEnabled(gpu_texture_decoding_enabled); + + if (!gpu_texture_decoding_supported) + { + m_gpu_texture_decoding->SetDescription(tr(TR_GPU_DECODING_DESCRIPTION) + + tr("The %1 backend doesn't support " + "GPU Texture Decoding.") + .arg(backend_name)); + } + else if (arbitrary_mipmap_detection_enabled) + { + m_gpu_texture_decoding->SetDescription( + tr(TR_GPU_DECODING_DESCRIPTION) + + tr("GPU Texture Decoding is currently disabled by Arbitrary Mipmap " + "Detection.")); + } + else + { + m_gpu_texture_decoding->SetDescription( + tr(TR_GPU_DECODING_DESCRIPTION) + + tr("If unsure, leave this unchecked.")); + } } void HacksWidget::UpdateDeferEFBCopiesEnabled() diff --git a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.h b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.h index 2148c41871..8dd16192a7 100644 --- a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.h +++ b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.h @@ -9,6 +9,7 @@ class ConfigBool; class ConfigSlider; class ConfigSliderLabel; class GraphicsPane; +class QString; namespace Config { @@ -26,7 +27,7 @@ private: void ConnectWidgets(); void AddDescriptions(); - void UpdateGPUTextureDecodingEnabled(); + void UpdateGPUTextureDecodingEnabled(const QString& backend_name); void UpdateDeferEFBCopiesEnabled(); void UpdateSkipPresentingDuplicateFramesEnabled(); From 518f5f458f16f54c5c3af4b6c49d11d9dec65db0 Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Mon, 13 Apr 2026 13:34:38 -0700 Subject: [PATCH 3/3] HacksWidget: Merge BoundingBox disabled tooltip into BalloonTip When a backend doesn't support BoundingBox, show that information in the BalloonTip instead of spawning a separate tooltip. --- .../DolphinQt/Config/Graphics/HacksWidget.cpp | 38 ++++++++++++------- .../DolphinQt/Config/Graphics/HacksWidget.h | 1 + 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp index 274c789c90..c2e04a8d4b 100644 --- a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp @@ -128,15 +128,8 @@ void HacksWidget::CreateWidgets() void HacksWidget::OnBackendChanged(const QString& backend_name) { - const bool bbox = g_backend_info.bSupportsBBox; - m_disable_bounding_box->setEnabled(bbox); - - const QString tooltip = tr("%1 doesn't support this feature on your system.") - .arg(tr(backend_name.toStdString().c_str())); - - m_disable_bounding_box->setToolTip(!bbox ? tooltip : QString{}); - UpdateGPUTextureDecodingEnabled(backend_name); + UpdateBoundingBoxEnabled(backend_name); } void HacksWidget::ConnectWidgets() @@ -216,10 +209,6 @@ void HacksWidget::AddDescriptions() "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 " "GPU.

If unsure, leave this checked."); - static const char TR_DISABLE_BOUNDINGBOX_DESCRIPTION[] = - QT_TR_NOOP("Disables bounding box emulation.

This may improve GPU performance " - "significantly, but some games will break.

If " - "unsure, leave this checked."); static const char TR_SAVE_TEXTURE_CACHE_TO_STATE_DESCRIPTION[] = QT_TR_NOOP("Includes the contents of the embedded frame buffer (EFB) and upscaled EFB copies " "in save states. Fixes missing and/or non-upscaled textures/objects when loading " @@ -249,7 +238,6 @@ void HacksWidget::AddDescriptions() m_immediate_xfb->SetDescription(tr(TR_IMMEDIATE_XFB_DESCRIPTION)); m_skip_duplicate_xfbs->SetDescription(tr(TR_SKIP_DUPLICATE_XFBS_DESCRIPTION)); m_fast_depth_calculation->SetDescription(tr(TR_FAST_DEPTH_CALC_DESCRIPTION)); - m_disable_bounding_box->SetDescription(tr(TR_DISABLE_BOUNDINGBOX_DESCRIPTION)); m_save_texture_cache_state->SetDescription(tr(TR_SAVE_TEXTURE_CACHE_TO_STATE_DESCRIPTION)); m_vertex_rounding->SetDescription(tr(TR_VERTEX_ROUNDING_DESCRIPTION)); m_vi_skip->SetDescription(tr(TR_VI_SKIP_DESCRIPTION)); @@ -291,6 +279,30 @@ void HacksWidget::UpdateGPUTextureDecodingEnabled(const QString& backend_name) } } +void HacksWidget::UpdateBoundingBoxEnabled(const QString& backend_name) +{ + static const char TR_DISABLE_BOUNDINGBOX_DESCRIPTION[] = + QT_TR_NOOP("Disables bounding box emulation.

This may improve GPU performance " + "significantly, but some games will break.

"); + + const bool bbox = g_backend_info.bSupportsBBox; + m_disable_bounding_box->setEnabled(bbox); + + if (bbox) + { + m_disable_bounding_box->SetDescription( + tr(TR_DISABLE_BOUNDINGBOX_DESCRIPTION) + + tr("If unsure, leave this checked.")); + } + else + { + m_disable_bounding_box->SetDescription(tr(TR_DISABLE_BOUNDINGBOX_DESCRIPTION) + + tr("The %1 backend doesn't support " + "Bounding Box emulation.") + .arg(backend_name)); + } +} + void HacksWidget::UpdateDeferEFBCopiesEnabled() { // We disable the checkbox for defer EFB copies when both EFB and XFB copies to texture are diff --git a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.h b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.h index 8dd16192a7..5569e14abf 100644 --- a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.h +++ b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.h @@ -28,6 +28,7 @@ private: void AddDescriptions(); void UpdateGPUTextureDecodingEnabled(const QString& backend_name); + void UpdateBoundingBoxEnabled(const QString& backend_name); void UpdateDeferEFBCopiesEnabled(); void UpdateSkipPresentingDuplicateFramesEnabled();