From ca30131faaf94eff96b5b20159e5d16489b6d0ad Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sun, 1 Jul 2018 16:39:59 +0200 Subject: [PATCH] Qt: add new spu options to the settings dialog Also rework the layout a bit. We need to think about creating a firmware tab --- rpcs3/Emu/System.h | 2 +- rpcs3/Json/tooltips.json | 10 +- rpcs3/rpcs3qt/emu_settings.h | 12 ++ rpcs3/rpcs3qt/settings_dialog.cpp | 87 ++++++++----- rpcs3/rpcs3qt/settings_dialog.ui | 196 ++++++++++++++---------------- 5 files changed, 163 insertions(+), 144 deletions(-) diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index 58cbecfa47..6d7107d43d 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -337,7 +337,7 @@ struct cfg_root : cfg::node cfg::_int<0, 16> spu_delay_penalty{this, "SPU delay penalty", 3}; //Number of milliseconds to block a thread if a virtual 'core' isn't free cfg::_bool spu_loop_detection{this, "SPU loop detection", true}; //Try to detect wait loops and trigger thread yield cfg::_bool spu_shared_runtime{this, "SPU Shared Runtime", true}; // Share compiled SPU functions between all threads - cfg::_enum spu_block_size{this, "SPU Block Size"}; + cfg::_enum spu_block_size{this, "SPU Block Size", spu_block_size_type::safe}; cfg::_bool spu_accurate_getllar{this, "Accurate GETLLAR", false}; cfg::_bool spu_accurate_putlluc{this, "Accurate PUTLLUC", false}; cfg::_bool spu_verification{this, "SPU Verification", true}; // Should be enabled diff --git a/rpcs3/Json/tooltips.json b/rpcs3/Json/tooltips.json index 9bcf8c3fcf..19226401df 100644 --- a/rpcs3/Json/tooltips.json +++ b/rpcs3/Json/tooltips.json @@ -25,19 +25,25 @@ "liblv2": "This closely emulates how games can load and unload system module files on a real PlayStation 3.\nSome games require this.\nThis is the preferred option." }, "checkboxes": { - "hookStFunc": "Allows to hook some functions like 'memcpy' replacing them with high-level implementations. May do nothing or break things. Experimental.", + "spuCache": "Should normally stay enabled.\nDisable this if the cache becomes too large.\nDisabling it does not remove the existing cache.", "enableThreadScheduler": "Allows RPCS3 to manually schedule physical cores to run specific tasks on, instead of letting the OS handle it.\nVery useful on Windows, especially for AMD Ryzen systems where it can give huge performance gains.", "lowerSPUThrPrio": "Runs SPU threads with lower priority than PPU threads.\nUsually faster on an i3 or i5, possibly slower or no difference on an i7 or Ryzen.", "spuLoopDetection": "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." }, "comboboxes": { + "enableTSX": "Enable usage of TSX instructions.\nNeeds to be forced on some Haswell or Broadwell CPUs.\nForcing this on older Hardware can lead to system instability, use it with caution.", + "spuBlockSize": "This option controls the SPU analyser, particularly the size of compiled units. The Mega and Giga modes may improve performance by tying smaller units together, decreasing the number of compiled units but increasing their size.\nUse the Safe mode for maximum compatibility.", "preferredSPUThreads": "Some SPU stages are sensitive to race conditions and allowing a limited number at a time helps alleviate performance stalls.\nSetting this to a smaller value might improve performance and reduce stuttering in some games.\nLeave this on auto if performance is negatively affected when setting a small value." } }, "debug": { "ppuDebug": "Never use this.", "spuDebug": "Never use this.", - "enableTSX": "Enable usage of TSX instructions.\nNeeds to be forced on some Haswell or Broadwell CPUs.\nForcing this on older Hardware can lead to system instability, use it with caution.", + "spuVerification": "Never disable this.", + "setDAZandFTZ": "Never use this.", + "accurateGETLLAR": "Never use this.", + "accuratePUTLLUC": "Never use this.", + "hookStFunc": "Allows to hook some functions like 'memcpy' replacing them with high-level implementations. May do nothing or break things. Experimental.", "readColor": "Never use this.", "dumpDepth": "Never use this.", "readDepth": "Never use this.", diff --git a/rpcs3/rpcs3qt/emu_settings.h b/rpcs3/rpcs3qt/emu_settings.h index f54515d6b3..c6156a8beb 100644 --- a/rpcs3/rpcs3qt/emu_settings.h +++ b/rpcs3/rpcs3qt/emu_settings.h @@ -38,6 +38,12 @@ public: SPUDebug, MaxLLVMThreads, EnableTSX, + AccurateGETLLAR, + AccuratePUTLLUC, + SetDAZandFTZ, + SPUBlockSize, + SPUCache, + SPUVerification, // Graphics Renderer, @@ -208,6 +214,12 @@ private: { SPUDebug, { "Core", "SPU Debug"}}, { MaxLLVMThreads, { "Core", "Max LLVM Compile Threads"}}, { EnableTSX, { "Core", "Enable TSX"}}, + { AccurateGETLLAR, { "Core", "Accurate GETLLAR"}}, + { AccuratePUTLLUC, { "Core", "Accurate PUTLLUC"}}, + { SetDAZandFTZ, { "Core", "Set DAZ and FTZ"}}, + { SPUBlockSize, { "Core", "SPU Block Size"}}, + { SPUCache, { "Core", "SPU Cache"}}, + { SPUVerification, { "Core", "SPU Verification"}}, // Graphics Tab { Renderer, { "Video", "Renderer"}}, diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index fe127428c2..60ad627165 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -168,8 +168,8 @@ settings_dialog::settings_dialog(std::shared_ptr guiSettings, std: // Checkboxes - xemu_settings->EnhanceCheckBox(ui->hookStFunc, emu_settings::HookStaticFuncs); - SubscribeTooltip(ui->hookStFunc, json_cpu_cbs["hookStFunc"].toString()); + xemu_settings->EnhanceCheckBox(ui->spuCache, emu_settings::SPUCache); + SubscribeTooltip(ui->spuCache, json_cpu_cbs["spuCache"].toString()); xemu_settings->EnhanceCheckBox(ui->enableScheduler, emu_settings::EnableThreadScheduler); SubscribeTooltip(ui->enableScheduler, json_cpu_cbs["enableThreadScheduler"].toString()); @@ -182,10 +182,48 @@ settings_dialog::settings_dialog(std::shared_ptr guiSettings, std: // Comboboxes + xemu_settings->EnhanceComboBox(ui->spuBlockSize, emu_settings::SPUBlockSize); + SubscribeTooltip(ui->spuBlockSize, json_cpu_cbo["spuBlockSize"].toString()); + xemu_settings->EnhanceComboBox(ui->preferredSPUThreads, emu_settings::PreferredSPUThreads, true); SubscribeTooltip(ui->preferredSPUThreads, json_cpu_cbo["preferredSPUThreads"].toString()); ui->preferredSPUThreads->setItemText(ui->preferredSPUThreads->findData("0"), tr("Auto")); + if (utils::has_rtm()) + { + xemu_settings->EnhanceComboBox(ui->enableTSX, emu_settings::EnableTSX); + SubscribeTooltip(ui->enableTSX, json_cpu_cbo["enableTSX"].toString()); + + static const QString tsx_forced = qstr(fmt::format("%s", tsx_usage::forced)); + static const QString tsx_default = qstr(xemu_settings->GetSettingDefault(emu_settings::EnableTSX)); + + // connect the toogled signal so that the stateChanged signal in EnhanceCheckBox can be prevented + connect(ui->enableTSX, &QComboBox::currentTextChanged, [this](const QString& text) + { + if (text == tsx_forced && !utils::has_mpx() && QMessageBox::No == QMessageBox::critical(this, tr("Haswell/Broadwell TSX Warning"), tr( + R"( +

