Qt: Make relationship between vsync queue/optimal pacing clearer

This commit is contained in:
Connor McLaughlin 2022-05-24 18:42:36 +10:00 committed by refractionpcsx2
parent ae43cfaaf2
commit fa91d0b705
2 changed files with 21 additions and 4 deletions

View File

@ -67,6 +67,12 @@ EmulationSettingsWidget::EmulationSettingsWidget(SettingsDialog* dialog, QWidget
dialog->registerWidgetHelp(m_ui.perGameSettings, tr("Enable Per-Game Settings"), tr("Checked"),
tr("When enabled, per-game settings will be applied, and incompatible enhancements will be disabled. You should "
"leave this option enabled except when testing enhancements with incompatible games."));
dialog->registerWidgetHelp(m_ui.optimalFramePacing, tr("Optimal Frame Pacing"), tr("Unchecked"),
tr("Sets the vsync queue size to 0, making every frame be completed and presented by the GS before input is polled, and the next frame begins. "
"Using this setting can reduce input lag, at the cost of measurably higher CPU and GPU requirements."));
dialog->registerWidgetHelp(m_ui.maxFrameLatency, tr("Maximum Frame Latency"), tr("2 Frames"),
tr("Sets the maximum number of frames that can be queued up to the GS, before the CPU thread will wait for one of them to complete before continuing. "
"Higher values can assist with smoothing out irregular frame times, but add additional input lag."));
updateOptimalFramePacing();
}
@ -163,10 +169,20 @@ void EmulationSettingsWidget::onOptimalFramePacingChanged()
const QSignalBlocker sb(m_ui.maxFrameLatency);
std::optional<int> value;
bool optimal = false;
if (m_ui.optimalFramePacing->checkState() != Qt::PartiallyChecked)
value = m_ui.optimalFramePacing->isChecked() ? 0 : DEFAULT_FRAME_LATENCY;
{
optimal = m_ui.optimalFramePacing->isChecked();
value = optimal ? 0 : DEFAULT_FRAME_LATENCY;
}
else
{
value = m_dialog->getEffectiveIntValue("EmuCore/GS", "VsyncQueueSize", DEFAULT_FRAME_LATENCY);
optimal = (value == 0);
}
m_ui.maxFrameLatency->setValue(DEFAULT_FRAME_LATENCY);
m_ui.maxFrameLatency->setMinimum(optimal ? 0 : 1);
m_ui.maxFrameLatency->setValue(optimal ? 0 : DEFAULT_FRAME_LATENCY);
m_ui.maxFrameLatency->setEnabled(!m_dialog->isPerGameSettings() && !m_ui.optimalFramePacing->isChecked());
m_dialog->setIntSettingValue("EmuCore/GS", "VsyncQueueSize", value);
@ -190,5 +206,6 @@ void EmulationSettingsWidget::updateOptimalFramePacing()
m_ui.maxFrameLatency->setEnabled(!optimal);
}
m_ui.maxFrameLatency->setValue(optimal ? DEFAULT_FRAME_LATENCY : value);
m_ui.maxFrameLatency->setMinimum(optimal ? 0 : 1);
m_ui.maxFrameLatency->setValue(optimal ? 0 : value);
}

View File

@ -84,7 +84,7 @@
<string> frames</string>
</property>
<property name="minimum">
<number>0</number>
<number>1</number>
</property>
<property name="maximum">
<number>5</number>