Destroying a pipeline cache
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.
How to do it...
- Store the handle of a logical device in a variable of type
VkDevice
namedlogical_device
. - Take the handle of a pipeline cache object that should be destroyed. Use the handle to initialize a variable of type
VkPipelineCache
namedpipeline_cache
. - Call
vkDestroyPipelineCache( logical_device, pipeline_cache, nullptr )
and provide thelogical_device
andpipeline_cache
variables, and anullptr
value. - For safety reasons, store the
VK_NULL_HANDLE
value in thepipeline_cache
variable.
How it works...
Pipeline cache objects can be used only during the creation of pipelines, for retrieving data from it, and for merging multiple caches into one. None of these operations are recorded in the command buffers, so as soon as any function performing one the mentioned...