From 4de0e11b92d7dea954db42e7d84439ba709d4627 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 13 Dec 2024 13:09:15 +0100 Subject: [PATCH] lavapipe: use vk_descriptor_type_is_dynamic No need to open-code this one now that we have a generic helper. Reviewed-by: Alyssa Rosenzweig Reviewed-by: Lionel Landwerlin Part-of: --- src/gallium/frontends/lavapipe/lvp_descriptor_set.c | 3 +-- src/gallium/frontends/lavapipe/lvp_execute.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gallium/frontends/lavapipe/lvp_descriptor_set.c b/src/gallium/frontends/lavapipe/lvp_descriptor_set.c index 8ca4edc7b4a..2d9809cc412 100644 --- a/src/gallium/frontends/lavapipe/lvp_descriptor_set.c +++ b/src/gallium/frontends/lavapipe/lvp_descriptor_set.c @@ -128,8 +128,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateDescriptorSetLayout( set_layout->binding[b].uniform_block_offset = 0; set_layout->binding[b].uniform_block_size = 0; - if (binding->descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC || - binding->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC) { + if (vk_descriptor_type_is_dynamic(binding->descriptorType)) { set_layout->binding[b].dynamic_index = dynamic_offset_count; dynamic_offset_count += binding->descriptorCount; } diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index fa8d573d6c3..ef0eb43af87 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -1238,8 +1238,7 @@ apply_dynamic_offsets(struct lvp_descriptor_set **out_set, const uint32_t *offse for (uint32_t i = 0; i < set->layout->binding_count; i++) { const struct lvp_descriptor_set_binding_layout *binding = &set->layout->binding[i]; - if (binding->type != VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC && - binding->type != VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC) + if (!vk_descriptor_type_is_dynamic(binding->type)) continue; struct lp_descriptor *desc = set->map;