radv/rt: don't write cache hit feedback per stage.

Too much boilerplate for no benefit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22096>
This commit is contained in:
Daniel Schürmann 2023-05-09 02:13:30 +02:00 committed by Marge Bot
parent 7f2a569ec5
commit 09e4535f20
3 changed files with 8 additions and 19 deletions

View 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 *

View 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);
stages[idx].shader = radv_pipeline_cache_search_nir(device, cache, shader_sha1);
if (stages[idx].shader) {
if (found_in_application_cache)
stage.feedback.flags |=
VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT;
if (stages[idx].shader)
goto feedback;
}
if (pCreateInfo->flags & VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT)
return VK_PIPELINE_COMPILE_REQUIRED;

View 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,