A pipeline cache is not used in any commands recorded in a command buffer. That's why, when we have created all the pipelines we wanted, merged cache data, or retrieved its contents, we can destroy the cache.
Destroying a pipeline cache
How to do it...
- Store the handle of a logical device in a variable of type VkDevice named logical_device.
- Take the handle of a pipeline cache object that should be destroyed. Use the handle to initialize a variable of type VkPipelineCache named pipeline_cache.
- Call vkDestroyPipelineCache( logical_device, pipeline_cache, nullptr ) and provide the logical_device and pipeline_cache variables, and a nullptr value.
- For safety reasons, store the VK_NULL_HANDLE value in the pipeline_cache variable.