UI: Shuffle around PGXP settings

This commit is contained in:
Connor McLaughlin 2021-02-18 02:05:27 +10:00
parent 209827b67c
commit 7641bbf5f2
4 changed files with 46 additions and 27 deletions

View File

@ -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<int>(Settings::DEFAULT_DMA_MAX_SLICE_TICKS));
setIntRangeTweakOption(m_ui.tweakOptionTable, 17, static_cast<int>(Settings::DEFAULT_DMA_HALT_TICKS));
setIntRangeTweakOption(m_ui.tweakOptionTable, 18, static_cast<int>(Settings::DEFAULT_GPU_FIFO_SIZE));
setIntRangeTweakOption(m_ui.tweakOptionTable, 19, static_cast<int>(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<int>(Settings::DEFAULT_DMA_MAX_SLICE_TICKS));
setIntRangeTweakOption(m_ui.tweakOptionTable, 15, static_cast<int>(Settings::DEFAULT_DMA_HALT_TICKS));
setIntRangeTweakOption(m_ui.tweakOptionTable, 16, static_cast<int>(Settings::DEFAULT_GPU_FIFO_SIZE));
setIntRangeTweakOption(m_ui.tweakOptionTable, 17, static_cast<int>(Settings::DEFAULT_GPU_MAX_RUN_AHEAD));
setBooleanTweakOption(m_ui.tweakOptionTable, 18, false);
setBooleanTweakOption(m_ui.tweakOptionTable, 19, true);
}

View File

@ -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<int>::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)

View File

@ -151,9 +151,23 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="pgxpPreserveProjPrecision">
<property name="text">
<string>Preserve Projection Precision</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="pgxpDepthBuffer">
<property name="text">
<string>Depth Buffer</string>
<string>Depth Buffer (Low Compatibility)</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="pgxpCPU">
<property name="text">
<string>CPU Mode (Very Slow)</string>
</property>
</widget>
</item>

View File

@ -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.",