From: Daniel Schürmann Date: Tue, 9 May 2023 00:13:30 +0000 (+0200) Subject: radv/rt: don't write cache hit feedback per stage. X-Git-Tag: upstream/23.3.3~7376 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=09e4535f20cd4590b237c1485afb9f12858d8a72;p=platform%2Fupstream%2Fmesa.git radv/rt: don't write cache hit feedback per stage. Too much boilerplate for no benefit. Part-of: --- diff --git a/src/amd/vulkan/radv_pipeline_cache.c b/src/amd/vulkan/radv_pipeline_cache.c index 78b90cf..8e62fa5 100644 --- a/src/amd/vulkan/radv_pipeline_cache.c +++ b/src/amd/vulkan/radv_pipeline_cache.c @@ -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 * diff --git a/src/amd/vulkan/radv_pipeline_rt.c b/src/amd/vulkan/radv_pipeline_rt.c index 25c1c83..ecbad8c 100644 --- a/src/amd/vulkan/radv_pipeline_rt.c +++ b/src/amd/vulkan/radv_pipeline_rt.c @@ -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; diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index ee9e87c..3a4a2cc 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -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,