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 <boris.brezillon@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Fixes: 0440d1dd03 ("panvk: Advertise VK_EXT_inline_uniform_block")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35545>
This commit is contained in:
John Anthony 2025-06-19 13:22:56 +02:00 committed by Marge Bot
parent 3e9dc4f777
commit 5023feb0f7

View file

@ -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;