From c488dc9f5089033d3f630fa5a84d7a7ebd16cf89 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Thu, 11 Jan 2024 11:08:57 -0600 Subject: [PATCH] vulkan: Add a BLAKE3 hash to vk_descriptor_set_layout Reviewed-by: Alyssa Rosenzweig Part-of: --- src/vulkan/runtime/vk_descriptor_set_layout.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/vulkan/runtime/vk_descriptor_set_layout.h b/src/vulkan/runtime/vk_descriptor_set_layout.h index 857ec1a7bea..b01f30157e4 100644 --- a/src/vulkan/runtime/vk_descriptor_set_layout.h +++ b/src/vulkan/runtime/vk_descriptor_set_layout.h @@ -25,6 +25,7 @@ #include "vk_object.h" +#include "util/mesa-blake3.h" #include "util/u_atomic.h" #ifdef __cplusplus @@ -34,6 +35,13 @@ extern "C" { struct vk_descriptor_set_layout { struct vk_object_base base; + /* BLAKE3 hash of the descriptor set layout. This is used by the common + * pipeline code to properly cache shaders, including handling pipeline + * layouts. It must be populated by the driver or you risk pipeline cache + * collisions. + */ + blake3_hash blake3; + void (*destroy)(struct vk_device *device, struct vk_descriptor_set_layout *layout);