Files
metal2vulkan/crates
Anees Iqbal 6ec733421c Runtime: a kernel past the stage bound holds no VkShaderModule; each make of its pipelines makes its own and destroys it
A heavy kernel (past the stage bound, made only from its helper's cache data) kept the shader
module its words made for the content's whole life, though only its VkPipelines' creates name it.
A driver keeps a copy of the module's code for that life: on an RTX 3090 (NVIDIA 620.70.06,
job m3-max-67862) destroying the module of kernel 16d856fc (7,966,928 bytes of words), its
pipeline kept, gave back 7.6 MiB of heap, per heavy content, while the app runs.

The kernel now holds one of two things (`Code`): a light kernel's shader module, made with it as
before, or a heavy kernel's `Heavy`, its words. `stage::made` makes a shader module of those words
only once the pipeline's entry holds data, creates the pipeline through the entry's cache and that
module, and destroys both once the create returns (Vulkan: "A shader module can be destroyed while
pipelines created using its shaders are still in use"). A make refused unfilled makes no module.
Two makes of one kernel's variants at once each make their own, since make_pending lets go of the
variants' lock before it creates; a module-less create needs maintenance5 or
graphicsPipelineLibrary, neither on the floor. `release` frees a module only for a light kernel.
The words stay held (dropping them is a later step), and nothing else changes: the same stage
keys, entries, requests and wire.

Docs: the runtime README's "Kernels past the stage bound" make bullet and the map paragraph's
"its shader modules", and the module docs of stage.rs and pipeline.rs.
2026-11-22 08:03:36 -08:00
..