#Is creating VkShaderModule expensive?

6 messages · Page 1 of 1 (latest)

sturdy vine
#

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)?

runic island
#

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.

somber acorn
sturdy vine
#

Thanks for confirming!

#

Strange that there's all these VUIDs when creating a shader module, saying that the code has to be valid and all that, when it's not really doing anything with the code until you make a pipeline