zink: slightly simplify bda allocation chaining
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 3 May 2023 20:34:11 +0000 (16:34 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 16 May 2023 00:11:12 +0000 (00:11 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22855>

src/gallium/drivers/zink/zink_bo.c

index a69a050..adcaa71 100644 (file)
@@ -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) {