When we don't need a pipeline layout anymore, and we don't intend to create more pipelines with it, bind descriptor sets or update push constants that used the given layout, and all operations using the pipeline layout are already finished, we can destroy the layout.
Destroying a pipeline layout
How to do it...
- Take the handle of a logical device. Use it to initialize a variable of type VkDevice named logical_device.
- Take the handle of a pipeline layout stored in a variable of type VkPipelineLayout named pipeline_layout.
- Call vkDestroyPipelineLayout( logical_device, pipeline_layout, nullptr ). For the call, provide the logical_device and pipeline_layout variables and a nullptr value.
- For safety reasons, assign a VK_NULL_HANDLE to the pipeline_layout variable...