Module: Mesa Branch: main Commit: ef414a82315768f047d204a46597f53f6145e2c8 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ef414a82315768f047d204a46597f53f6145e2c8
Author: Tatsuyuki Ishi <ishitatsuy...@gmail.com> Date: Fri Nov 10 21:07:19 2023 +0900 radv: Fix mis-sizing of pipeline_flags in radv_hash_rt_shaders. pipeline_flags was 64-bit yet only the first 4 bytes were hashed. Luckily, the mask included no flag above the 32nd bit, so this was technically working fine. Still, it's better to use explicit sizeof constructs to be more resilient to accidental type changes. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26145> --- src/amd/vulkan/radv_pipeline_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_pipeline_cache.c b/src/amd/vulkan/radv_pipeline_cache.c index 3fc10df8b5d..bf8870fbc66 100644 --- a/src/amd/vulkan/radv_pipeline_cache.c +++ b/src/amd/vulkan/radv_pipeline_cache.c @@ -118,7 +118,7 @@ radv_hash_rt_shaders(unsigned char *hash, const VkRayTracingPipelineCreateInfoKH VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR | VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR | VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR | VK_PIPELINE_CREATE_2_LIBRARY_BIT_KHR); - _mesa_sha1_update(&ctx, &pipeline_flags, 4); + _mesa_sha1_update(&ctx, &pipeline_flags, sizeof(pipeline_flags)); _mesa_sha1_update(&ctx, &flags, 4); _mesa_sha1_final(&ctx, hash);