mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Add an option to present/skip presenting duplicate frames
Currently, we do not display every second frame in 25fps/30fps games which run to vsync. This improves performance as there's less rendering for the GPU to perform, but when combined with vsync, could cause frame pacing issues. This commit adds an option to force every frame generated by the console to be displayed to the host, which may improve pacing for these games.
This commit is contained in:
@ -86,9 +86,12 @@ void HacksWidget::CreateWidgets()
|
||||
m_store_xfb_copies = new GraphicsBool(tr("Store XFB Copies to Texture Only"),
|
||||
Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM);
|
||||
m_immediate_xfb = new GraphicsBool(tr("Immediately Present XFB"), Config::GFX_HACK_IMMEDIATE_XFB);
|
||||
m_skip_duplicate_xfbs = new GraphicsBool(tr("Skip Presenting Duplicate Frames"),
|
||||
Config::GFX_HACK_SKIP_DUPLICATE_XFBS);
|
||||
|
||||
xfb_layout->addWidget(m_store_xfb_copies);
|
||||
xfb_layout->addWidget(m_immediate_xfb);
|
||||
xfb_layout->addWidget(m_skip_duplicate_xfbs);
|
||||
|
||||
// Other
|
||||
auto* other_box = new QGroupBox(tr("Other"));
|
||||
@ -117,6 +120,7 @@ void HacksWidget::CreateWidgets()
|
||||
setLayout(main_layout);
|
||||
|
||||
UpdateDeferEFBCopiesEnabled();
|
||||
UpdateSkipPresentingDuplicateFramesEnabled();
|
||||
}
|
||||
|
||||
void HacksWidget::OnBackendChanged(const QString& backend_name)
|
||||
@ -140,6 +144,8 @@ void HacksWidget::ConnectWidgets()
|
||||
[this](int) { UpdateDeferEFBCopiesEnabled(); });
|
||||
connect(m_store_xfb_copies, &QCheckBox::stateChanged,
|
||||
[this](int) { UpdateDeferEFBCopiesEnabled(); });
|
||||
connect(m_immediate_xfb, &QCheckBox::stateChanged,
|
||||
[this](int) { UpdateSkipPresentingDuplicateFramesEnabled(); });
|
||||
}
|
||||
|
||||
void HacksWidget::LoadSettings()
|
||||
@ -235,6 +241,12 @@ void HacksWidget::AddDescriptions()
|
||||
"expect all XFB copies to be displayed. However, turning this setting on reduces "
|
||||
"latency.\n\nIf unsure, leave this unchecked.");
|
||||
|
||||
static const char TR_SKIP_DUPLICATE_XFBS_DESCRIPTION[] = QT_TR_NOOP(
|
||||
"Skips presentation of duplicate frames (XFB copies) in 25fps/30fps games. This may improve "
|
||||
"performance on low-end devices, while making frame pacing less consistent.\n\nDisable this "
|
||||
"option as well as enabling V-Sync for optimal frame pacing.\n\nIf unsure, leave this "
|
||||
"checked.");
|
||||
|
||||
static const char TR_GPU_DECODING_DESCRIPTION[] =
|
||||
QT_TR_NOOP("Enables texture decoding using the GPU instead of the CPU.\n\nThis may result in "
|
||||
"performance gains in some scenarios, or on systems where the CPU is the "
|
||||
@ -263,6 +275,7 @@ void HacksWidget::AddDescriptions()
|
||||
AddDescription(m_accuracy, TR_ACCUARCY_DESCRIPTION);
|
||||
AddDescription(m_store_xfb_copies, TR_STORE_XFB_TO_TEXTURE_DESCRIPTION);
|
||||
AddDescription(m_immediate_xfb, TR_IMMEDIATE_XFB_DESCRIPTION);
|
||||
AddDescription(m_skip_duplicate_xfbs, TR_SKIP_DUPLICATE_XFBS_DESCRIPTION);
|
||||
AddDescription(m_gpu_texture_decoding, TR_GPU_DECODING_DESCRIPTION);
|
||||
AddDescription(m_fast_depth_calculation, TR_FAST_DEPTH_CALC_DESCRIPTION);
|
||||
AddDescription(m_disable_bounding_box, TR_DISABLE_BOUNDINGBOX_DESCRIPTION);
|
||||
@ -277,3 +290,10 @@ void HacksWidget::UpdateDeferEFBCopiesEnabled()
|
||||
const bool can_defer = m_store_efb_copies->isChecked() && m_store_xfb_copies->isChecked();
|
||||
m_defer_efb_copies->setEnabled(!can_defer);
|
||||
}
|
||||
|
||||
void HacksWidget::UpdateSkipPresentingDuplicateFramesEnabled()
|
||||
{
|
||||
// If Immediate XFB is on, there's no point to skipping duplicate XFB copies as immediate presents
|
||||
// when the XFB is created, therefore all XFB copies will be unique.
|
||||
m_skip_duplicate_xfbs->setEnabled(!m_immediate_xfb->isChecked());
|
||||
}
|
||||
|
Reference in New Issue
Block a user