From 32567f6a2af6b8a81a5e10261f5b6883848dcaba Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 13 Sep 2024 15:55:09 +0200 Subject: [PATCH] radv: compute shader hash for shaders created without internal cache VK_KHR_pipeline_binary allows the application to take full control on the cache and internal caches (disk or in-memory) can be disabled. Though the shader hash should still be computed, otherwise all pipeline binaries have a key with all zeroes. Fixes: 88026124585 ("radv: advertise VK_KHR_pipeline_binary" Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_shader.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 97e62043f28..74da67d96ba 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -2578,6 +2578,8 @@ radv_shader_create_uncached(struct radv_device *device, const struct radv_shader } simple_mtx_init(&shader->replay_mtx, mtx_plain); + _mesa_blake3_compute(binary, binary->total_size, shader->hash); + vk_pipeline_cache_object_init(&device->vk, &shader->base, &radv_shader_ops, shader->hash, sizeof(shader->hash)); shader->info = binary->info;