+
VkBufferCreateInfo sampleBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
+
sampleBufCreateInfo.size = 0x10000;
+
sampleBufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+
+
+
+
+
uint32_t memTypeIndex;
+
+
&sampleBufCreateInfo, &sampleAllocCreateInfo, &memTypeIndex);
+
+
+
-
-
poolCreateInfo.blockSize = 128ull * 1024 * 1024;
+
+
poolCreateInfo.
blockSize = 128ull * 1024 * 1024;
-
+
+
VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
@@ -105,16 +119,19 @@ $(function() {
VkBuffer buf;
-
-
vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);
+
res =
vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc,
nullptr);
+
VkResult vmaCreatePool(VmaAllocator allocator, const VmaPoolCreateInfo *pCreateInfo, VmaPool *pPool)
Allocates Vulkan device memory and creates VmaPool object.
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
+
VkResult vmaFindMemoryTypeIndexForBufferInfo(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
+
@ VMA_MEMORY_USAGE_AUTO
Definition: vk_mem_alloc.h:489
Definition: vk_mem_alloc.h:1212
VmaPool pool
Pool that this allocation should be created in.
Definition: vk_mem_alloc.h:1244
+
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1220
Represents single memory allocation.
-
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:1327
Describes parameter of created VmaPool.
Definition: vk_mem_alloc.h:1263
uint32_t memoryTypeIndex
Vulkan memory type index to allocate this pool from.
Definition: vk_mem_alloc.h:1266
+
VkDeviceSize blockSize
Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes....
Definition: vk_mem_alloc.h:1279
size_t maxBlockCount
Maximum number of blocks that can be allocated in this pool. Optional.
Definition: vk_mem_alloc.h:1292
Represents custom memory pool.
You have to free all allocations made from this pool before destroying it.
VkResult vmaFindMemoryTypeIndexForBufferInfo(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.