From 16809c1fa7e2b4fb798749030645deaec79a2381 Mon Sep 17 00:00:00 2001 From: Wollnashorn Date: Fri, 30 Dec 2022 14:50:07 +0100 Subject: video_core/vulkan: Added `VkPipelineCache` to store Vulkan pipelines As an optional feature which can be enabled in the advanced graphics configuration, all pipelines that get built at the initial shader loading are stored in a VkPipelineCache object and are dumped to the disk. These vendor specific pipeline cache files are located at `/shader/GAME_ID/vulkan_pipelines.bin`. This feature was mainly added because of an issue with the AMD driver (see yuzu-emu#8507) causing invalidation of the cache files the driver builds automatically. --- src/common/settings.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/common') diff --git a/src/common/settings.h b/src/common/settings.h index 5017951c5..0d58d6171 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -451,6 +451,8 @@ struct Values { SwitchableSetting use_asynchronous_shaders{false, "use_asynchronous_shaders"}; SwitchableSetting use_fast_gpu_time{true, "use_fast_gpu_time"}; SwitchableSetting use_pessimistic_flushes{false, "use_pessimistic_flushes"}; + SwitchableSetting use_vulkan_driver_pipeline_cache{false, + "use_vulkan_driver_pipeline_cache"}; SwitchableSetting bg_red{0, "bg_red"}; SwitchableSetting bg_green{0, "bg_green"}; -- cgit v1.2.3 From f4626512ff67f6a27235b831111330b42313c312 Mon Sep 17 00:00:00 2001 From: Wollnashorn Date: Sat, 31 Dec 2022 02:49:08 +0100 Subject: config: Better wording for VK pipeline cache option and enable by default --- src/common/settings.h | 2 +- src/yuzu/configuration/configure_graphics_advanced.ui | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/common') diff --git a/src/common/settings.h b/src/common/settings.h index 0d58d6171..d9e82087d 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -451,7 +451,7 @@ struct Values { SwitchableSetting use_asynchronous_shaders{false, "use_asynchronous_shaders"}; SwitchableSetting use_fast_gpu_time{true, "use_fast_gpu_time"}; SwitchableSetting use_pessimistic_flushes{false, "use_pessimistic_flushes"}; - SwitchableSetting use_vulkan_driver_pipeline_cache{false, + SwitchableSetting use_vulkan_driver_pipeline_cache{true, "use_vulkan_driver_pipeline_cache"}; SwitchableSetting bg_red{0, "bg_red"}; diff --git a/src/yuzu/configuration/configure_graphics_advanced.ui b/src/yuzu/configuration/configure_graphics_advanced.ui index 67878b057..ccbdcf08f 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.ui +++ b/src/yuzu/configuration/configure_graphics_advanced.ui @@ -112,10 +112,10 @@ - Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files automatically. + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - Use Vulkan pipeline cache (Hack) + Use Vulkan pipeline cache -- cgit v1.2.3 From 8945fafcc0ee6c28dcd956e1ffe82df72b0d9d4c Mon Sep 17 00:00:00 2001 From: Wollnashorn Date: Mon, 2 Jan 2023 02:51:07 +0100 Subject: config: Set the Vulkan driver pipeline cache option to be global --- src/common/settings.cpp | 1 + src/yuzu/configuration/configure_graphics_advanced.cpp | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src/common') diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 149e621f9..2eaded242 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -200,6 +200,7 @@ void RestoreGlobalState(bool is_powered_on) { values.use_asynchronous_shaders.SetGlobal(true); values.use_fast_gpu_time.SetGlobal(true); values.use_pessimistic_flushes.SetGlobal(true); + values.use_vulkan_driver_pipeline_cache.SetGlobal(true); values.bg_red.SetGlobal(true); values.bg_green.SetGlobal(true); values.bg_blue.SetGlobal(true); diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp index b3862e707..a3fbe2ad0 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.cpp +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp @@ -104,6 +104,9 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() { ConfigurationShared::SetColoredTristate(ui->use_pessimistic_flushes, Settings::values.use_pessimistic_flushes, use_pessimistic_flushes); + ConfigurationShared::SetColoredTristate(ui->use_vulkan_driver_pipeline_cache, + Settings::values.use_vulkan_driver_pipeline_cache, + use_vulkan_driver_pipeline_cache); ConfigurationShared::SetColoredComboBox( ui->gpu_accuracy, ui->label_gpu_accuracy, static_cast(Settings::values.gpu_accuracy.GetValue(true))); -- cgit v1.2.3