Add ZCULL control options to the GUI

This commit is contained in:
kd-11 2021-09-05 18:02:29 +03:00 committed by kd-11
parent 53457262d4
commit ea949a5f28
5 changed files with 69 additions and 12 deletions

View file

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

View file

@ -81,6 +81,7 @@ enum class emu_settings_type
MultithreadedRSX,
VBlankRate,
RelaxedZCULL,
PreciseZCULL,
DriverWakeUpDelay,
VulkanAsyncTextureUploads,
VulkanAsyncSchedulerDriver,
@ -232,6 +233,7 @@ inline static const QMap<emu_settings_type, cfg_location> 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"}},

View file

@ -1027,9 +1027,6 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> 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> 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<int>::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<const char*>(u8"%0 µs"), "Driver wake up delay"));

View file

@ -456,6 +456,36 @@
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_gpu_3" native="true">
<layout class="QHBoxLayout" name="widget_gpu_3_layout" stretch="1">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="gbZCULL">
<property name="title">
<string>ZCULL Accuracy</string>
</property>
<layout class="QVBoxLayout" name="gbZCULL_layout">
<item>
<widget class="QComboBox" name="zcullPrecisionMode"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="gpu_tab_layout_right_spacer">
<property name="orientation">
@ -2184,13 +2214,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="relaxedZCULL">
<property name="text">
<string>Relaxed ZCULL Sync</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View file

@ -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.");