diff --git a/rpcs3/Json/tooltips.json b/rpcs3/Json/tooltips.json index 95dc186dac..95fcd43b07 100644 --- a/rpcs3/Json/tooltips.json +++ b/rpcs3/Json/tooltips.json @@ -26,9 +26,24 @@ "checkboxes": { "hookStFunc": "Placebo setting, this does nothing at all.", "bindSPUThreads": "If your CPU has SMT (Hyper-Threading) SPU threads will run on these logical cores instead.\nUsually faster on an i3, possibly slower or no difference on an i7 or Ryzen.", - "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." + "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": "" + }, + "comboboxes": { + "preferredSPUThreads": "" } }, + "debug": { + "readColor": "Never use this.", + "dumpDepth": "Never use this.", + "readDepth": "Never use this.", + "glLegacyBuffers": "Enables use of classic OpenGL buffers which allows capturing tools to work with RPCS3 e.g RenderDoc.\nIf unsure, don't use this option.", + "scrictModeRendering": "Enforces strict compliance to the API specification.\nMight result in degraded performance in some games.\nCan resolve rare cases of missing graphics and flickering.\nIf unsure, don't use this option.", + "forceHighpZ": "Only useful when debugging differences in GPU hardware.\nNot necessary for average users.\nIf unsure, don't use this option.", + "debugOutput": "Enables the selected API's inbuilt debugging functionality.\nWill cause severe performance degradation especially with Vulkan.\nOnly useful for developers.\nIf unsure, don't use this option.", + "debugOverlay": "Provides a graphical overlay of various debugging information.\nIf unsure, don't use this option.", + "logProg": "Dump game shaders to file. Only useful to developers.\nIf unsure, don't use this option." + }, "emulator": { "gui": { "configs": "Only useful to developers.\nIf unsure, don't use this option.", @@ -52,21 +67,10 @@ }, "main": { "dumpColor": "Enable this option if you get missing graphics or broken lighting ingame.\nMight degrade performance and introduce stuttering in some cases.\nRequired for Demon's Souls.", - "readColor": "Never use this.", - "dumpDepth": "Never use this.", - "readDepth": "Never use this.", "vsync": "By having this off you might obtain a higher frame rate at the cost of tearing artifacts in the game.", "autoInvalidateCache": "Enable this option if the game has broken shadows. May slightly degrade performance.", "gpuTextureScaling": "Small to significant performance boost in most games and rarely with side effects.\nMay cause texture corruption in rare cases.\nOnly works with OpenGL for now.", "stretchToDisplayArea": "Overrides the aspect ratio and stretches the image to the full display area." - }, - "debug": { - "glLegacyBuffers": "Enables use of classic OpenGL buffers which allows capturing tools to work with RPCS3 e.g RenderDoc.\nIf unsure, don't use this option.", - "scrictModeRendering": "Enforces strict compliance to the API specification.\nMight result in degraded performance in some games.\nCan resolve rare cases of missing graphics and flickering.\nIf unsure, don't use this option.", - "forceHighpZ": "Only useful when debugging differences in GPU hardware.\nNot necessary for average users.\nIf unsure, don't use this option.", - "debugOutput": "Enables the selected API's inbuilt debugging functionality.\nWill cause severe performance degradation especially with Vulkan.\nOnly useful for developers.\nIf unsure, don't use this option.", - "debugOverlay": "Provides a graphical overlay of various debugging information.\nIf unsure, don't use this option.", - "logProg": "Dump game shaders to file. Only useful to developers.\nIf unsure, don't use this option." } }, "input": { diff --git a/rpcs3/rpcs3qt/emu_settings.h b/rpcs3/rpcs3qt/emu_settings.h index 9c47653a46..8758cfd762 100644 --- a/rpcs3/rpcs3qt/emu_settings.h +++ b/rpcs3/rpcs3qt/emu_settings.h @@ -44,6 +44,8 @@ public: HookStaticFuncs, BindSPUThreads, LowerSPUThreadPrio, + SPULoopDetection, + PreferredSPUThreads, // Graphics Renderer, @@ -138,6 +140,8 @@ private: { HookStaticFuncs, { "Core", "Hook static functions"}}, { BindSPUThreads, { "Core", "Bind SPU threads to secondary cores"}}, { LowerSPUThreadPrio, { "Core", "Lower SPU thread priority"}}, + { SPULoopDetection, { "Core", "SPU loop detection"}}, + { PreferredSPUThreads, { "Core", "Preferred SPU Threads"}}, // Graphics Tab { Renderer, { "Video", "Renderer"}}, diff --git a/rpcs3/rpcs3qt/gui_settings.h b/rpcs3/rpcs3qt/gui_settings.h index b0379c4026..7a7bc1f9f9 100644 --- a/rpcs3/rpcs3qt/gui_settings.h +++ b/rpcs3/rpcs3qt/gui_settings.h @@ -117,7 +117,8 @@ namespace GUI const GUI_SAVE m_currentConfig = GUI_SAVE(meta, "currentConfig", QObject::tr("CurrentSettings")); const GUI_SAVE m_currentStylesheet = GUI_SAVE(meta, "currentStylesheet", QObject::tr("default")); - const GUI_SAVE m_saveNotes = GUI_SAVE(meta, "saveNotes", QVariantMap()); + const GUI_SAVE m_saveNotes = GUI_SAVE(meta, "saveNotes", QVariantMap()); + const GUI_SAVE m_showDebugTab = GUI_SAVE(meta, "showDebugTab", false); const GUI_SAVE gs_resize = GUI_SAVE(gs_frame, "resize", false); const GUI_SAVE gs_width = GUI_SAVE(gs_frame, "width", 1280); diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index d8dd8f20da..40048bf74b 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -23,6 +23,7 @@ #include inline std::string sstr(const QString& _in) { return _in.toUtf8().toStdString(); } +inline std::string sstr(const QVariant& _in) { return sstr(_in.toString()); } settings_dialog::settings_dialog(std::shared_ptr xSettings, const Render_Creator& r_Creator, const int& tabIndex, QWidget *parent, const GameInfo* game) : QDialog(parent), xgui_settings(xSettings), ui(new Ui::settings_dialog) @@ -32,6 +33,13 @@ settings_dialog::settings_dialog(std::shared_ptr xSettings, const ui->tabWidget->setUsesScrollButtons(false); ui->tabWidget->setCurrentIndex(tabIndex); + bool showDebugTab = xgui_settings->GetValue(GUI::m_showDebugTab).toBool(); + xgui_settings->SetValue(GUI::m_showDebugTab, showDebugTab); + if (!showDebugTab) + { + ui->tabWidget->removeTab(7); + } + // read tooltips from json QFile json_file(":/Json/tooltips.json"); json_file.open(QIODevice::ReadOnly | QIODevice::Text); @@ -42,10 +50,11 @@ settings_dialog::settings_dialog(std::shared_ptr xSettings, const QJsonObject json_cpu_ppu = json_cpu.value("PPU").toObject(); QJsonObject json_cpu_spu = json_cpu.value("SPU").toObject(); QJsonObject json_cpu_cbs = json_cpu.value("checkboxes").toObject(); + QJsonObject json_cpu_cbo = json_cpu.value("comboboxes").toObject(); QJsonObject json_cpu_lib = json_cpu.value("libraries").toObject(); QJsonObject json_gpu = json_obj.value("gpu").toObject(); - QJsonObject json_gpu_cbs = json_gpu.value("comboboxes").toObject(); + QJsonObject json_gpu_cbo = json_gpu.value("comboboxes").toObject(); QJsonObject json_gpu_main = json_gpu.value("main").toObject(); QJsonObject json_gpu_deb = json_gpu.value("debug").toObject(); @@ -58,6 +67,8 @@ settings_dialog::settings_dialog(std::shared_ptr xSettings, const QJsonObject json_emu_gui = json_emu.value("gui").toObject(); QJsonObject json_emu_misc = json_emu.value("misc").toObject(); + QJsonObject json_debug = json_obj.value("debug").toObject(); + std::shared_ptr xemu_settings; if (game) { @@ -98,6 +109,7 @@ settings_dialog::settings_dialog(std::shared_ptr xSettings, const // \_____|_| \____/ |_|\__,_|_.__/ // Checkboxes + xemu_settings->EnhanceCheckBox(ui->hookStFunc, emu_settings::HookStaticFuncs); ui->hookStFunc->setToolTip(json_cpu_cbs["hookStFunc"].toString()); @@ -107,6 +119,33 @@ settings_dialog::settings_dialog(std::shared_ptr xSettings, const xemu_settings->EnhanceCheckBox(ui->lowerSPUThrPrio, emu_settings::LowerSPUThreadPrio); ui->lowerSPUThrPrio->setToolTip(json_cpu_cbs["lowerSPUThrPrio"].toString()); + xemu_settings->EnhanceCheckBox(ui->spuLoopDetection, emu_settings::SPULoopDetection); + ui->spuLoopDetection->setToolTip(json_cpu_cbs["spuLoopDetection"].toString()); + + // Comboboxes + + // TODO implement enhancement for combobox / spinbox with proper range + //xemu_settings->EnhanceComboBox(ui->preferredSPUThreads, emu_settings::PreferredSPUThreads); + const QString Auto = tr("Auto"); + ui->preferredSPUThreads->setToolTip(json_cpu_cbo["preferredSPUThreads"].toString()); + for (int i = 0; i <= 6; i++) + { + ui->preferredSPUThreads->addItem( i == 0 ? Auto : QString::number(i), QVariant(i) ); + } + const QString valueOf_PreferredSPUThreads = qstr(xemu_settings->GetSetting(emu_settings::PreferredSPUThreads)); + int index = ui->preferredSPUThreads->findData(valueOf_PreferredSPUThreads == "0" ? Auto : valueOf_PreferredSPUThreads); + if (index == -1) + { + LOG_WARNING(GENERAL, "Current setting not found while creating preferredSPUThreads"); + } + else + { + ui->preferredSPUThreads->setCurrentIndex(index); + } + connect(ui->preferredSPUThreads, static_cast(&QComboBox::currentIndexChanged), [=](int index) { + xemu_settings->SetSetting(emu_settings::PreferredSPUThreads, std::to_string(ui->preferredSPUThreads->itemData(index).toInt())); + }); + // PPU tool tips ui->ppu_precise->setToolTip(json_cpu_ppu["precise"].toString()); ui->ppu_fast->setToolTip(json_cpu_ppu["fast"].toString()); @@ -325,33 +364,24 @@ settings_dialog::settings_dialog(std::shared_ptr xSettings, const // \_____|_| \____/ |_|\__,_|_.__/ // Comboboxes - ui->graphicsAdapterBox->setToolTip(json_gpu_cbs["graphicsAdapterBox"].toString()); + ui->graphicsAdapterBox->setToolTip(json_gpu_cbo["graphicsAdapterBox"].toString()); xemu_settings->EnhanceComboBox(ui->renderBox, emu_settings::Renderer); - ui->renderBox->setToolTip(json_gpu_cbs["renderBox"].toString()); + ui->renderBox->setToolTip(json_gpu_cbo["renderBox"].toString()); xemu_settings->EnhanceComboBox(ui->resBox, emu_settings::Resolution); - ui->resBox->setToolTip(json_gpu_cbs["resBox"].toString()); + ui->resBox->setToolTip(json_gpu_cbo["resBox"].toString()); xemu_settings->EnhanceComboBox(ui->aspectBox, emu_settings::AspectRatio); - ui->aspectBox->setToolTip(json_gpu_cbs["aspectBox"].toString()); + ui->aspectBox->setToolTip(json_gpu_cbo["aspectBox"].toString()); xemu_settings->EnhanceComboBox(ui->frameLimitBox, emu_settings::FrameLimit); - ui->frameLimitBox->setToolTip(json_gpu_cbs["frameLimitBox"].toString()); + ui->frameLimitBox->setToolTip(json_gpu_cbo["frameLimitBox"].toString()); // Checkboxes: main options xemu_settings->EnhanceCheckBox(ui->dumpColor, emu_settings::WriteColorBuffers); ui->dumpColor->setToolTip(json_gpu_main["dumpColor"].toString()); - xemu_settings->EnhanceCheckBox(ui->readColor, emu_settings::ReadColorBuffers); - ui->readColor->setToolTip(json_gpu_main["readColor"].toString()); - - xemu_settings->EnhanceCheckBox(ui->dumpDepth, emu_settings::WriteDepthBuffer); - ui->dumpDepth->setToolTip(json_gpu_main["dumpDepth"].toString()); - - xemu_settings->EnhanceCheckBox(ui->readDepth, emu_settings::ReadDepthBuffer); - ui->readDepth->setToolTip(json_gpu_main["readDepth"].toString()); - xemu_settings->EnhanceCheckBox(ui->vsync, emu_settings::VSync); ui->vsync->setToolTip(json_gpu_main["vsync"].toString()); @@ -364,25 +394,6 @@ settings_dialog::settings_dialog(std::shared_ptr xSettings, const xemu_settings->EnhanceCheckBox(ui->stretchToDisplayArea, emu_settings::StretchToDisplayArea); ui->stretchToDisplayArea->setToolTip(json_gpu_main["stretchToDisplayArea"].toString()); - // Checkboxes: debug options - xemu_settings->EnhanceCheckBox(ui->glLegacyBuffers, emu_settings::LegacyBuffers); - ui->glLegacyBuffers->setToolTip(json_gpu_deb["glLegacyBuffers"].toString()); - - xemu_settings->EnhanceCheckBox(ui->scrictModeRendering, emu_settings::StrictRenderingMode); - ui->scrictModeRendering->setToolTip(json_gpu_deb["scrictModeRendering"].toString()); - - xemu_settings->EnhanceCheckBox(ui->forceHighpZ, emu_settings::ForceHighpZ); - ui->forceHighpZ->setToolTip(json_gpu_deb["forceHighpZ"].toString()); - - xemu_settings->EnhanceCheckBox(ui->debugOutput, emu_settings::DebugOutput); - ui->debugOutput->setToolTip(json_gpu_deb["debugOutput"].toString()); - - xemu_settings->EnhanceCheckBox(ui->debugOverlay, emu_settings::DebugOverlay); - ui->debugOverlay->setToolTip(json_gpu_deb["debugOverlay"].toString()); - - xemu_settings->EnhanceCheckBox(ui->logProg, emu_settings::LogShaderPrograms); - ui->logProg->setToolTip(json_gpu_deb["logProg"].toString()); - // Graphics Adapter QStringList D3D12Adapters = r_Creator.D3D12Adapters; QStringList vulkanAdapters = r_Creator.vulkanAdapters; @@ -788,6 +799,46 @@ settings_dialog::settings_dialog(std::shared_ptr xSettings, const AddStylesheets(); } + // _____ _ _______ _ + // | __ \ | | |__ __| | | + // | | | | ___| |__ _ _ __ _ | | __ _| |__ + // | | | |/ _ \ '_ \| | | |/ _` | | |/ _` | '_ \ + // | |__| | __/ |_) | |_| | (_| | | | (_| | |_) | + // |_____/ \___|_.__/ \__,_|\__, | |_|\__,_|_.__/ + // __/ | + // |___/ + + // Checkboxes: debug options + xemu_settings->EnhanceCheckBox(ui->glLegacyBuffers, emu_settings::LegacyBuffers); + ui->glLegacyBuffers->setToolTip(json_debug["glLegacyBuffers"].toString()); + + xemu_settings->EnhanceCheckBox(ui->scrictModeRendering, emu_settings::StrictRenderingMode); + ui->scrictModeRendering->setToolTip(json_debug["scrictModeRendering"].toString()); + + xemu_settings->EnhanceCheckBox(ui->forceHighpZ, emu_settings::ForceHighpZ); + ui->forceHighpZ->setToolTip(json_debug["forceHighpZ"].toString()); + + xemu_settings->EnhanceCheckBox(ui->debugOutput, emu_settings::DebugOutput); + ui->debugOutput->setToolTip(json_debug["debugOutput"].toString()); + + xemu_settings->EnhanceCheckBox(ui->debugOverlay, emu_settings::DebugOverlay); + ui->debugOverlay->setToolTip(json_debug["debugOverlay"].toString()); + + xemu_settings->EnhanceCheckBox(ui->logProg, emu_settings::LogShaderPrograms); + ui->logProg->setToolTip(json_debug["logProg"].toString()); + + xemu_settings->EnhanceCheckBox(ui->readColor, emu_settings::ReadColorBuffers); + ui->readColor->setToolTip(json_debug["readColor"].toString()); + + xemu_settings->EnhanceCheckBox(ui->dumpDepth, emu_settings::WriteDepthBuffer); + ui->dumpDepth->setToolTip(json_debug["dumpDepth"].toString()); + + xemu_settings->EnhanceCheckBox(ui->readDepth, emu_settings::ReadDepthBuffer); + ui->readDepth->setToolTip(json_debug["readDepth"].toString()); + + // + // Layout fix for High Dpi + // layout()->setSizeConstraint(QLayout::SetFixedSize); } diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index fe0cfd465a..4c2a39cbc9 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -7,7 +7,7 @@ 0 0 550 - 604 + 646 @@ -117,19 +117,24 @@ + + + + Preferred SPU Threads + + + + + + + + Additional Settings - - - - Hook Static Functions - - - @@ -144,6 +149,20 @@ + + + + Enable SPU loop detection + + + + + + + Hook static functions + + + @@ -167,7 +186,7 @@ - + 0 0 @@ -436,27 +455,6 @@ - - - - Write Depth Buffers - - - - - - - Read Color Buffers - - - - - - - Read Depth Buffers - - - @@ -474,7 +472,7 @@ - Use Vertical Sync + VSync @@ -488,65 +486,8 @@ - - - - true - - - Debugging Settings - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - false - - - Use Legacy OpenGL Buffers - - - - - - - Debug Output - - - - - - - Debug Overlay - - - - - - - Strict Rendering Mode - - - - - - - Log Shader Programs - - - - - - - Use High Precision Z-buffer - - - - - + + @@ -1323,6 +1264,142 @@ + + + Debug + + + + + + + + true + + + GPU + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + false + + + Use Legacy OpenGL Buffers + + + + + + + Debug Output + + + + + + + Debug Overlay + + + + + + + Strict Rendering Mode + + + + + + + Log Shader Programs + + + + + + + Use High Precision Z-buffer + + + + + + + Write Depth Buffers + + + + + + + Read Depth Buffers + + + + + + + Read Color Buffers + + + + + + + + + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + Description + + + + + + These options are only needed for development. + + + + + + Qt::PlainText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + + + + + +