From 786bace19110883371097e23e5971d28a01fc85b Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 18 Jun 2025 09:18:19 +0300 Subject: [PATCH] anv: fix sampler hashing in set layouts The logic needs to handle embedded samplers without conversion state. Fixes vkd3d-proton's test_sampler_border_color Signed-off-by: Lionel Landwerlin Cc: mesa-stable Reviewed-by: Nanley Chery Part-of: --- src/intel/vulkan/anv_descriptor_set.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index 358cfdb666e..3954dd41e74 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -1036,13 +1036,11 @@ sha1_update_immutable_sampler(struct mesa_sha1 *ctx, bool embedded_sampler, const struct anv_sampler *sampler) { - if (!sampler->vk.ycbcr_conversion) - return; - - /* Hash the conversion if any as this affect placement of descriptors in - * the set due to the number of planes. + /* Hash the conversion if any as this affect shader compilation due to NIR + * lowering. */ - SHA1_UPDATE_VALUE(ctx, sampler->vk.ycbcr_conversion->state); + if (sampler->vk.ycbcr_conversion) + SHA1_UPDATE_VALUE(ctx, sampler->vk.ycbcr_conversion->state); /* For embedded samplers, we need to hash the sampler parameters as the * sampler handle is baked into the shader and this ultimately is part of