radv: do not store meta shaders to the default shader disk cache
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 20 Sep 2021 15:09:41 +0000 (17:09 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 21 Sep 2021 12:21:41 +0000 (12:21 +0000)
Meta shaders are already stored in a different shader cache file.
Storing them in two places wastes disk space and they are never
loaded from the default shader disk cache anyways.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12937>

src/amd/vulkan/radv_pipeline_cache.c

index b386ab8..84c591a 100644 (file)
@@ -455,8 +455,10 @@ radv_pipeline_cache_insert_shaders(struct radv_device *device, struct radv_pipel
    /* Always add cache items to disk. This will allow collection of
     * compiled shaders by third parties such as steam, even if the app
     * implements its own pipeline cache.
+    *
+    * Make sure to exclude meta shaders because they are stored in a different cache file.
     */
-   if (device->physical_device->disk_cache) {
+   if (device->physical_device->disk_cache && cache != &device->meta_state.cache) {
       uint8_t disk_sha1[20];
       disk_cache_compute_key(device->physical_device->disk_cache, sha1, 20, disk_sha1);