It may be a common scenario that we will have to create multiple pipelines in our application. To shorten the time needed to create them all, it may be a good idea to split the creation into multiple threads executed simultaneously. Each such thread should use a separate pipeline cache. After all the threads are finished, we would like to reuse the cache next time our application is executed. For this purpose, it is best to merge multiple cache objects into one.
Merging multiple pipeline cache objects
How to do it...
- Store the handle of a logical device in a variable of type VkDevice named logical_device.
- Take the cache object into which other caches will be merged. Using its handle, initialize a variable of type VkPipelineCache named target_pipeline_cache.
- Create...