Skip to content
Snippets Groups Projects
Commit 67d911b7 authored by Pablo Escobar's avatar Pablo Escobar
Browse files

add support for getting buffer address (VK_KHR_buffer_device_address)

parent 36c47577
No related branches found
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