aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2019-01-15 22:54:15 +0100
committerChia-I Wu <[email protected]>2019-03-11 10:02:13 -0700
commit72384715873f3b7d5a4403e2381d8fbd896c891c (patch)
tree36bfe7ec6aa29dfdabc08896f782a76c5f7e4211 /src/freedreno
parent08b1c3fc7f1c5ea5b5bee1eccb635b855c4f383b (diff)
turnip: Add buffer memory binding.
Diffstat (limited to 'src/freedreno')
-rw-r--r--src/freedreno/vulkan/tu_device.c11
-rw-r--r--src/freedreno/vulkan/tu_private.h3
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