diff options
author | Bas Nieuwenhuizen <[email protected]> | 2019-01-15 22:54:15 +0100 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2019-03-11 10:02:13 -0700 |
commit | 72384715873f3b7d5a4403e2381d8fbd896c891c (patch) | |
tree | 36bfe7ec6aa29dfdabc08896f782a76c5f7e4211 /src/freedreno/vulkan | |
parent | 08b1c3fc7f1c5ea5b5bee1eccb635b855c4f383b (diff) |
turnip: Add buffer memory binding.
Diffstat (limited to 'src/freedreno/vulkan')
-rw-r--r-- | src/freedreno/vulkan/tu_device.c | 11 | ||||
-rw-r--r-- | src/freedreno/vulkan/tu_private.h | 3 |
2 files changed, 14 insertions, 0 deletions
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 |