From: Bas Nieuwenhuizen Date: Tue, 15 Jan 2019 21:54:15 +0000 (+0100) Subject: turnip: Add buffer memory binding. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=72384715873f3b7d5a4403e2381d8fbd896c891c;p=mesa.git turnip: Add buffer memory binding. --- diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c index 15bd924afe5..598ed537fa3 100644 --- a/src/freedreno/vulkan/tu_device.c +++ b/src/freedreno/vulkan/tu_device.c @@ -1586,6 +1586,17 @@ tu_BindBufferMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfoKHR *pBindInfos) { + for (uint32_t i = 0; i < bindInfoCount; ++i) { + TU_FROM_HANDLE(tu_device_memory, mem, pBindInfos[i].memory); + TU_FROM_HANDLE(tu_buffer, buffer, pBindInfos[i].buffer); + + if (mem) { + buffer->bo = &mem->bo; + buffer->bo_offset = pBindInfos[i].memoryOffset; + } else { + buffer->bo = NULL; + } + } return VK_SUCCESS; } diff --git a/src/freedreno/vulkan/tu_private.h b/src/freedreno/vulkan/tu_private.h index 9b179f666cf..c64d4ce4957 100644 --- a/src/freedreno/vulkan/tu_private.h +++ b/src/freedreno/vulkan/tu_private.h @@ -632,6 +632,9 @@ struct tu_buffer VkBufferUsageFlags usage; VkBufferCreateFlags flags; + + struct tu_bo *bo; + VkDeviceSize bo_offset; }; enum tu_dynamic_state_bits