From 9293c82b24358d8622ca60b6512d33b402092bee Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 9 Mar 2019 12:36:32 +1000 Subject: [PATCH] DolphinQt: Add option for deferred EFB cache invalidation --- .../Config/Graphics/AdvancedWidget.cpp | 18 ++++++++++++++++++ .../DolphinQt/Config/Graphics/AdvancedWidget.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp index 77c690b13e..04f7863de6 100644 --- a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp @@ -105,9 +105,20 @@ void AdvancedWidget::CreateWidgets() misc_layout->addWidget(m_borderless_fullscreen, 1, 1); #endif + // Experimental. + auto* experimental_box = new QGroupBox(tr("Experimental")); + auto* experimental_layout = new QGridLayout(); + experimental_box->setLayout(experimental_layout); + + m_defer_efb_access_invalidation = + new GraphicsBool(tr("Defer EFB Cache Invalidation"), Config::GFX_HACK_EFB_DEFER_INVALIDATION); + + experimental_layout->addWidget(m_defer_efb_access_invalidation, 0, 0); + main_layout->addWidget(debugging_box); main_layout->addWidget(utility_box); main_layout->addWidget(misc_box); + main_layout->addWidget(experimental_box); main_layout->addStretch(); setLayout(main_layout); @@ -194,6 +205,12 @@ void AdvancedWidget::AddDescriptions() "this option may result in a performance improvement on systems with more than " "two CPU cores. Currently, this is limited to the Vulkan backend.\n\nIf unsure, " "leave this checked."); + static const char TR_DEFER_EFB_ACCESS_INVALIDATION_DESCRIPTION[] = + QT_TR_NOOP("Defers invalidation of the EFB access cache until a GPU synchronization command " + "is executed. If disabled, the cache will be invalidated with every draw call. " + "May improve performance in some games which rely on CPU EFB Access at the cost " + "of stability.\n\nIf unsure, leave this unchecked."); + #ifdef _WIN32 static const char TR_BORDERLESS_FULLSCREEN_DESCRIPTION[] = QT_TR_NOOP( "Implements fullscreen mode with a borderless window spanning the whole screen instead of " @@ -223,4 +240,5 @@ void AdvancedWidget::AddDescriptions() #ifdef _WIN32 AddDescription(m_borderless_fullscreen, TR_BORDERLESS_FULLSCREEN_DESCRIPTION); #endif + AddDescription(m_defer_efb_access_invalidation, TR_DEFER_EFB_ACCESS_INVALIDATION_DESCRIPTION); } diff --git a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.h b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.h index b0eaf6bf11..acfbc78392 100644 --- a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.h +++ b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.h @@ -46,4 +46,7 @@ private: QCheckBox* m_enable_prog_scan; QCheckBox* m_backend_multithreading; QCheckBox* m_borderless_fullscreen; + + // Experimental + QCheckBox* m_defer_efb_access_invalidation; };