From 40aaab482ee1d6456f5b94642d2871a670b3dd27 Mon Sep 17 00:00:00 2001 From: nmzik Date: Sun, 25 Oct 2026 00:25:34 +0200 Subject: [PATCH] launcher: add a Cache shaders option, on by default --- src/launcher/forms/configuration_edit_dialog.ui | 6 ++++++ src/launcher/include/configuration.h | 2 ++ src/launcher/src/configuration.cpp | 4 +++- src/launcher/src/configurationEditDialog.cpp | 2 ++ src/launcher/src/mainDialog.cpp | 1 + 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/launcher/forms/configuration_edit_dialog.ui b/src/launcher/forms/configuration_edit_dialog.ui index 5f9f5c9f0..d0e5c8422 100644 --- a/src/launcher/forms/configuration_edit_dialog.ui +++ b/src/launcher/forms/configuration_edit_dialog.ui @@ -191,6 +191,12 @@ Enable HDR display support + + + Save compiled shaders and pipelines per game and load them at startup. + Cache shaders + + diff --git a/src/launcher/include/configuration.h b/src/launcher/include/configuration.h index afa364909..74329e16f 100644 --- a/src/launcher/include/configuration.h +++ b/src/launcher/include/configuration.h @@ -131,6 +131,7 @@ public: bool sync_raw_image_buffers = false; bool tessellation_enabled = false; bool occlusion_queries_enabled = false; + bool shader_cache_enabled = true; bool trophy_enabled = true; int trophy_duration_seconds = 6; bool perf_overlay_enabled = false; @@ -172,6 +173,7 @@ public: sync_raw_image_buffers = other.sync_raw_image_buffers; tessellation_enabled = other.tessellation_enabled; occlusion_queries_enabled = other.occlusion_queries_enabled; + shader_cache_enabled = other.shader_cache_enabled; trophy_enabled = other.trophy_enabled; trophy_duration_seconds = other.trophy_duration_seconds; perf_overlay_enabled = other.perf_overlay_enabled; diff --git a/src/launcher/src/configuration.cpp b/src/launcher/src/configuration.cpp index de01d6c5e..0b3b7aa85 100644 --- a/src/launcher/src/configuration.cpp +++ b/src/launcher/src/configuration.cpp @@ -17,6 +17,7 @@ QVariantMap Configuration::GameSettings() const { KYTY_CFG_SET(sync_raw_image_buffers); KYTY_CFG_SET(tessellation_enabled); KYTY_CFG_SET(occlusion_queries_enabled); + KYTY_CFG_SET(shader_cache_enabled); KYTY_CFG_SET(trophy_enabled); KYTY_CFG_SET(trophy_duration_seconds); KYTY_CFG_SET(perf_overlay_enabled); @@ -68,7 +69,8 @@ void Configuration::ReadGameSettingsValues(const Settings& s) { KYTY_CFG_GET(sync_raw_image_buffers); KYTY_CFG_GET(tessellation_enabled); KYTY_CFG_GET(occlusion_queries_enabled); - trophy_enabled = s.value("trophy_enabled", trophy_enabled).toBool(); + shader_cache_enabled = s.value("shader_cache_enabled", shader_cache_enabled).toBool(); + trophy_enabled = s.value("trophy_enabled", trophy_enabled).toBool(); KYTY_CFG_GET(trophy_duration_seconds); KYTY_CFG_GET(perf_overlay_enabled); KYTY_CFG_GET(skip_notice_screen); diff --git a/src/launcher/src/configurationEditDialog.cpp b/src/launcher/src/configurationEditDialog.cpp index 70ae716ce..9e5a2fedd 100644 --- a/src/launcher/src/configurationEditDialog.cpp +++ b/src/launcher/src/configurationEditDialog.cpp @@ -290,6 +290,7 @@ void ConfigurationEditDialog::Init(const Configuration& info) { m_ui->checkBox_sync_raw_image_buffers->setChecked(info.sync_raw_image_buffers); m_ui->checkBox_tessellation->setChecked(info.tessellation_enabled); m_ui->checkBox_occlusion_queries->setChecked(info.occlusion_queries_enabled); + m_ui->checkBox_shader_cache->setChecked(info.shader_cache_enabled); m_ui->checkBox_skip_notice_screen->setChecked(info.skip_notice_screen); m_ui->checkBox_network_connected->setChecked(info.network_connected); m_ui->checkBox_trophy_notifications->setChecked(info.trophy_enabled); @@ -485,6 +486,7 @@ static void UpdateInfo(Configuration& info, Ui::ConfigurationEditDialog& ui, boo info.sync_raw_image_buffers = ui.checkBox_sync_raw_image_buffers->isChecked(); info.tessellation_enabled = ui.checkBox_tessellation->isChecked(); info.occlusion_queries_enabled = ui.checkBox_occlusion_queries->isChecked(); + info.shader_cache_enabled = ui.checkBox_shader_cache->isChecked(); info.skip_notice_screen = ui.checkBox_skip_notice_screen->isChecked(); info.network_connected = ui.checkBox_network_connected->isChecked(); info.trophy_enabled = ui.checkBox_trophy_notifications->isChecked(); diff --git a/src/launcher/src/mainDialog.cpp b/src/launcher/src/mainDialog.cpp index 3a2b42a07..cd6e100a8 100644 --- a/src/launcher/src/mainDialog.cpp +++ b/src/launcher/src/mainDialog.cpp @@ -276,6 +276,7 @@ static QStringList CreateEmulatorArgs(const Configuration& info) { AddFlag(args, info.network_connected, "--network-connected"); AddFlag(args, info.tessellation_enabled, "--tessellation"); AddFlag(args, info.occlusion_queries_enabled, "--occlusion-queries"); + AddFlag(args, info.shader_cache_enabled, "--shader-cache"); args << "--vblank-frequency" << QString::number(info.vblank_frequency); args << "--console-language" << QString::number(info.console_language); AddFlag(args, info.vulkan_validation_enabled, "--vulkan-validation");