diff --git a/src/amd/vulkan/radv_pipeline_cache.c b/src/amd/vulkan/radv_pipeline_cache.c index 081ce4d1a82..14acb697713 100644 --- a/src/amd/vulkan/radv_pipeline_cache.c +++ b/src/amd/vulkan/radv_pipeline_cache.c @@ -153,7 +153,7 @@ radv_hash_shaders(unsigned char *hash, const struct radv_pipeline_stage *stages, void radv_hash_rt_shaders(unsigned char *hash, const VkRayTracingPipelineCreateInfoKHR *pCreateInfo, - uint32_t flags) + const struct radv_pipeline_key *key, uint32_t flags) { RADV_FROM_HANDLE(radv_pipeline_layout, layout, pCreateInfo->layout); struct mesa_sha1 ctx; @@ -162,6 +162,8 @@ radv_hash_rt_shaders(unsigned char *hash, const VkRayTracingPipelineCreateInfoKH if (layout) _mesa_sha1_update(&ctx, layout->sha1, sizeof(layout->sha1)); + _mesa_sha1_update(&ctx, key, sizeof(*key)); + for (uint32_t i = 0; i < pCreateInfo->stageCount; ++i) { RADV_FROM_HANDLE(vk_shader_module, module, pCreateInfo->pStages[i].module); const VkSpecializationInfo *spec_info = pCreateInfo->pStages[i].pSpecializationInfo; diff --git a/src/amd/vulkan/radv_pipeline_rt.c b/src/amd/vulkan/radv_pipeline_rt.c index f9c8cbf071c..d11b2995446 100644 --- a/src/amd/vulkan/radv_pipeline_rt.c +++ b/src/amd/vulkan/radv_pipeline_rt.c @@ -272,7 +272,6 @@ radv_rt_pipeline_create(VkDevice _device, VkPipelineCache _cache, goto fail; } - radv_hash_rt_shaders(hash, &local_create_info, radv_get_hash_flags(device, keep_statistic_info)); struct vk_shader_module module = {.base.type = VK_OBJECT_TYPE_SHADER_MODULE}; VkPipelineShaderStageCreateInfo stage = { @@ -301,6 +300,9 @@ radv_rt_pipeline_create(VkDevice _device, VkPipelineCache _cache, struct radv_pipeline_key key = radv_generate_rt_pipeline_key(rt_pipeline, pCreateInfo->flags); UNUSED gl_shader_stage last_vgt_api_stage = MESA_SHADER_NONE; + radv_hash_rt_shaders(hash, &local_create_info, &key, + radv_get_hash_flags(device, keep_statistic_info)); + /* First check if we can get things from the cache before we take the expensive step of * generating the nir. */ result = radv_create_shaders( diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 795eb5d6284..0d43cb68d9d 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -1965,7 +1965,7 @@ void radv_hash_shaders(unsigned char *hash, const struct radv_pipeline_stage *st const struct radv_pipeline_key *key, uint32_t flags); void radv_hash_rt_shaders(unsigned char *hash, const VkRayTracingPipelineCreateInfoKHR *pCreateInfo, - uint32_t flags); + const struct radv_pipeline_key *key, uint32_t flags); uint32_t radv_get_hash_flags(const struct radv_device *device, bool stats);