From: Mike Blumenkrantz Date: Wed, 3 May 2023 20:34:11 +0000 (-0400) Subject: zink: slightly simplify bda allocation chaining X-Git-Tag: upstream/23.3.3~8619 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b88006fb9f615fd1e6782415ee0244c6f3953da3;p=platform%2Fupstream%2Fmesa.git zink: slightly simplify bda allocation chaining Part-of: --- 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) {