Skip to content
Snippets Groups Projects
Unverified Commit 6a367375 authored by Lava Block's avatar Lava Block Committed by GitHub
Browse files

Merge pull request #42 from pezcode/buffer-address

Add support for getting buffer address (VK_KHR_buffer_device_address)
parents 36c47577 67d911b7
Branches
No related tags found
No related merge requests found
......@@ -105,6 +105,18 @@ namespace lava {
device = nullptr;
}
VkDeviceAddress buffer::get_address() const {
if (device->call().vkGetBufferDeviceAddressKHR) {
VkBufferDeviceAddressInfoKHR addr_info{
.sType = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHR,
.buffer = vk_buffer
};
return device->call().vkGetBufferDeviceAddressKHR(device->get(), &addr_info);
} else {
return 0;
}
}
void buffer::flush(VkDeviceSize offset, VkDeviceSize size) {
vmaFlushAllocation(device->alloc(), allocation, offset, size);
}
......
......@@ -45,6 +45,7 @@ namespace lava {
return get_descriptor();
}
VkDeviceAddress get_address() const;
VkDeviceSize get_size() const {
return allocation_info.size;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment