Settings Overhaul

This commit is contained in:
Megamouse 2017-07-24 02:21:40 +02:00 committed by Ivan
parent 3b03f9a010
commit a7802e9377
5 changed files with 274 additions and 137 deletions

View file

@ -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": {

View file

@ -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"}},

View file

@ -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);

View file

@ -23,6 +23,7 @@
#include <unordered_set>
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<gui_settings> 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<gui_settings> 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<gui_settings> 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<gui_settings> 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<emu_settings> xemu_settings;
if (game)
{
@ -98,6 +109,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> 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<gui_settings> 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<void(QComboBox::*)(int)>(&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<gui_settings> 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<gui_settings> 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<gui_settings> 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);
}

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>550</width>
<height>604</height>
<height>646</height>
</rect>
</property>
<property name="sizePolicy">
@ -117,19 +117,24 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_6">
<property name="title">
<string>Preferred SPU Threads</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_51">
<item>
<widget class="QComboBox" name="preferredSPUThreads"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="checkboxes">
<property name="title">
<string>Additional Settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QCheckBox" name="hookStFunc">
<property name="text">
<string>Hook Static Functions</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="bindSPUThreads">
<property name="text">
@ -144,6 +149,20 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="spuLoopDetection">
<property name="text">
<string>Enable SPU loop detection</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hookStFunc">
<property name="text">
<string>Hook static functions</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
@ -167,7 +186,7 @@
<item>
<widget class="QGroupBox" name="lib_settings">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -436,27 +455,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="dumpDepth">
<property name="text">
<string>Write Depth Buffers</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="readColor">
<property name="text">
<string>Read Color Buffers</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="readDepth">
<property name="text">
<string>Read Depth Buffers</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="autoInvalidateCache">
<property name="text">
@ -474,7 +472,7 @@
<item>
<widget class="QCheckBox" name="vsync">
<property name="text">
<string>Use Vertical Sync</string>
<string>VSync</string>
</property>
</widget>
</item>
@ -488,65 +486,8 @@
</layout>
</widget>
</item>
<item alignment="Qt::AlignTop">
<widget class="QGroupBox" name="groupBox_48">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title">
<string>Debugging Settings</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<layout class="QVBoxLayout" name="verticalLayout_17">
<item alignment="Qt::AlignTop">
<widget class="QCheckBox" name="glLegacyBuffers">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Use Legacy OpenGL Buffers</string>
</property>
</widget>
</item>
<item alignment="Qt::AlignTop">
<widget class="QCheckBox" name="debugOutput">
<property name="text">
<string>Debug Output</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="debugOverlay">
<property name="text">
<string>Debug Overlay</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="scrictModeRendering">
<property name="text">
<string>Strict Rendering Mode</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="logProg">
<property name="text">
<string>Log Shader Programs</string>
</property>
</widget>
</item>
<item alignment="Qt::AlignTop">
<widget class="QCheckBox" name="forceHighpZ">
<property name="text">
<string>Use High Precision Z-buffer</string>
</property>
</widget>
</item>
</layout>
</widget>
<item>
<widget class="QWidget" name="widget_8" native="true"/>
</item>
</layout>
</item>
@ -1323,6 +1264,142 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="debugTab">
<attribute name="title">
<string>Debug</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_53">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_21">
<item>
<widget class="QGroupBox" name="groupBox_48">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title">
<string>GPU</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<layout class="QVBoxLayout" name="verticalLayout_17">
<item alignment="Qt::AlignTop">
<widget class="QCheckBox" name="glLegacyBuffers">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Use Legacy OpenGL Buffers</string>
</property>
</widget>
</item>
<item alignment="Qt::AlignTop">
<widget class="QCheckBox" name="debugOutput">
<property name="text">
<string>Debug Output</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="debugOverlay">
<property name="text">
<string>Debug Overlay</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="scrictModeRendering">
<property name="text">
<string>Strict Rendering Mode</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="logProg">
<property name="text">
<string>Log Shader Programs</string>
</property>
</widget>
</item>
<item alignment="Qt::AlignTop">
<widget class="QCheckBox" name="forceHighpZ">
<property name="text">
<string>Use High Precision Z-buffer</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="dumpDepth">
<property name="text">
<string>Write Depth Buffers</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="readDepth">
<property name="text">
<string>Read Depth Buffers</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="readColor">
<property name="text">
<string>Read Color Buffers</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_7" native="true"/>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_10">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QGroupBox" name="groupBox_63">
<property name="title">
<string>Description</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_52">
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>These options are only needed for development.
</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>