Skip to content

vulkan: Add a common VkPipelineCache implementation

This MR adds a common implementation of VkPipelineCache that everyone can use. It's roughly based on the ANV cache but with a few tweaks to make it so it can cache just about anything. That said, the code is freshly typed so please look carefully for bugs!

The new cache caches "object" which derive from a base vk_pipeline_class_object struct. It uses a kernel-style "ops" interface for virtual methods on these objects to allow for easy destruction (when the reference count hits zero) as well as serialization an deserialization interfaces. This should allow drivers to cache basically whatever they want without having to think too hard about the details.

I'm hoping that this is flexible for everyone. However, it didn't take too much looking at RADV and v3dv to realize that we've all gone very different directions with out cache designs. Maybe this isn't quite as obviously a code sharing opportunity as I thought? I'd very much like feedback!

This is based on !13156 (merged). Feel free to ignore the first 8 patches. I just need those so I can depend on NIR.

Edited by Faith Ekstrand

Merge request reports