radv/rt: don't write cache hit feedback per stage.
authorDaniel Schürmann <daniel@schuermann.dev>
Tue, 9 May 2023 00:13:30 +0000 (02:13 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 8 Jun 2023 00:37:03 +0000 (00:37 +0000)
Too much boilerplate for no benefit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22096>

src/amd/vulkan/radv_pipeline_cache.c
src/amd/vulkan/radv_pipeline_rt.c
src/amd/vulkan/radv_private.h

index 78b90cf..8e62fa5 100644 (file)
@@ -507,7 +507,7 @@ radv_ray_tracing_pipeline_cache_search(struct radv_device *device, struct vk_pip
          pipeline->stages[i].shader = &radv_shader_ref(pipeline_obj->shaders[idx++])->base;
       } else if (is_library) {
          pipeline->stages[i].shader =
-            radv_pipeline_cache_search_nir(device, cache, pipeline->stages[i].sha1, NULL);
+            radv_pipeline_cache_search_nir(device, cache, pipeline->stages[i].sha1);
          complete &= pipeline->stages[i].shader != NULL;
       }
    }
@@ -573,20 +573,16 @@ radv_ray_tracing_pipeline_cache_insert(struct radv_device *device, struct vk_pip
 
 struct vk_pipeline_cache_object *
 radv_pipeline_cache_search_nir(struct radv_device *device, struct vk_pipeline_cache *cache,
-                               const uint8_t *sha1, bool *found_in_application_cache)
+                               const uint8_t *sha1)
 {
-   *found_in_application_cache = false;
-
    if (radv_is_cache_disabled(device))
       return NULL;
 
-   if (!cache) {
+   if (!cache)
       cache = device->mem_cache;
-      found_in_application_cache = NULL;
-   }
 
-   return vk_pipeline_cache_lookup_object(
-      cache, sha1, SHA1_DIGEST_LENGTH, &vk_raw_data_cache_object_ops, found_in_application_cache);
+   return vk_pipeline_cache_lookup_object(cache, sha1, SHA1_DIGEST_LENGTH,
+                                          &vk_raw_data_cache_object_ops, NULL);
 }
 
 struct nir_shader *
index 25c1c83..ecbad8c 100644 (file)
@@ -377,16 +377,10 @@ radv_rt_precompile_shaders(struct radv_device *device, struct vk_pipeline_cache
       radv_hash_shaders(shader_sha1, &stage, 1, NULL, key, radv_get_hash_flags(device, false));
 
       /* lookup the stage in cache */
-      bool found_in_application_cache = false;
-      stages[idx].shader =
-         radv_pipeline_cache_search_nir(device, cache, shader_sha1, &found_in_application_cache);
-
-      if (stages[idx].shader) {
-         if (found_in_application_cache)
-            stage.feedback.flags |=
-               VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT;
+      stages[idx].shader = radv_pipeline_cache_search_nir(device, cache, shader_sha1);
+
+      if (stages[idx].shader)
          goto feedback;
-      }
 
       if (pCreateInfo->flags & VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT)
          return VK_PIPELINE_COMPILE_REQUIRED;
index ee9e87c..3a4a2cc 100644 (file)
@@ -446,8 +446,7 @@ void radv_ray_tracing_pipeline_cache_insert(struct radv_device *device,
 
 struct vk_pipeline_cache_object *radv_pipeline_cache_search_nir(struct radv_device *device,
                                                                 struct vk_pipeline_cache *cache,
-                                                                const unsigned char *sha1,
-                                                                bool *found_in_application_cache);
+                                                                const unsigned char *sha1);
 
 struct vk_pipeline_cache_object *
 radv_pipeline_cache_nir_to_handle(struct radv_device *device, struct vk_pipeline_cache *cache,