+ RPCS3 has detected you are using TSX functions on a Haswell or Broadwell CPU.
+ Intel has deactivated these functions in newer Microcode revisions, since they can lead to unpredicted behaviour.
+ That means using TSX may break games or even damage your data.
+ We recommend to disable this feature and update your computer BIOS.

+ Do you wish to use TSX anyway? +

+ )" + ), QMessageBox::Yes, QMessageBox::No)) + { + // Reset if the messagebox was answered with no. This prevents the currentIndexChanged signal in EnhanceComboBox + ui->enableTSX->setCurrentText(tsx_default); + } + }); + } + else + { + ui->enableTSX->setEnabled(false); + ui->enableTSX->addItem(tr("Not supported")); + SubscribeTooltip(ui->enableTSX, tr("Unfortunately your cpu model does not support this instruction set.")); + } + // PPU tool tips SubscribeTooltip(ui->ppu_precise, json_cpu_ppu["precise"].toString()); SubscribeTooltip(ui->ppu_fast, json_cpu_ppu["fast"].toString()); @@ -326,6 +364,8 @@ settings_dialog::settings_dialog(std::shared_ptr guiSettings, std: ui->lleList->addItem(item); } + ui->searchBox->setPlaceholderText(tr("Search libraries")); + auto l_OnLibButtonClicked = [=](int ind) { if (ind == (int)lib_loading_type::manual || ind == (int)lib_loading_type::both) @@ -1082,39 +1122,20 @@ settings_dialog::settings_dialog(std::shared_ptr guiSettings, std: xemu_settings->EnhanceCheckBox(ui->spuDebug, emu_settings::SPUDebug); SubscribeTooltip(ui->spuDebug, json_debug["spuDebug"].toString()); - if (utils::has_rtm()) - { - xemu_settings->EnhanceComboBox(ui->enableTSX, emu_settings::EnableTSX); - SubscribeTooltip(ui->enableTSX, json_debug["enableTSX"].toString()); + xemu_settings->EnhanceCheckBox(ui->spuVerification, emu_settings::SPUVerification); + SubscribeTooltip(ui->spuVerification, json_debug["spuVerification"].toString()); - static const QString tsx_forced = qstr(fmt::format("%s", tsx_usage::forced)); - static const QString tsx_default = qstr(xemu_settings->GetSettingDefault(emu_settings::EnableTSX)); + xemu_settings->EnhanceCheckBox(ui->setDAZandFTZ, emu_settings::SetDAZandFTZ); + SubscribeTooltip(ui->setDAZandFTZ, json_debug["setDAZandFTZ"].toString()); - // connect the toogled signal so that the stateChanged signal in EnhanceCheckBox can be prevented - connect(ui->enableTSX, &QComboBox::currentTextChanged, [this](const QString& text) - { - if (text == tsx_forced && !utils::has_mpx() && QMessageBox::No == QMessageBox::critical(this, tr("Haswell/Broadwell TSX Warning"), tr( - R"( -

- RPCS3 has detected you are using TSX functions on a Haswell or Broadwell CPU.
- Intel has deactivated these functions in newer Microcode revisions, since they can lead to unpredicted behaviour.
- That means using TSX may break games or even damage your data.
- We recommend to disable this feature and update your computer BIOS.

- Do you wish to use TSX anyway? -

- )" - ), QMessageBox::Yes, QMessageBox::No)) - { - // Reset if the messagebox was answered with no. This prevents the currentIndexChanged signal in EnhanceComboBox - ui->enableTSX->setCurrentText(tsx_default); - } - }); - } - else - { - ui->label_enableTSX->setHidden(true); - ui->enableTSX->setHidden(true); - } + xemu_settings->EnhanceCheckBox(ui->accurateGETLLAR, emu_settings::AccurateGETLLAR); + SubscribeTooltip(ui->accurateGETLLAR, json_debug["accurateGETLLAR"].toString()); + + xemu_settings->EnhanceCheckBox(ui->accuratePUTLLUC, emu_settings::AccuratePUTLLUC); + SubscribeTooltip(ui->accuratePUTLLUC, json_debug["accuratePUTLLUC"].toString()); + + xemu_settings->EnhanceCheckBox(ui->hookStFunc, emu_settings::HookStaticFuncs); + SubscribeTooltip(ui->hookStFunc, json_debug["hookStFunc"].toString()); // // Layout fix for High Dpi diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index b969e0a60a..0001971973 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -6,8 +6,8 @@ 0 0 - 849 - 615 + 752 + 519 @@ -44,7 +44,7 @@ - + @@ -115,7 +115,13 @@ - + + + + 0 + 0 + + Preferred SPU Threads @@ -129,7 +135,7 @@ - + @@ -225,15 +231,33 @@ - + - Hook static functions + SPU Cache + + + + + 0 + 0 + + + + SPU Block Size + + + + + + + + @@ -266,15 +290,6 @@ - - - - - - - Search Libraries - - @@ -288,6 +303,24 @@ + + + + + 0 + 0 + + + + TSX Instructions + + + + + + + + @@ -344,7 +377,7 @@ - + @@ -789,23 +822,10 @@ - + - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 0 - 0 - - - + @@ -927,20 +947,7 @@ - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 0 - 0 - - - + @@ -1026,20 +1033,7 @@ - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 0 - 0 - - - + @@ -1064,20 +1058,7 @@ - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 0 - 0 - - - + @@ -1147,23 +1128,10 @@ - + - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 0 - 0 - - - + @@ -1252,7 +1220,7 @@ - Show framerate counter in window title + Show framerate in the window title @@ -1321,7 +1289,7 @@ - Don't use doubleclick for Fullscreen mode + Ignore doubleclicks for Fullscreen @@ -1980,14 +1948,39 @@ - + - Enable TSX: + SPU Verification - + + + Set DAZ and FTZ + + + + + + + Accurate GETLLAR + + + + + + + Accurate PUTLLUC + + + + + + + Hook static functions + + @@ -2006,20 +1999,7 @@ - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 0 - 0 - - - +