maintenance5 deprecates VkShaderModule so you no longer need to create it. For backwards compatibility I want to support both methods. How much of a speed difference does it make to use a shader module vs passing the shader code directly to the pipeline? Are there any platforms around where creating VkShaderModule has a significant overhead? Is it viable to create a just-in-time shader module each time a pipeline is created (and not keep/reuse the modules, ever)?
#Is creating VkShaderModule expensive?
6 messages · Page 1 of 1 (latest)
As far as I know, shader modules just copy the bytecode into driver-owned memory.
Hitting disk or compiling to Spir-v bytecode every time you build a pipeline might be a problem, but keeping compiled bytecode in memory vs having the driver do it via a VkShaderModule probabally doesn't matter.
In fact, with VK_KHR_maintenance5 available, you do just this (making shader modules the old way is deprecated with maintenance 5 even). - passing the SPIR-V directly in on pipeline creation.