vulkan/alloc: Add VK_MULTIALLOC_DECL macros

These both declare the variable and add it to the allocator in one go.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9511>
This commit is contained in:
Jason Ekstrand
2021-03-10 20:20:37 -06:00
parent 5afdbfe0c8
commit c120edd8e8
8 changed files with 53 additions and 60 deletions

View File

@@ -2787,11 +2787,10 @@ VkResult anv_WaitSemaphores(
ANV_FROM_HANDLE(anv_device, device, _device);
uint32_t *handles;
struct anv_timeline **timelines;
uint64_t *values;
VK_MULTIALLOC(ma);
vk_multialloc_add(&ma, &values, pWaitInfo->semaphoreCount);
VK_MULTIALLOC_DECL(&ma, uint64_t, values, pWaitInfo->semaphoreCount);
if (device->has_thread_submit) {
vk_multialloc_add(&ma, &handles, pWaitInfo->semaphoreCount);
} else {