From 474e722b1754390cb43f02f53dd53cb1442d3868 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Tue, 26 Nov 2024 00:57:25 +0300 Subject: [PATCH] rsx/qt: Add option to disable async host MM to GUI --- rpcs3/Emu/RSX/Host/MM.cpp | 2 +- rpcs3/Emu/system_config.h | 2 +- rpcs3/rpcs3qt/emu_settings_type.h | 2 ++ rpcs3/rpcs3qt/settings_dialog.cpp | 3 +++ rpcs3/rpcs3qt/settings_dialog.ui | 7 +++++++ rpcs3/rpcs3qt/tooltips.h | 1 + 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/RSX/Host/MM.cpp b/rpcs3/Emu/RSX/Host/MM.cpp index d70b46823a..b5c5fb3494 100644 --- a/rpcs3/Emu/RSX/Host/MM.cpp +++ b/rpcs3/Emu/RSX/Host/MM.cpp @@ -33,7 +33,7 @@ namespace rsx void mm_protect(void* ptr, u64 length, utils::protection prot) { - if (!g_cfg.video.async_host_memory_manager) + if (g_cfg.video.disable_async_host_memory_manager) { utils::memory_protect(ptr, length, prot); return; diff --git a/rpcs3/Emu/system_config.h b/rpcs3/Emu/system_config.h index a3a14268f8..2bf582277c 100644 --- a/rpcs3/Emu/system_config.h +++ b/rpcs3/Emu/system_config.h @@ -178,7 +178,7 @@ struct cfg_root : cfg::node cfg::_bool decr_memory_layout{ this, "DECR memory layout", false}; // Force enable increased allowed main memory range as DECR console cfg::_bool host_label_synchronization{ this, "Allow Host GPU Labels", false }; cfg::_bool disable_msl_fast_math{ this, "Disable MSL Fast Math", false }; - cfg::_bool async_host_memory_manager{ this, "Asynchronous Host Memory Manager", true, true }; + cfg::_bool disable_async_host_memory_manager{ this, "Disable Asynchronous Memory Manager", false, true }; cfg::_enum output_scaling{ this, "Output Scaling Mode", output_scaling_mode::bilinear, true }; struct node_vk : cfg::node diff --git a/rpcs3/rpcs3qt/emu_settings_type.h b/rpcs3/rpcs3qt/emu_settings_type.h index f6b6268bd3..9eec1956ed 100644 --- a/rpcs3/rpcs3qt/emu_settings_type.h +++ b/rpcs3/rpcs3qt/emu_settings_type.h @@ -103,6 +103,7 @@ enum class emu_settings_type DisableMSLFastMath, OutputScalingMode, ForceHwMSAAResolve, + DisableAsyncHostMM, // Performance Overlay PerfOverlayEnabled, @@ -294,6 +295,7 @@ inline static const std::map settings_location { emu_settings_type::DisableMSLFastMath, { "Video", "Disable MSL Fast Math"}}, { emu_settings_type::OutputScalingMode, { "Video", "Output Scaling Mode"}}, { emu_settings_type::ForceHwMSAAResolve, { "Video", "Force Hardware MSAA Resolve"}}, + { emu_settings_type::DisableAsyncHostMM, { "Video", "Disable Asynchronous Memory Manager"}}, // Vulkan { emu_settings_type::VulkanAsyncTextureUploads, { "Video", "Vulkan", "Asynchronous Texture Streaming 2"}}, diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index aa3245ba8d..ace07fdba5 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -1593,6 +1593,9 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std ui->disableMslFastMath->setVisible(false); #endif + m_emu_settings->EnhanceCheckBox(ui->disableAsyncHostMM, emu_settings_type::DisableAsyncHostMM); + SubscribeTooltip(ui->disableAsyncHostMM, tooltips.settings.disable_async_host_mm); + // Comboboxes m_emu_settings->EnhanceComboBox(ui->maxSPURSThreads, emu_settings_type::MaxSPURSThreads, true); diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index 74c5629092..66b3b32088 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -2695,6 +2695,13 @@ + + + + Disable Asynchronous Memory Manager + + + diff --git a/rpcs3/rpcs3qt/tooltips.h b/rpcs3/rpcs3qt/tooltips.h index 99de286ec2..c6bfa15cf7 100644 --- a/rpcs3/rpcs3qt/tooltips.h +++ b/rpcs3/rpcs3qt/tooltips.h @@ -40,6 +40,7 @@ public: const QString allow_host_labels = tr("Allows the host GPU to synchronize with CELL directly. This incurs a performance penalty, but exposes the true state of GPU objects to the guest CPU. Can help eliminate visual noise and glitching at the cost of performance. Use with caution."); const QString force_hw_MSAA = tr("Forces MSAA to use the host GPU's resolve capabilities for all sampling operations.\nThis option incurs a performance penalty as well as the risk of visual artifacts but can yield crisper visuals when MSAA is enabled."); const QString disable_vertex_cache = tr("Disables the vertex cache.\nMight resolve missing or flickering graphics output.\nMay degrade performance."); + const QString disable_async_host_mm = tr("Force host memory management calls to be inlined instead of handled asynchronously.\nThis can cause severe performance degradation and stuttering in some games.\nThis option is only needed by developers to debug problems with texture cache memory protection."); const QString zcull_operation_mode = tr("Changes ZCULL report synchronization behaviour. Experiment to find the best option for your game. Approximate mode is recommended for most games.\n· Precise is the most accurate to PS3 behaviour. Required for accurate visuals in some titles such as Demon's Souls and The Darkness.\n· Approximate is a much faster way to generate occlusion data which may not always match what the PS3 would generate. Works well with most PS3 games.\n· Relaxed changes the synchronization method completely and can greatly improve performance in some games or completely break others."); const QString max_spurs_threads = tr("Limits the maximum number of SPURS threads in each thread group.\nMay improve performance in some cases, especially on systems with limited number of hardware threads.\nLimiting the number of threads is likely to cause crashes; it's recommended to keep this at the default value."); const QString sleep_timers_accuracy = tr("Changes the sleep period accuracy.\n'As Host' uses default accuracy of the underlying operating system, while 'All Timers' attempts to improve it.\n'Usleep Only' limits the adjustments to usleep syscall only.\nCan affect performance in unexpected ways.");