diff --git a/rpcs3/Emu/system_config.h b/rpcs3/Emu/system_config.h index ceafe41f63..ca14727dbc 100644 --- a/rpcs3/Emu/system_config.h +++ b/rpcs3/Emu/system_config.h @@ -156,7 +156,7 @@ struct cfg_root : cfg::node cfg::_bool relaxed_zcull_sync{ this, "Relaxed ZCULL Sync", false }; cfg::_bool enable_3d{ this, "Enable 3D", false }; cfg::_bool debug_program_analyser{ this, "Debug Program Analyser", false }; - cfg::_bool precise_zpass_count{ this, "Accurate ZCULL stats", false }; + cfg::_bool precise_zpass_count{ this, "Accurate ZCULL stats", true }; cfg::_int<1, 8> consecutive_frames_to_draw{ this, "Consecutive Frames To Draw", 1, true}; cfg::_int<1, 8> consecutive_frames_to_skip{ this, "Consecutive Frames To Skip", 1, true}; cfg::_int<50, 800> resolution_scale_percent{ this, "Resolution Scale", 100 }; diff --git a/rpcs3/rpcs3qt/emu_settings_type.h b/rpcs3/rpcs3qt/emu_settings_type.h index 02e8b04a4d..e0b6a0c03d 100644 --- a/rpcs3/rpcs3qt/emu_settings_type.h +++ b/rpcs3/rpcs3qt/emu_settings_type.h @@ -81,6 +81,7 @@ enum class emu_settings_type MultithreadedRSX, VBlankRate, RelaxedZCULL, + PreciseZCULL, DriverWakeUpDelay, VulkanAsyncTextureUploads, VulkanAsyncSchedulerDriver, @@ -232,6 +233,7 @@ inline static const QMap settings_location = { emu_settings_type::ShaderCompilerNumThreads, { "Video", "Shader Compiler Threads"}}, { emu_settings_type::MultithreadedRSX, { "Video", "Multithreaded RSX"}}, { emu_settings_type::RelaxedZCULL, { "Video", "Relaxed ZCULL Sync"}}, + { emu_settings_type::PreciseZCULL, { "Video", "Accurate ZCULL stats"}}, { emu_settings_type::AnisotropicFilterOverride, { "Video", "Anisotropic Filter Override"}}, { emu_settings_type::ResolutionScale, { "Video", "Resolution Scale"}}, { emu_settings_type::MinimumScalableDimension, { "Video", "Minimum Scalable Dimension"}}, diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index 6fca2baa0c..2c8337da52 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -1027,9 +1027,6 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std m_emu_settings->EnhanceCheckBox(ui->disableOnDiskShaderCache, emu_settings_type::DisableOnDiskShaderCache); SubscribeTooltip(ui->disableOnDiskShaderCache, tooltips.settings.disable_on_disk_shader_cache); - m_emu_settings->EnhanceCheckBox(ui->relaxedZCULL, emu_settings_type::RelaxedZCULL); - SubscribeTooltip(ui->relaxedZCULL, tooltips.settings.relaxed_zcull); - // Comboboxes m_emu_settings->EnhanceComboBox(ui->maxSPURSThreads, emu_settings_type::MaxSPURSThreads, true); @@ -1042,6 +1039,41 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std m_emu_settings->EnhanceComboBox(ui->vulkansched, emu_settings_type::VulkanAsyncSchedulerDriver); SubscribeTooltip(ui->gb_vulkansched, tooltips.settings.vulkan_async_scheduler); + // Custom control that simplifies operation of two independent variables. Can probably be done better but this works. + ui->zcullPrecisionMode->addItems({tr("Precise (Default)"), tr("Approximate (Fast)"), tr("Relaxed (Fastest)")}); + if (m_emu_settings->GetSetting(emu_settings_type::RelaxedZCULL) == "true") + { + ui->zcullPrecisionMode->setCurrentIndex(2); + } + else if (m_emu_settings->GetSetting(emu_settings_type::PreciseZCULL) == "true") + { + ui->zcullPrecisionMode->setCurrentIndex(0); + } + else + { + ui->zcullPrecisionMode->setCurrentIndex(1); + } + connect(ui->zcullPrecisionMode, QOverload::of(&QComboBox::currentIndexChanged), [this](int index) + { + bool relaxed = false, precise = false; + + switch (index) + { + case 0: + precise = true; break; + case 1: + break; + case 2: + relaxed = true; break; + default: + fmt::throw_exception("Unexpected selection"); + } + + m_emu_settings->SetSetting(emu_settings_type::RelaxedZCULL, relaxed ? "true" : "false"); + m_emu_settings->SetSetting(emu_settings_type::PreciseZCULL, precise ? "true" : "false"); + }); + SubscribeTooltip(ui->gbZCULL, tooltips.settings.zcull_operation_mode); + // Sliders EnhanceSlider(emu_settings_type::DriverWakeUpDelay, ui->wakeupDelay, ui->wakeupText, tr(reinterpret_cast(u8"%0 µs"), "Driver wake up delay")); diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index 34f275c8b9..659a21dccb 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -456,6 +456,36 @@ + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + ZCULL Accuracy + + + + + + + + + + + @@ -2184,13 +2214,6 @@ - - - - Relaxed ZCULL Sync - - - diff --git a/rpcs3/rpcs3qt/tooltips.h b/rpcs3/rpcs3qt/tooltips.h index dc8b5a2787..9834f75176 100644 --- a/rpcs3/rpcs3qt/tooltips.h +++ b/rpcs3/rpcs3qt/tooltips.h @@ -30,7 +30,7 @@ public: const QString read_depth = tr("Initializes render target memory using vm memory."); const QString dump_depth = tr("Writes depth buffer values to vm memory."); const QString disable_on_disk_shader_cache = tr("Disables the loading and saving of shaders from and to the shader cache in the data directory."); - const QString relaxed_zcull = tr("Changes ZCULL report synchronization behaviour to be more forgiving to PC architecture.\nCan improve performance in some games but can also cause stability issues or drastically reduced performance in others.\nUse with caution and if performance or stability is compromised, keep this disabled."); + const QString zcull_operation_mode = tr("Changes ZCULL report synchronization behaviour. Use with caution.\n· Precise is the most accurate to PS3 behaviour.\n· Approximate is just a faster way to generate occlusion data which may not always match what the PS3 would generate.\n· Relaxed changes synchronization method completely and can 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 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."); const QString vblank_rate = tr("Adjusts the frequency of vertical blanking signals that the emulator sends.\nAffects timing of events which rely on these signals.");