diff options
| author | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-11-01 13:26:28 -0500 |
|---|---|---|
| committer | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-11-01 13:26:28 -0500 |
| commit | e3a55dbae3be3a550d94e11fcf973e13996e7086 (patch) | |
| tree | 9e471fec3e2c0bbd54eada508a031322946583a7 /src | |
| parent | acc79592f1aa7954102f7f341dee147e4aea49aa (diff) | |
| parent | 8551ee6462b6139a425d8a42e6310e67d88e1bd6 (diff) | |
Merge remote-tracking branch 'origin/fix/vk-free-shader-modules' into test/linux-all-prs
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_compute_pipeline.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp index ee3d94899e..1cfe391ba6 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp @@ -135,6 +135,9 @@ ComputePipeline::ComputePipeline(const Device& device_, Scheduler& scheduler, vk if (pipeline_statistics) { pipeline_statistics->Collect(device, *pipeline); } + // Nothing reads the module once the pipeline exists; the driver keeps its SPIR-V while it + // lives. + spv_module.reset(); std::scoped_lock lock{build_mutex}; is_built = true; build_condvar.notify_one(); diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index a8dc4b39fc..fa273f6ef9 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -342,6 +342,11 @@ GraphicsPipeline::GraphicsPipeline( if (pipeline_statistics) { pipeline_statistics->Collect(device, *pipeline); } + // Nothing reads the shader modules once the pipeline exists, and the driver keeps a copy + // of each one's SPIR-V while it lives (title 1: ~1,500 pipelines, 2-5 modules each). + for (vk::ShaderModule& module : spv_modules) { + module.reset(); + } std::scoped_lock lock{build_mutex}; is_built = true; @@ -350,12 +355,13 @@ GraphicsPipeline::GraphicsPipeline( shader_notify->MarkShaderComplete(); } }}; + // Before the build: it frees the modules this looks at. + configure_func = ConfigureFunc(spv_modules, stage_infos); if (worker_thread) { worker_thread->QueueWork(std::move(func)); } else { func(); } - configure_func = ConfigureFunc(spv_modules, stage_infos); } void GraphicsPipeline::AddTransition(GraphicsPipeline* transition) { |
