radv: use vk_pipeline_cache
authorDaniel Schürmann <daniel@schuermann.dev>
Sun, 19 Mar 2023 09:26:05 +0000 (10:26 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 11 Apr 2023 11:38:15 +0000 (11:38 +0000)
commitc2b9279227e2e2f93964391fd3bc68a451c982e2
tree9e990f871822fc78ab914c6bc6a7e185a52d06ea
parent9b3679aff2adfb4097c4eacd853905bc049c8544
radv: use vk_pipeline_cache

Replaces the RADV pipeline cache with an implementation
based on the common vk_pipeline_cache.

We use a dual-layer approach with two types of cache entries.

  1. radv_shader:
    - serialized as radv_shader_binary
    - uses SHA1 of the binary as key
  2. radv_pipeline_cache_object:
    - contains pointers to associated radv_shaders
    - serialized as list of SHA1
    - uses the pipeline hash as key

In combination with single-file disk-cache, this reduces the cache size by ~60%.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
src/amd/vulkan/meta/radv_meta.c
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_pipeline_cache.c
src/amd/vulkan/radv_pipeline_rt.c
src/amd/vulkan/radv_private.h
src/amd/vulkan/radv_shader.c
src/amd/vulkan/radv_shader.h