From 7641bbf5f213d2bebebd9fd6054be94c5a6b27a3 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Thu, 18 Feb 2021 02:05:27 +1000 Subject: [PATCH] UI: Shuffle around PGXP settings --- src/duckstation-qt/advancedsettingswidget.cpp | 31 ++++++++----------- .../enhancementsettingswidget.cpp | 13 +++++++- .../enhancementsettingswidget.ui | 16 +++++++++- src/frontend-common/fullscreen_ui.cpp | 13 ++++---- 4 files changed, 46 insertions(+), 27 deletions(-) diff --git a/src/duckstation-qt/advancedsettingswidget.cpp b/src/duckstation-qt/advancedsettingswidget.cpp index 691fe9816..310a9e699 100644 --- a/src/duckstation-qt/advancedsettingswidget.cpp +++ b/src/duckstation-qt/advancedsettingswidget.cpp @@ -150,9 +150,6 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(QtHostInterface* host_interface, addBooleanTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("PGXP Vertex Cache"), "GPU", "PGXPVertexCache", false); - addBooleanTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("PGXP CPU Mode"), "GPU", "PGXPCPU", false); - addBooleanTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("PGXP Preserve Projection Precision"), "GPU", - "PGXPPreserveProjFP", false); addFloatRangeTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("PGXP Geometry Tolerance"), "GPU", "PGXPTolerance", -1.0f, 10.0f, 0.5f, -1.0f); addFloatRangeTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("PGXP Depth Clear Threshold"), "GPU", @@ -217,23 +214,21 @@ void AdvancedSettingsWidget::onResetToDefaultClicked() setBooleanTweakOption(m_ui.tweakOptionTable, 0, false); setIntRangeTweakOption(m_ui.tweakOptionTable, 1, 0); setBooleanTweakOption(m_ui.tweakOptionTable, 2, false); - setBooleanTweakOption(m_ui.tweakOptionTable, 3, false); - setBooleanTweakOption(m_ui.tweakOptionTable, 4, false); - setFloatRangeTweakOption(m_ui.tweakOptionTable, 5, -1.0f); - setFloatRangeTweakOption(m_ui.tweakOptionTable, 6, Settings::DEFAULT_GPU_PGXP_DEPTH_THRESHOLD); + setFloatRangeTweakOption(m_ui.tweakOptionTable, 3, -1.0f); + setFloatRangeTweakOption(m_ui.tweakOptionTable, 4, Settings::DEFAULT_GPU_PGXP_DEPTH_THRESHOLD); + setBooleanTweakOption(m_ui.tweakOptionTable, 5, false); + setChoiceTweakOption(m_ui.tweakOptionTable, 6, Settings::DEFAULT_CPU_FASTMEM_MODE); setBooleanTweakOption(m_ui.tweakOptionTable, 7, false); - setChoiceTweakOption(m_ui.tweakOptionTable, 8, Settings::DEFAULT_CPU_FASTMEM_MODE); + setBooleanTweakOption(m_ui.tweakOptionTable, 8, false); setBooleanTweakOption(m_ui.tweakOptionTable, 9, false); setBooleanTweakOption(m_ui.tweakOptionTable, 10, false); setBooleanTweakOption(m_ui.tweakOptionTable, 11, false); - setBooleanTweakOption(m_ui.tweakOptionTable, 12, false); - setBooleanTweakOption(m_ui.tweakOptionTable, 13, false); - setIntRangeTweakOption(m_ui.tweakOptionTable, 14, Settings::DEFAULT_VRAM_WRITE_DUMP_WIDTH_THRESHOLD); - setIntRangeTweakOption(m_ui.tweakOptionTable, 15, Settings::DEFAULT_VRAM_WRITE_DUMP_HEIGHT_THRESHOLD); - setIntRangeTweakOption(m_ui.tweakOptionTable, 16, static_cast(Settings::DEFAULT_DMA_MAX_SLICE_TICKS)); - setIntRangeTweakOption(m_ui.tweakOptionTable, 17, static_cast(Settings::DEFAULT_DMA_HALT_TICKS)); - setIntRangeTweakOption(m_ui.tweakOptionTable, 18, static_cast(Settings::DEFAULT_GPU_FIFO_SIZE)); - setIntRangeTweakOption(m_ui.tweakOptionTable, 19, static_cast(Settings::DEFAULT_GPU_MAX_RUN_AHEAD)); - setBooleanTweakOption(m_ui.tweakOptionTable, 20, false); - setBooleanTweakOption(m_ui.tweakOptionTable, 21, true); + setIntRangeTweakOption(m_ui.tweakOptionTable, 12, Settings::DEFAULT_VRAM_WRITE_DUMP_WIDTH_THRESHOLD); + setIntRangeTweakOption(m_ui.tweakOptionTable, 13, Settings::DEFAULT_VRAM_WRITE_DUMP_HEIGHT_THRESHOLD); + setIntRangeTweakOption(m_ui.tweakOptionTable, 14, static_cast(Settings::DEFAULT_DMA_MAX_SLICE_TICKS)); + setIntRangeTweakOption(m_ui.tweakOptionTable, 15, static_cast(Settings::DEFAULT_DMA_HALT_TICKS)); + setIntRangeTweakOption(m_ui.tweakOptionTable, 16, static_cast(Settings::DEFAULT_GPU_FIFO_SIZE)); + setIntRangeTweakOption(m_ui.tweakOptionTable, 17, static_cast(Settings::DEFAULT_GPU_MAX_RUN_AHEAD)); + setBooleanTweakOption(m_ui.tweakOptionTable, 18, false); + setBooleanTweakOption(m_ui.tweakOptionTable, 19, true); } diff --git a/src/duckstation-qt/enhancementsettingswidget.cpp b/src/duckstation-qt/enhancementsettingswidget.cpp index 270d7c4a7..08ee4f407 100644 --- a/src/duckstation-qt/enhancementsettingswidget.cpp +++ b/src/duckstation-qt/enhancementsettingswidget.cpp @@ -33,6 +33,9 @@ EnhancementSettingsWidget::EnhancementSettingsWidget(QtHostInterface* host_inter SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.pgxpTextureCorrection, "GPU", "PGXPTextureCorrection", true); SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.pgxpDepthBuffer, "GPU", "PGXPDepthBuffer", false); + SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.pgxpPreserveProjPrecision, "GPU", + "PGXPPreserveProjFP", false); + SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.pgxpCPU, "GPU", "PGXPCPU", false); connect(m_ui.resolutionScale, QOverload::of(&QComboBox::currentIndexChanged), this, &EnhancementSettingsWidget::updateScaledDitheringEnabled); @@ -106,9 +109,15 @@ EnhancementSettingsWidget::EnhancementSettingsWidget(QtHostInterface* host_inter tr("Uses perspective-correct interpolation for texture coordinates and colors, " "straightening out warped textures. Requires geometry correction enabled.")); dialog->registerWidgetHelp( - m_ui.pgxpDepthBuffer, tr("Depth Buffer"), tr("Unchecked"), + m_ui.pgxpDepthBuffer, tr("Depth Buffer (Low Compatibility)"), tr("Unchecked"), tr("Attempts to reduce polygon Z-fighting by testing pixels against the depth values from PGXP. Low compatibility, " "but can work well in some games. Other games may need a threshold adjustment.")); + dialog->registerWidgetHelp( + m_ui.pgxpPreserveProjPrecision, tr("Preserve Projection Precision"), tr("Unchecked"), + tr("Adds additional precision to PGXP data post-projection. May improve visuals in some games.")); + dialog->registerWidgetHelp(m_ui.pgxpCPU, tr("CPU Mode (Very Slow)"), tr("Unchecked"), + tr("Uses PGXP for all instructions, not just memory operations. Required for PGXP to " + "correct wobble in some games, but has a very high performance cost.")); } EnhancementSettingsWidget::~EnhancementSettingsWidget() = default; @@ -146,6 +155,8 @@ void EnhancementSettingsWidget::updatePGXPSettingsEnabled() m_ui.pgxpCulling->setEnabled(enabled); m_ui.pgxpTextureCorrection->setEnabled(enabled); m_ui.pgxpDepthBuffer->setEnabled(enabled); + m_ui.pgxpPreserveProjPrecision->setEnabled(enabled); + m_ui.pgxpCPU->setEnabled(enabled); } void EnhancementSettingsWidget::msaaModeChanged(int index) diff --git a/src/duckstation-qt/enhancementsettingswidget.ui b/src/duckstation-qt/enhancementsettingswidget.ui index 872907418..d8df81245 100644 --- a/src/duckstation-qt/enhancementsettingswidget.ui +++ b/src/duckstation-qt/enhancementsettingswidget.ui @@ -151,9 +151,23 @@ + + + Preserve Projection Precision + + + + - Depth Buffer + Depth Buffer (Low Compatibility) + + + + + + + CPU Mode (Very Slow) diff --git a/src/frontend-common/fullscreen_ui.cpp b/src/frontend-common/fullscreen_ui.cpp index 52d5fc67f..50a15906b 100644 --- a/src/frontend-common/fullscreen_ui.cpp +++ b/src/frontend-common/fullscreen_ui.cpp @@ -1781,10 +1781,16 @@ void DrawSettingsWindow() ToggleButton("PGXP Culling Correction", "Increases the precision of polygon culling, reducing the number of holes in geometry.", &s_settings_copy.gpu_pgxp_culling, s_settings_copy.gpu_pgxp_enable); + settings_changed |= + ToggleButton("PGXP Preserve Projection Precision", + "Adds additional precision to PGXP data post-projection. May improve visuals in some games.", + &s_settings_copy.gpu_pgxp_preserve_proj_fp, s_settings_copy.gpu_pgxp_enable); settings_changed |= ToggleButton( "PGXP Depth Buffer", "Reduces polygon Z-fighting through depth testing. Low compatibility with games.", &s_settings_copy.gpu_pgxp_depth_buffer, s_settings_copy.gpu_pgxp_enable && s_settings_copy.gpu_pgxp_texture_correction); + settings_changed |= ToggleButton("PGXP CPU Mode", "Uses PGXP for all instructions, not just memory operations.", + &s_settings_copy.gpu_pgxp_cpu, s_settings_copy.gpu_pgxp_enable); EndMenuButtons(); } @@ -1876,16 +1882,9 @@ void DrawSettingsWindow() MenuHeading("PGXP Settings"); - settings_changed |= - ToggleButton("Enable PGXP CPU Mode", "Uses PGXP for all instructions, not just memory operations.", - &s_settings_copy.gpu_pgxp_cpu, s_settings_copy.gpu_pgxp_enable); settings_changed |= ToggleButton( "Enable PGXP Vertex Cache", "Uses screen positions to resolve PGXP data. May improve visuals in some games.", &s_settings_copy.gpu_pgxp_vertex_cache, s_settings_copy.gpu_pgxp_enable); - settings_changed |= - ToggleButton("Enable PGXP Preserve Projection Precision", - "Adds additional precision to PGXP data post-projection. May improve visuals in some games.", - &s_settings_copy.gpu_pgxp_preserve_proj_fp, s_settings_copy.gpu_pgxp_enable); settings_changed |= RangeButton( "PGXP Geometry Tolerance", "Sets a threshold for discarding precise values when exceeded. May help with glitches in some games.",