diff options
| author | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-11-01 03:42:01 -0500 |
|---|---|---|
| committer | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-11-01 08:41:13 -0500 |
| commit | 70b39fe1d247ba62aa9382c09a457fb57aa9d7fb (patch) | |
| tree | 1d539f3c597fefb553ea756750b65f56f631fdc7 /src/video_core | |
| parent | adae7635708e155d967e84d7ad84bf63c5203409 (diff) | |
vk_pipeline_cache: leave the pipeline cache to NVIDIA's and AMD's drivers
Their drivers keep a disk cache of built pipelines of their own. Eden's
VkPipelineCache on top loaded every pipeline the title ever built into
host memory (title 1: a 245 MB file) and copied it whole at each save.
Without it, title 1's title screen over ten minutes: private memory
-373 MiB, frames over 100 ms 30 -> 21, worst frame 141 -> 94 ms, and
pipelines built as fast (2.26 vs 2.46 ms each on the GPU thread).
(cherry picked from commit ea3dcd444cad7de301ec949a350cc45abb48d3bf)
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 2c64f3375b..63ef038069 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -341,6 +341,22 @@ bool GraphicsPipelineCacheKey::operator==(const GraphicsPipelineCacheKey& rhs) c return std::memcmp(&rhs, this, Size()) == 0; } +namespace { +// NVIDIA's and AMD's drivers keep a disk cache of built pipelines of their own. Eden's copy on top +// only kept every pipeline the title ever built in host memory (title 1: a 245 MB file, ~0.35 GB +// of RAM for the session) and copied it whole at each save, which stalled frames; pipelines built +// no slower without it. +bool DriverCachesPipelines(const Device& device) { + switch (device.GetDriverID()) { + case VK_DRIVER_ID_NVIDIA_PROPRIETARY: + case VK_DRIVER_ID_AMD_PROPRIETARY: + return true; + default: + return false; + } +} +} // Anonymous namespace + PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_, @@ -354,7 +370,8 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, render_pass_cache{render_pass_cache_}, buffer_cache{buffer_cache_}, texture_cache{texture_cache_}, shader_notify{shader_notify_}, use_asynchronous_shaders{Settings::values.use_asynchronous_shaders.GetValue()}, - use_vulkan_pipeline_cache{Settings::values.use_vulkan_driver_pipeline_cache.GetValue()}, + use_vulkan_pipeline_cache{Settings::values.use_vulkan_driver_pipeline_cache.GetValue() && + !DriverCachesPipelines(device_)}, workers(device.HasBrokenParallelShaderCompiling() ? 1ULL : GetTotalPipelineWorkers(), "VkPipelineBuilder", {}, Common::ThreadPlacement::Background), serialization_thread(1, "VkPipelineSerialization", {}, |
