From 5023feb0f7a09d90a750e22a88e96b5d738ef567 Mon Sep 17 00:00:00 2001 From: John Anthony Date: Thu, 19 Jun 2025 13:22:56 +0200 Subject: [PATCH] panvk: count iubs correctly when checking if layout is supported For inline uniform blocks, the descriptor count given in the binding is a byte size. Convert the size into a descriptor count and use that when checking if a descriptor set layout is supported. Reviewed-by: Boris Brezillon Reviewed-by: Olivia Lee Reviewed-by: Christoph Pillmayer Fixes: 0440d1dd03e ("panvk: Advertise VK_EXT_inline_uniform_block") Part-of: --- src/panfrost/vulkan/panvk_vX_descriptor_set_layout.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/panfrost/vulkan/panvk_vX_descriptor_set_layout.c b/src/panfrost/vulkan/panvk_vX_descriptor_set_layout.c index 5f9f996112d..391dea423b0 100644 --- a/src/panfrost/vulkan/panvk_vX_descriptor_set_layout.c +++ b/src/panfrost/vulkan/panvk_vX_descriptor_set_layout.c @@ -290,7 +290,11 @@ panvk_per_arch(GetDescriptorSetLayoutSupport)( }; unsigned stride = panvk_get_desc_stride(&layout); - unsigned count = stride * binding->descriptorCount; + unsigned binding_desc_count = binding->descriptorCount; + unsigned count = type == VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK + ? panvk_get_iub_desc_count(binding_desc_count) + : stride * binding_desc_count; + desc_count += count; if (flags & VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT) variable_stride = stride;