Add SPU XFloat Accuracy combobox

This commit is contained in:
Nekotekina 2022-04-08 14:36:15 +03:00
parent 544cec0434
commit f4d0286109
3 changed files with 45 additions and 24 deletions

View File

@ -206,17 +206,35 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
m_emu_settings->EnhanceCheckBox(ui->spuLoopDetection, emu_settings_type::SPULoopDetection); m_emu_settings->EnhanceCheckBox(ui->spuLoopDetection, emu_settings_type::SPULoopDetection);
SubscribeTooltip(ui->spuLoopDetection, tooltips.settings.spu_loop_detection); SubscribeTooltip(ui->spuLoopDetection, tooltips.settings.spu_loop_detection);
m_emu_settings->EnhanceCheckBox(ui->accurateXFloat, emu_settings_type::AccurateXFloat);
SubscribeTooltip(ui->accurateXFloat, tooltips.settings.accurate_xfloat);
m_emu_settings->EnhanceCheckBox(ui->approximateXFloat, emu_settings_type::ApproximateXFloat);
SubscribeTooltip(ui->approximateXFloat, tooltips.settings.approximate_xfloat);
m_emu_settings->EnhanceCheckBox(ui->fullWidthAVX512, emu_settings_type::FullWidthAVX512); m_emu_settings->EnhanceCheckBox(ui->fullWidthAVX512, emu_settings_type::FullWidthAVX512);
SubscribeTooltip(ui->fullWidthAVX512, tooltips.settings.full_width_avx512); SubscribeTooltip(ui->fullWidthAVX512, tooltips.settings.full_width_avx512);
ui->fullWidthAVX512->setEnabled(utils::has_avx512()); ui->fullWidthAVX512->setEnabled(utils::has_avx512());
// Comboboxes // Comboboxes
SubscribeTooltip(ui->gb_xfloat_accuracy, tooltips.settings.xfloat);
ui->xfloatAccuracy->addItem(tr("Accurate XFloat"));
ui->xfloatAccuracy->addItem(tr("Approximate XFloat"));
ui->xfloatAccuracy->addItem(tr("Relaxed XFloat"));
connect(ui->xfloatAccuracy, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this](int index)
{
if (index < 0) return;
m_emu_settings->SetSetting(emu_settings_type::AccurateXFloat, index == 0 ? "true" : "false");
m_emu_settings->SetSetting(emu_settings_type::ApproximateXFloat, index == 1 ? "true" : "false");
});
connect(m_emu_settings.get(), &emu_settings::RestoreDefaultsSignal, this, [this]()
{
ui->xfloatAccuracy->setCurrentIndex(1);
});
if (m_emu_settings->GetSetting(emu_settings_type::AccurateXFloat) == "true")
ui->xfloatAccuracy->setCurrentIndex(0);
else if (m_emu_settings->GetSetting(emu_settings_type::ApproximateXFloat) == "true")
ui->xfloatAccuracy->setCurrentIndex(1);
else
ui->xfloatAccuracy->setCurrentIndex(2);
m_emu_settings->EnhanceComboBox(ui->spuBlockSize, emu_settings_type::SPUBlockSize); m_emu_settings->EnhanceComboBox(ui->spuBlockSize, emu_settings_type::SPUBlockSize);
SubscribeTooltip(ui->gb_spuBlockSize, tooltips.settings.spu_block_size); SubscribeTooltip(ui->gb_spuBlockSize, tooltips.settings.spu_block_size);
@ -376,10 +394,10 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
case static_cast<int>(spu_decoder_type::_static): case static_cast<int>(spu_decoder_type::_static):
case static_cast<int>(spu_decoder_type::dynamic): case static_cast<int>(spu_decoder_type::dynamic):
case static_cast<int>(spu_decoder_type::llvm): case static_cast<int>(spu_decoder_type::llvm):
ui->accurateXFloat->setEnabled(true); ui->xfloatAccuracy->setEnabled(true);
break; break;
case static_cast<int>(spu_decoder_type::asmjit): case static_cast<int>(spu_decoder_type::asmjit):
ui->accurateXFloat->setEnabled(false); ui->xfloatAccuracy->setEnabled(false);
break; break;
default: default:
break; break;

