From 59bba821efed5d64ca01ed0fdd00f1f8435390df Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 22 Apr 2024 12:41:13 -0500 Subject: [PATCH] nvk: Hash ycbcr conversions in the descriptor set layout hash Part-of: --- src/nouveau/vulkan/nvk_descriptor_set_layout.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/nouveau/vulkan/nvk_descriptor_set_layout.c b/src/nouveau/vulkan/nvk_descriptor_set_layout.c index 7c8fc3af40a..d28a21dc6a2 100644 --- a/src/nouveau/vulkan/nvk_descriptor_set_layout.c +++ b/src/nouveau/vulkan/nvk_descriptor_set_layout.c @@ -276,7 +276,17 @@ nvk_CreateDescriptorSetLayout(VkDevice device, BLAKE3_UPDATE_VALUE(layout->binding[b].offset); BLAKE3_UPDATE_VALUE(layout->binding[b].stride); BLAKE3_UPDATE_VALUE(layout->binding[b].dynamic_buffer_index); - /* Immutable samplers are ignored for now */ + + if (layout->binding[b].immutable_samplers != NULL) { + for (uint32_t i = 0; i < layout->binding[b].array_size; i++) { + const struct nvk_sampler *sampler = + layout->binding[b].immutable_samplers[i]; + + /* We zalloc the object, so it's safe to hash the whole thing */ + if (sampler != NULL && sampler->vk.ycbcr_conversion != NULL) + BLAKE3_UPDATE_VALUE(sampler->vk.ycbcr_conversion->state); + } + } } #undef BLAKE3_UPDATE_VALUE