If a render pass is not needed and it is not used anymore by commands submitted to the hardware, we can destroy it.
Destroying a render pass
How to do it...
- Use the handle of a logical device, on which the render pass was created, to initialize a variable of type VkDevice named logical_device.
- Store the handle of the render pass that should be destroyed in a variable of type VkRenderPass named render_pass.
- Call vkDestroyRenderPass( logical_device, render_pass, nullptr ) and provide the logical_device and render_pass variables and a nullptr value.
- For safety reasons, assign a VK_NULL_HANDLE value to the render_pass variable.