Shader modules are used only for creating pipeline objects. After they are created, we can immediately destroy them, if we don't intend to use them anymore.
Destroying a shader module
How to do it...
- Use the handle of a logical device to initialize a variable of type VkDevice named logical_device.
- Take the shader module's handle stored in a variable of type VkShaderModule named shader_module.
- Call vkDestroyShaderModule( logical_device, shader_module, nullptr ) providing the logical_device variable, the shader_module variable, and a nullptr value.
- Assign a VK_NULL_HANDLE value to the shader_module variable for safety reasons.