This header file is generated (generator) using a vulkan-hpp fork, that's why the interface is so similar.
The binding header does not include original c header, so to use it, you still have to make sure that vk_mem_alloc.h
is accessible (#include "vk_mem_alloc.h"
is a valid line of code). An optimal way is to add its location to the include path of your preferred build system. You can get the header from the original repository.
If you find any bugs or problems, I'd appreciate an issue either here or in the generator repository.
Original VulkanMemoryAllocator (from here)
VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
bufferInfo.size = 65536;
bufferInfo.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
VmaAllocationCreateInfo allocInfo = {};
allocInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY;
VkBuffer buffer;
VmaAllocation allocation;
vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
vkma::BufferCreateInfo buffer_info = {
.size = 65536,
.usage = vk::BufferUsageFlagBits::eVertexBuffer | vk::BufferUsageFlagBits::eTransferDst,
};
vkma::AllocationCreateInfo allocation_info = {
.usage = vkma::MemoryUsage::eGpuOnly
};
auto vkma_buffer = allocator.createUnique(buffer_info, allocation_info);
auto vk_buffer = vkma_buffer->get();
auto allocation = vkma_buffer->getAllocation();