View File

@ -152,6 +152,24 @@
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="coreTabMiddleLayout"> <layout class="QVBoxLayout" name="coreTabMiddleLayout">
<item>
<widget class="QGroupBox" name="gb_xfloat_accuracy">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>SPU XFloat Accuracy</string>
</property>
<layout class="QVBoxLayout" name="gb_xfloat_accuracy_layout">
<item>
<widget class="QComboBox" name="xfloatAccuracy"/>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QGroupBox" name="checkboxes"> <widget class="QGroupBox" name="checkboxes">
<property name="title"> <property name="title">
@ -165,20 +183,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="accurateXFloat">
<property name="text">
<string>Accurate xfloat</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="approximateXFloat">
<property name="text">
<string>Approximate xfloat</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="fullWidthAVX512"> <widget class="QCheckBox" name="fullWidthAVX512">
<property name="text"> <property name="text">

View File

@ -64,8 +64,7 @@ public:
const QString spu_dynamic = tr("Alternative interpreter (slow). May be faster than static interpreter. Try this if SPU Recompiler (LLVM) doesn't work."); const QString spu_dynamic = tr("Alternative interpreter (slow). May be faster than static interpreter. Try this if SPU Recompiler (LLVM) doesn't work.");
const QString spu_asmjit = tr("Recompiles the game's SPU code using the ASMJIT Recompiler.\nThis is the fast option with very good compatibility.\nIf unsure, use this option."); const QString spu_asmjit = tr("Recompiles the game's SPU code using the ASMJIT Recompiler.\nThis is the fast option with very good compatibility.\nIf unsure, use this option.");
const QString spu_llvm = tr("Recompiles and caches the game's SPU code using the LLVM Recompiler before running which adds extra start-up time.\nThis is the fastest option with very good compatibility.\nIf you experience issues, use the ASMJIT Recompiler."); const QString spu_llvm = tr("Recompiles and caches the game's SPU code using the LLVM Recompiler before running which adds extra start-up time.\nThis is the fastest option with very good compatibility.\nIf you experience issues, use the ASMJIT Recompiler.");
const QString accurate_xfloat = tr("Adds extra accuracy to SPU float vectors processing.\nFixes bugs in various games at the cost of performance.\nThis setting is only applied when SPU Decoder is set to Dynamic or LLVM."); const QString xfloat = tr("Control accuracy to SPU float vectors processing.\nFixes bugs in various games at the cost of performance.\nThis setting is only applied when SPU Decoder is set to Dynamic or LLVM.");
const QString approximate_xfloat = tr("Default accuracy for SPU float vectors processing.\nFixes bugs in various games at the cost of performance.\nThis setting is only applied when SPU Decoder is set to Dynamic or LLVM.");
const QString enable_thread_scheduler = tr("Control how RPCS3 utilizes the threads of your system.\nEach option heavily depends on the game and on your CPU. It's recommended to try each option to find out which performs the best.\nChanging the thread scheduler is not supported on CPUs with less than 12 threads."); const QString enable_thread_scheduler = tr("Control how RPCS3 utilizes the threads of your system.\nEach option heavily depends on the game and on your CPU. It's recommended to try each option to find out which performs the best.\nChanging the thread scheduler is not supported on CPUs with less than 12 threads.");
const QString spu_loop_detection = tr("Try to detect loop conditions in SPU kernels and use them as scheduling hints.\nImproves performance and reduces CPU usage.\nMay cause severe audio stuttering in rare cases."); const QString spu_loop_detection = tr("Try to detect loop conditions in SPU kernels and use them as scheduling hints.\nImproves performance and reduces CPU usage.\nMay cause severe audio stuttering in rare cases.");
const QString enable_tsx = tr("Enable usage of TSX instructions.\nNeeds to be forced on some Haswell or Broadwell CPUs or CPUs with the TSX-FA instruction set.\nForcing TSX in these cases may lead to system and performance instability, use it with caution."); const QString enable_tsx = tr("Enable usage of TSX instructions.\nNeeds to be forced on some Haswell or Broadwell CPUs or CPUs with the TSX-FA instruction set.\nForcing TSX in these cases may lead to system and performance instability, use it with caution.");