From 14358d5e84b91ae027b9feb36735e50c88c02f68 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Fri, 13 Nov 2020 20:03:10 +0300 Subject: [PATCH] qt: Add shader compiler threads to GUI --- rpcs3/rpcs3qt/emu_settings_type.h | 2 ++ rpcs3/rpcs3qt/settings_dialog.cpp | 5 +++++ rpcs3/rpcs3qt/settings_dialog.ui | 17 ++++++++++++++++- rpcs3/rpcs3qt/tooltips.h | 3 ++- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/rpcs3/rpcs3qt/emu_settings_type.h b/rpcs3/rpcs3qt/emu_settings_type.h index 34efa8a428..325e9e9415 100644 --- a/rpcs3/rpcs3qt/emu_settings_type.h +++ b/rpcs3/rpcs3qt/emu_settings_type.h @@ -71,6 +71,7 @@ enum class emu_settings_type DisableOnDiskShaderCache, DisableVulkanMemAllocator, ShaderMode, + ShaderCompilerNumThreads, MultithreadedRSX, VBlankRate, RelaxedZCULL, @@ -211,6 +212,7 @@ static const QMap settings_location = { emu_settings_type::DisableOnDiskShaderCache, { "Video", "Disable On-Disk Shader Cache"}}, { emu_settings_type::DisableVulkanMemAllocator, { "Video", "Disable Vulkan Memory Allocator"}}, { emu_settings_type::ShaderMode, { "Video", "Shader Mode"}}, + { emu_settings_type::ShaderCompilerNumThreads, { "Video", "Shader Compiler Threads"}}, { emu_settings_type::MultithreadedRSX, { "Video", "Multithreaded RSX"}}, { emu_settings_type::RelaxedZCULL, { "Video", "Relaxed ZCULL Sync"}}, { emu_settings_type::AnisotropicFilterOverride, { "Video", "Anisotropic Filter Override"}}, diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index 1121ddbcfd..a50c91500e 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -392,6 +392,11 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std } } + // Comboboxes + m_emu_settings->EnhanceComboBox(ui->shaderCompilerThreads, emu_settings_type::ShaderCompilerNumThreads, true); + SubscribeTooltip(ui->gb_shader_compiler_threads, tooltips.settings.shader_compiler_threads); + ui->shaderCompilerThreads->setItemText(ui->shaderCompilerThreads->findData(0), tr("Auto", "Number of Shader Compiler Threads")); + // Checkboxes: main options m_emu_settings->EnhanceCheckBox(ui->dumpColor, emu_settings_type::WriteColorBuffers); SubscribeTooltip(ui->dumpColor, tooltips.settings.dump_color); diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index a573e60c57..7f9d6ae008 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -10,7 +10,7 @@ 0 0 753 - 620 + 650 @@ -38,6 +38,9 @@ 0 + + 1 + CPU @@ -682,6 +685,18 @@ + + + + Number of Shader Compiler Threads + + + + + + + + diff --git a/rpcs3/rpcs3qt/tooltips.h b/rpcs3/rpcs3qt/tooltips.h index 692c24c7af..54baa10c60 100644 --- a/rpcs3/rpcs3qt/tooltips.h +++ b/rpcs3/rpcs3qt/tooltips.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include #include @@ -155,6 +155,7 @@ public: const QString async_shader_recompiler = tr("This is the recommended option.\nIf a shader is not found in the cache, nothing will be rendered for this shader until it has compiled.\nYou may experience graphics pop-in."); const QString async_with_shader_interpreter = tr("Hybrid rendering mode.\nIf a shader is not found in the cache, the interpreter will be used to render approximated graphics for this shader until it has compiled."); const QString shader_interpreter_only = tr("All rendering is handled by the interpreter with no attempt to compile native shaders.\nThis mode is very slow and experimental."); + const QString shader_compiler_threads = tr("Number of threads to use for the shader compiler backend.\nOnly has an impact when shader mode is set to one of the asynchronous modes."); // gui