Module: Mesa
Branch: main
Commit: af740f2c3571b30c83776cb1dfba3add9afb6f81
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=af740f2c3571b30c83776cb1dfba3add9afb6f81

Author: Samuel Pitoiset <[email protected]>
Date:   Mon Sep 20 17:09:41 2021 +0200

radv: do not store meta shaders to the default shader disk cache

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 <[email protected]>
Reviewed-by: Bas Nieuwenhhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12937>

---

 src/amd/vulkan/radv_pipeline_cache.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_pipeline_cache.c 
b/src/amd/vulkan/radv_pipeline_cache.c
index b386ab89b41..84c591a49cb 100644
--- a/src/amd/vulkan/radv_pipeline_cache.c
+++ b/src/amd/vulkan/radv_pipeline_cache.c
@@ -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);
 

Reply via email to