From 8cb7bab3413d85a7773b7b2e4fd2a42841634ea9 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Thu, 20 Jul 2023 11:47:52 -0700 Subject: [PATCH] lvp: avoid reading immutable sampler from desc write info Lavapipe has switched to layer push descriptor support atop descriptor updates internally since 12a7fc51c77925a5562fd104a8fbd664a46ffc8b, so it must skip retrieving immutable samplers from the write info even if the update call itself is blessed by the spec to not hit that case. Fixes: 12a7fc51c77 ("lavapipe: Rework descriptor handling") Signed-off-by: Yiwei Zhang Part-of: --- src/gallium/frontends/lavapipe/lvp_descriptor_set.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gallium/frontends/lavapipe/lvp_descriptor_set.c b/src/gallium/frontends/lavapipe/lvp_descriptor_set.c index 5509730..8ae2bb1 100644 --- a/src/gallium/frontends/lavapipe/lvp_descriptor_set.c +++ b/src/gallium/frontends/lavapipe/lvp_descriptor_set.c @@ -449,12 +449,13 @@ VKAPI_ATTR void VKAPI_CALL lvp_UpdateDescriptorSets( switch (write->descriptorType) { case VK_DESCRIPTOR_TYPE_SAMPLER: - for (uint32_t j = 0; j < write->descriptorCount; j++) { - LVP_FROM_HANDLE(lvp_sampler, sampler, - write->pImageInfo[j].sampler); + if (!bind_layout->immutable_samplers) { + for (uint32_t j = 0; j < write->descriptorCount; j++) { + LVP_FROM_HANDLE(lvp_sampler, sampler, write->pImageInfo[j].sampler); - desc[j].sampler = sampler->desc.sampler; - desc[j].sampler_index = sampler->desc.sampler_index; + desc[j].sampler = sampler->desc.sampler; + desc[j].sampler_index = sampler->desc.sampler_index; + } } break; -- 2.7.4