zink: use statically sized array for descriptor allocation

this will never be more than 100

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18051>
This commit is contained in:
Mike Blumenkrantz 2022-08-04 12:10:11 -04:00
parent 2ca46b66c3
commit 89daf988bc

View file

@ -280,7 +280,8 @@ bool
zink_descriptor_util_alloc_sets(struct zink_screen *screen, VkDescriptorSetLayout dsl, VkDescriptorPool pool, VkDescriptorSet *sets, unsigned num_sets)
{
VkDescriptorSetAllocateInfo dsai;
VkDescriptorSetLayout *layouts = alloca(sizeof(*layouts) * num_sets);
VkDescriptorSetLayout layouts[100];
assert(num_sets <= ARRAY_SIZE(layouts));
memset((void *)&dsai, 0, sizeof(dsai));
dsai.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
dsai.pNext = NULL;