From fce10ddf0f9ae30c62c871ae43d9aa690374b5e9 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Thu, 6 Oct 2022 08:59:29 -0700 Subject: [PATCH] vulkan/util: Make multialloc succeed with 0 allocations. I wanted to use it for the attachments and clear values of a vkCmdBeginRenderPass(), but both can be 0 count. In that case, we would end up with vk_default_alloc(0,0) because nothing had set the alignment, and assertion fail instead of allocating 0 bytes. Reviewed-by: Connor Abbott Part-of: --- src/vulkan/util/vk_alloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vulkan/util/vk_alloc.h b/src/vulkan/util/vk_alloc.h index 17d1f2f5a58..0f8a3cad830 100644 --- a/src/vulkan/util/vk_alloc.h +++ b/src/vulkan/util/vk_alloc.h @@ -185,7 +185,7 @@ struct vk_multialloc { }; #define VK_MULTIALLOC(_name) \ - struct vk_multialloc _name = { 0, } + struct vk_multialloc _name = { .align = 1 } static ALWAYS_INLINE void vk_multialloc_add_size_align(struct vk_multialloc *ma,