From: Yiwei Zhang Date: Thu, 20 Jul 2023 18:47:52 +0000 (-0700) Subject: lvp: avoid reading immutable sampler from desc write info X-Git-Tag: upstream/23.3.3~5223 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8cb7bab3413d85a7773b7b2e4fd2a42841634ea9;p=platform%2Fupstream%2Fmesa.git 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: --- 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;