aboutsummaryrefslogtreecommitdiff
path: root/src/video_core
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-11-01 13:26:28 -0500
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-11-01 13:26:28 -0500
commite3a55dbae3be3a550d94e11fcf973e13996e7086 (patch)
tree9e471fec3e2c0bbd54eada508a031322946583a7 /src/video_core
parentacc79592f1aa7954102f7f341dee147e4aea49aa (diff)
parent8551ee6462b6139a425d8a42e6310e67d88e1bd6 (diff)
Merge remote-tracking branch 'origin/fix/vk-free-shader-modules' into test/linux-all-prs
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_vulkan/vk_compute_pipeline.cpp3
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp8
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) {