Module: Mesa Branch: main Commit: 8cb7bab3413d85a7773b7b2e4fd2a42841634ea9 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8cb7bab3413d85a7773b7b2e4fd2a42841634ea9
Author: Yiwei Zhang <[email protected]> Date: Thu Jul 20 11:47:52 2023 -0700 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 <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24263> --- 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 5509730b2bd..8ae2bb1b75d 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;
