From b88006fb9f615fd1e6782415ee0244c6f3953da3 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 3 May 2023 16:34:11 -0400 Subject: [PATCH] zink: slightly simplify bda allocation chaining Part-of: --- src/gallium/drivers/zink/zink_bo.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/zink/zink_bo.c b/src/gallium/drivers/zink/zink_bo.c index a69a050..adcaa71 100644 --- a/src/gallium/drivers/zink/zink_bo.c +++ b/src/gallium/drivers/zink/zink_bo.c @@ -265,13 +265,12 @@ bo_create_internal(struct zink_screen *screen, ai.pNext = pNext; ai.flags = VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR; ai.deviceMask = 0; + if (screen->info.have_KHR_buffer_device_address) + pNext = &ai; VkMemoryAllocateInfo mai; mai.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; - if (screen->info.have_KHR_buffer_device_address) - mai.pNext = &ai; - else - mai.pNext = pNext; + mai.pNext = pNext; mai.allocationSize = size; mai.memoryTypeIndex = mem_type_idx; if (screen->info.mem_props.memoryTypes[mai.memoryTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { -- 2.7.4