mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-11 05:50:14 +01:00
vk/alloc: Handle zero sizes better in vk_multialloc_add
Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9511>
This commit is contained in:
parent
c22267262e
commit
5afdbfe0c8
1 changed files with 5 additions and 0 deletions
|
|
@ -160,6 +160,11 @@ _vk_multialloc_add(struct vk_multialloc *ma,
|
|||
void **ptr, size_t size, size_t align)
|
||||
{
|
||||
assert(util_is_power_of_two_nonzero(align));
|
||||
if (size == 0) {
|
||||
*ptr = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
size_t offset = ALIGN_POT(ma->size, align);
|
||||
ma->size = offset + size;
|
||||
ma->align = MAX2(ma->align, align);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue