What's the common way to create and use pipelineCache?

what’s the common way to create and use pipelineCache? is there any demo or tutorial?
save the pipelineCache when the first time running or pre-create the pipelineCache? then release the pipelineCache with the .spv in the app, firstly search the pipelineCache file and try to use it?if fail then use the .spv and compile shaders?
Thanks!

There is the Vulkan Samples example.

Contents of the pipeline cache are implementation defined, but AFAIK the expectation is that it stores more or less the final binaries that will execute on the hardware - that means the contents are hardware (and typically driver version) dependent. In order to pre-create the cache you’d have to do it on all kinds of combinations of hardware and driver you expect your users to have - or perhaps setup infrastructure to collect the cache from your users and distribute to others, somewhat similar in spirit to the Steam shader cache.

1 Like

so ppl normally run App to search for cache firstly, if found use it;
if not compile and create it and save it when exit App?