diff --git a/docs/html/allocation_annotation.html b/docs/html/allocation_annotation.html index 01151dc..da3ebf5 100644 --- a/docs/html/allocation_annotation.html +++ b/docs/html/allocation_annotation.html @@ -91,18 +91,18 @@ Allocation user data
VmaAllocation allocation;
vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buffer, &allocation, nullptr);
vmaCreateBuffer
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
Creates a new VkBuffer, allocates and binds memory for it.
-
VMA_MEMORY_USAGE_AUTO
@ VMA_MEMORY_USAGE_AUTO
Definition: vk_mem_alloc.h:489
-
VmaAllocationCreateInfo
Parameters of new VmaAllocation.
Definition: vk_mem_alloc.h:1219
-
VmaAllocationCreateInfo::pUserData
void * pUserData
Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo...
Definition: vk_mem_alloc.h:1258
-
VmaAllocationCreateInfo::usage
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1227
+
VMA_MEMORY_USAGE_AUTO
@ VMA_MEMORY_USAGE_AUTO
Definition: vk_mem_alloc.h:495
+
VmaAllocationCreateInfo
Parameters of new VmaAllocation.
Definition: vk_mem_alloc.h:1305
+
VmaAllocationCreateInfo::pUserData
void * pUserData
Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo...
Definition: vk_mem_alloc.h:1344
+
VmaAllocationCreateInfo::usage
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1313
VmaAllocation
Represents single memory allocation.

The pointer may be later retrieved as VmaAllocationInfo::pUserData:

VmaAllocationInfo allocInfo;
vmaGetAllocationInfo(allocator, allocation, &allocInfo);
MyBufferMetadata* pMetadata = (MyBufferMetadata*)allocInfo.pUserData;
void vmaGetAllocationInfo(VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)
Returns current information about specified allocation.
-
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:1334
-
void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition: vk_mem_alloc.h:1381
+
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:1420
+
void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition: vk_mem_alloc.h:1467

It can also be changed using function vmaSetAllocationUserData().

Values of (non-zero) allocations' pUserData are printed in JSON report created by vmaBuildStatsString() in hexadecimal form.

diff --git a/docs/html/annotated.html b/docs/html/annotated.html index a9ae67f..4266301 100644 --- a/docs/html/annotated.html +++ b/docs/html/annotated.html @@ -81,23 +81,28 @@ $(function() {  CVmaAllocatorCreateInfoDescription of a Allocator to be created  CVmaAllocatorInfoInformation about existing VmaAllocator object  CVmaBudgetStatistics of current memory usage and available budget for a specific memory heap - CVmaDefragmentationContextAn opaque object that represents started defragmentation process - CVmaDefragmentationInfoParameters for defragmentation - CVmaDefragmentationMoveSingle move of an allocation to be done for defragmentation - CVmaDefragmentationPassMoveInfoParameters for incremental defragmentation steps - CVmaDefragmentationStatsStatistics returned for defragmentation process in function vmaEndDefragmentation() - CVmaDetailedStatisticsMore detailed statistics than VmaStatistics - CVmaDeviceMemoryCallbacksSet of callbacks that the library will call for vkAllocateMemory and vkFreeMemory - CVmaPoolRepresents custom memory pool - CVmaPoolCreateInfoDescribes parameter of created VmaPool - CVmaStatisticsCalculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total - CVmaTotalStatisticsGeneral statistics from current state of the Allocator - total memory usage across all memory heaps and types - CVmaVirtualAllocationRepresents single memory allocation done inside VmaVirtualBlock - CVmaVirtualAllocationCreateInfoParameters of created virtual allocation to be passed to vmaVirtualAllocate() - CVmaVirtualAllocationInfoParameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo() - CVmaVirtualBlockHandle to a virtual block object that allows to use core allocation algorithm without allocating any real GPU memory - CVmaVirtualBlockCreateInfoParameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock() - CVmaVulkanFunctionsPointers to some Vulkan functions - a subset used by the library + CVmaBufferAllocatorTODO document! + CVmaBufferAllocatorCreateInfoParameters of created VmaBufferAllocator object to be passed to vmaCreateBufferAllocator() + CVmaBufferSuballocationTODO document! + CVmaBufferSuballocationCreateInfoParameters of created VmaBufferSuballocation object to be passed to vmaBufferAllocatorAllocate() + CVmaBufferSuballocationInfoParameters of an existing buffer suballocation, returned by vmaGetBufferSuballocationInfo() + CVmaDefragmentationContextAn opaque object that represents started defragmentation process + CVmaDefragmentationInfoParameters for defragmentation + CVmaDefragmentationMoveSingle move of an allocation to be done for defragmentation + CVmaDefragmentationPassMoveInfoParameters for incremental defragmentation steps + CVmaDefragmentationStatsStatistics returned for defragmentation process in function vmaEndDefragmentation() + CVmaDetailedStatisticsMore detailed statistics than VmaStatistics + CVmaDeviceMemoryCallbacksSet of callbacks that the library will call for vkAllocateMemory and vkFreeMemory + CVmaPoolRepresents custom memory pool + CVmaPoolCreateInfoDescribes parameter of created VmaPool + CVmaStatisticsCalculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total + CVmaTotalStatisticsGeneral statistics from current state of the Allocator - total memory usage across all memory heaps and types + CVmaVirtualAllocationRepresents single memory allocation done inside VmaVirtualBlock + CVmaVirtualAllocationCreateInfoParameters of created virtual allocation to be passed to vmaVirtualAllocate() + CVmaVirtualAllocationInfoParameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo() + CVmaVirtualBlockHandle to a virtual block object that allows to use core allocation algorithm without allocating any real GPU memory + CVmaVirtualBlockCreateInfoParameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock() + CVmaVulkanFunctionsPointers to some Vulkan functions - a subset used by the library diff --git a/docs/html/buffer_suballocation.html b/docs/html/buffer_suballocation.html new file mode 100644 index 0000000..ee4221e --- /dev/null +++ b/docs/html/buffer_suballocation.html @@ -0,0 +1,87 @@ + + + + + + + +Vulkan Memory Allocator: Buffer suballocation + + + + + + + + + +
+
+ + + + + + +
+
Vulkan Memory Allocator +
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
Buffer suballocation
+
+
+

TODO document!

+
+
+ + + + diff --git a/docs/html/choosing_memory_type.html b/docs/html/choosing_memory_type.html index f19939d..b44529e 100644 --- a/docs/html/choosing_memory_type.html +++ b/docs/html/choosing_memory_type.html @@ -101,9 +101,9 @@ Usage

VmaAllocation allocation;
vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
vmaCreateBuffer
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
Creates a new VkBuffer, allocates and binds memory for it.
-
VMA_MEMORY_USAGE_AUTO
@ VMA_MEMORY_USAGE_AUTO
Definition: vk_mem_alloc.h:489
-
VmaAllocationCreateInfo
Parameters of new VmaAllocation.
Definition: vk_mem_alloc.h:1219
-
VmaAllocationCreateInfo::usage
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1227
+
VMA_MEMORY_USAGE_AUTO
@ VMA_MEMORY_USAGE_AUTO
Definition: vk_mem_alloc.h:495
+
VmaAllocationCreateInfo
Parameters of new VmaAllocation.
Definition: vk_mem_alloc.h:1305
+
VmaAllocationCreateInfo::usage
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1313
VmaAllocation
Represents single memory allocation.

If you have a preference for putting the resource in GPU (device) memory or CPU (host) memory on systems with discrete graphics card that have the memories separate, you can use VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE or VMA_MEMORY_USAGE_AUTO_PREFER_HOST.

When using VMA_MEMORY_USAGE_AUTO* while you want to map the allocated memory, you also need to specify one of the host access flags: VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT. This will help the library decide about preferred memory type to ensure it has VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT so you can map it.

@@ -119,8 +119,8 @@ Usage
VkBuffer stagingBuffer;
VmaAllocation stagingAllocation;
vmaCreateBuffer(allocator, &stagingBufferInfo, &stagingAllocInfo, &stagingBuffer, &stagingAllocation, nullptr);
-
VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT
@ VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT
Definition: vk_mem_alloc.h:595
-
VmaAllocationCreateInfo::flags
VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:1221
+
VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT
@ VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT
Definition: vk_mem_alloc.h:601
+
VmaAllocationCreateInfo::flags
VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:1307

For more examples of creating different kinds of resources, see chapter Recommended usage patterns.

Usage values VMA_MEMORY_USAGE_AUTO* are legal to use only when the library knows about the resource being created by having VkBufferCreateInfo / VkImageCreateInfo passed, so they work with functions like: vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo() etc. If you allocate raw memory using function vmaAllocateMemory(), you have to use other means of selecting memory type, as described below.

Note
Old usage values (VMA_MEMORY_USAGE_GPU_ONLY, VMA_MEMORY_USAGE_CPU_ONLY, VMA_MEMORY_USAGE_CPU_TO_GPU, VMA_MEMORY_USAGE_GPU_TO_CPU, VMA_MEMORY_USAGE_CPU_COPY) are still available and work same way as in previous versions of the library for backward compatibility, but they are not recommended.
@@ -135,10 +135,10 @@ Required and preferred flags
VkBuffer buffer;
VmaAllocation allocation;
vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
-
VMA_ALLOCATION_CREATE_MAPPED_BIT
@ VMA_ALLOCATION_CREATE_MAPPED_BIT
Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.
Definition: vk_mem_alloc.h:546
-
VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
@ VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
Definition: vk_mem_alloc.h:607
-
VmaAllocationCreateInfo::preferredFlags
VkMemoryPropertyFlags preferredFlags
Flags that preferably should be set in a memory type chosen for an allocation.
Definition: vk_mem_alloc.h:1237
-
VmaAllocationCreateInfo::requiredFlags
VkMemoryPropertyFlags requiredFlags
Flags that must be set in a Memory Type chosen for an allocation.
Definition: vk_mem_alloc.h:1232
+
VMA_ALLOCATION_CREATE_MAPPED_BIT
@ VMA_ALLOCATION_CREATE_MAPPED_BIT
Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.
Definition: vk_mem_alloc.h:552
+
VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
@ VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
Definition: vk_mem_alloc.h:613
+
VmaAllocationCreateInfo::preferredFlags
VkMemoryPropertyFlags preferredFlags
Flags that preferably should be set in a memory type chosen for an allocation.
Definition: vk_mem_alloc.h:1323
+
VmaAllocationCreateInfo::requiredFlags
VkMemoryPropertyFlags requiredFlags
Flags that must be set in a Memory Type chosen for an allocation.
Definition: vk_mem_alloc.h:1318

A memory type is chosen that has all the required flags and as many preferred flags set as possible.

Value passed in VmaAllocationCreateInfo::usage is internally converted to a set of required and preferred flags, plus some extra "magic" (heuristics).

@@ -153,7 +153,7 @@ Explicit memory types

VkBuffer buffer;
VmaAllocation allocation;
vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
-
VmaAllocationCreateInfo::memoryTypeBits
uint32_t memoryTypeBits
Bitmask containing one bit set for every memory type acceptable for this allocation.
Definition: vk_mem_alloc.h:1245
+
VmaAllocationCreateInfo::memoryTypeBits
uint32_t memoryTypeBits
Bitmask containing one bit set for every memory type acceptable for this allocation.
Definition: vk_mem_alloc.h:1331

Custom memory pools

If you allocate from custom memory pool, all the ways of specifying memory requirements described above are not applicable and the aforementioned members of VmaAllocationCreateInfo structure are ignored. Memory type is selected explicitly when creating the pool and then used to make all the allocations from that pool. For further details, see Custom memory pools.

diff --git a/docs/html/classes.html b/docs/html/classes.html index bd2069e..149d90c 100644 --- a/docs/html/classes.html +++ b/docs/html/classes.html @@ -76,7 +76,7 @@ $(function() {
V
-
VmaAllocation
VmaAllocationCreateInfo
VmaAllocationInfo
VmaAllocator
VmaAllocatorCreateInfo
VmaAllocatorInfo
VmaBudget
VmaDefragmentationContext
VmaDefragmentationInfo
VmaDefragmentationMove
VmaDefragmentationPassMoveInfo
VmaDefragmentationStats
VmaDetailedStatistics
VmaDeviceMemoryCallbacks
VmaPool
VmaPoolCreateInfo
VmaStatistics
VmaTotalStatistics
VmaVirtualAllocation
VmaVirtualAllocationCreateInfo
VmaVirtualAllocationInfo
VmaVirtualBlock
VmaVirtualBlockCreateInfo
VmaVulkanFunctions
+
VmaAllocation
VmaAllocationCreateInfo
VmaAllocationInfo
VmaAllocator
VmaAllocatorCreateInfo
VmaAllocatorInfo
VmaBudget
VmaBufferAllocator
VmaBufferAllocatorCreateInfo
VmaBufferSuballocation
VmaBufferSuballocationCreateInfo
VmaBufferSuballocationInfo
VmaDefragmentationContext
VmaDefragmentationInfo
VmaDefragmentationMove
VmaDefragmentationPassMoveInfo
VmaDefragmentationStats
VmaDetailedStatistics
VmaDeviceMemoryCallbacks
VmaPool
VmaPoolCreateInfo
VmaStatistics
VmaTotalStatistics
VmaVirtualAllocation
VmaVirtualAllocationCreateInfo
VmaVirtualAllocationInfo
VmaVirtualBlock
VmaVirtualBlockCreateInfo
VmaVulkanFunctions
diff --git a/docs/html/custom_memory_pools.html b/docs/html/custom_memory_pools.html index e853668..98b8fee 100644 --- a/docs/html/custom_memory_pools.html +++ b/docs/html/custom_memory_pools.html @@ -131,15 +131,15 @@ $(function() {
vmaCreatePool
VkResult vmaCreatePool(VmaAllocator allocator, const VmaPoolCreateInfo *pCreateInfo, VmaPool *pPool)
Allocates Vulkan device memory and creates VmaPool object.
vmaCreateBuffer
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
Creates a new VkBuffer, allocates and binds memory for it.
vmaFindMemoryTypeIndexForBufferInfo
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
@ VMA_MEMORY_USAGE_AUTO
Definition: vk_mem_alloc.h:489
-
VmaAllocationCreateInfo
Parameters of new VmaAllocation.
Definition: vk_mem_alloc.h:1219
-
VmaAllocationCreateInfo::pool
VmaPool pool
Pool that this allocation should be created in.
Definition: vk_mem_alloc.h:1251
-
VmaAllocationCreateInfo::usage
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1227
+
VMA_MEMORY_USAGE_AUTO
@ VMA_MEMORY_USAGE_AUTO
Definition: vk_mem_alloc.h:495
+
VmaAllocationCreateInfo
Parameters of new VmaAllocation.
Definition: vk_mem_alloc.h:1305
+
VmaAllocationCreateInfo::pool
VmaPool pool
Pool that this allocation should be created in.
Definition: vk_mem_alloc.h:1337
+
VmaAllocationCreateInfo::usage
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1313
VmaAllocation
Represents single memory allocation.
-
VmaPoolCreateInfo
Describes parameter of created VmaPool.
Definition: vk_mem_alloc.h:1270
-
VmaPoolCreateInfo::memoryTypeIndex
uint32_t memoryTypeIndex
Vulkan memory type index to allocate this pool from.
Definition: vk_mem_alloc.h:1273
-
VmaPoolCreateInfo::blockSize
VkDeviceSize blockSize
Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes....
Definition: vk_mem_alloc.h:1286
-
VmaPoolCreateInfo::maxBlockCount
size_t maxBlockCount
Maximum number of blocks that can be allocated in this pool. Optional.
Definition: vk_mem_alloc.h:1299
+
VmaPoolCreateInfo
Describes parameter of created VmaPool.
Definition: vk_mem_alloc.h:1356
+
VmaPoolCreateInfo::memoryTypeIndex
uint32_t memoryTypeIndex
Vulkan memory type index to allocate this pool from.
Definition: vk_mem_alloc.h:1359
+
VmaPoolCreateInfo::blockSize
VkDeviceSize blockSize
Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes....
Definition: vk_mem_alloc.h:1372
+
VmaPoolCreateInfo::maxBlockCount
size_t maxBlockCount
Maximum number of blocks that can be allocated in this pool. Optional.
Definition: vk_mem_alloc.h:1385
VmaPool
Represents custom memory pool.

You have to free all allocations made from this pool before destroying it.

vmaDestroyBuffer(allocator, buf, alloc);
diff --git a/docs/html/defragmentation.html b/docs/html/defragmentation.html index 011c9b6..5d007c8 100644 --- a/docs/html/defragmentation.html +++ b/docs/html/defragmentation.html @@ -141,18 +141,18 @@ $(function() {
VkResult vmaBeginDefragmentationPass(VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo)
Starts single defragmentation pass.
VkResult vmaBeginDefragmentation(VmaAllocator allocator, const VmaDefragmentationInfo *pInfo, VmaDefragmentationContext *pContext)
Begins defragmentation process.
VkResult vmaEndDefragmentationPass(VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo)
Ends single defragmentation pass.
-
@ VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT
Definition: vk_mem_alloc.h:703
-
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:1334
-
void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition: vk_mem_alloc.h:1381
+
@ VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT
Definition: vk_mem_alloc.h:709
+
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:1420
+
void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition: vk_mem_alloc.h:1467
An opaque object that represents started defragmentation process.
-
Parameters for defragmentation.
Definition: vk_mem_alloc.h:1397
-
VmaPool pool
Custom pool to be defragmented.
Definition: vk_mem_alloc.h:1404
-
VmaDefragmentationFlags flags
Use combination of VmaDefragmentationFlagBits.
Definition: vk_mem_alloc.h:1399
-
VmaAllocation srcAllocation
Allocation that should be moved.
Definition: vk_mem_alloc.h:1423
-
VmaAllocation dstTmpAllocation
Temporary allocation pointing to destination memory that will replace srcAllocation.
Definition: vk_mem_alloc.h:1430
-
Parameters for incremental defragmentation steps.
Definition: vk_mem_alloc.h:1438
-
uint32_t moveCount
Number of elements in the pMoves array.
Definition: vk_mem_alloc.h:1440
-
VmaDefragmentationMove * pMoves
Array of moves to be performed by the user in the current defragmentation pass.
Definition: vk_mem_alloc.h:1464
+
Parameters for defragmentation.
Definition: vk_mem_alloc.h:1483
+
VmaPool pool
Custom pool to be defragmented.
Definition: vk_mem_alloc.h:1490
+
VmaDefragmentationFlags flags
Use combination of VmaDefragmentationFlagBits.
Definition: vk_mem_alloc.h:1485
+
VmaAllocation srcAllocation
Allocation that should be moved.
Definition: vk_mem_alloc.h:1509
+
VmaAllocation dstTmpAllocation
Temporary allocation pointing to destination memory that will replace srcAllocation.
Definition: vk_mem_alloc.h:1516
+
Parameters for incremental defragmentation steps.
Definition: vk_mem_alloc.h:1524
+
uint32_t moveCount
Number of elements in the pMoves array.
Definition: vk_mem_alloc.h:1526
+
VmaDefragmentationMove * pMoves
Array of moves to be performed by the user in the current defragmentation pass.
Definition: vk_mem_alloc.h:1550

Although functions like vmaCreateBuffer(), vmaCreateImage(), vmaDestroyBuffer(), vmaDestroyImage() create/destroy an allocation and a buffer/image at once, these are just a shortcut for creating the resource, allocating memory, and binding them together. Defragmentation works on memory allocations only. You must handle the rest manually. Defragmentation is an iterative process that should repreat "passes" as long as related functions return VK_INCOMPLETE not VK_SUCCESS. In each pass:

  1. vmaBeginDefragmentationPass() function call: @@ -156,7 +164,7 @@ $(function() {

    - s -

    diff --git a/docs/html/functions_vars.html b/docs/html/functions_vars.html index 36ffb92..396cae3 100644 --- a/docs/html/functions_vars.html +++ b/docs/html/functions_vars.html @@ -72,9 +72,11 @@ $(function() {  

    - a -

    @@ -100,7 +105,7 @@ $(function() {

    - f -

    @@ -112,6 +117,7 @@ $(function() {

    - m -

    @@ -136,7 +144,7 @@ $(function() {
  2. pfnFree : VmaDeviceMemoryCallbacks
  3. pHeapSizeLimit : VmaAllocatorCreateInfo
  4. physicalDevice : VmaAllocatorCreateInfo, VmaAllocatorInfo
  5. -
  6. pMappedData : VmaAllocationInfo
  7. +
  8. pMappedData : VmaAllocationInfo, VmaBufferSuballocationInfo
  9. pMemoryAllocateNext : VmaPoolCreateInfo
  10. pMoves : VmaDefragmentationPassMoveInfo
  11. pName : VmaAllocationInfo
  12. @@ -145,7 +153,7 @@ $(function() {
  13. preferredLargeHeapBlockSize : VmaAllocatorCreateInfo
  14. priority : VmaAllocationCreateInfo, VmaPoolCreateInfo
  15. pTypeExternalMemoryHandleTypes : VmaAllocatorCreateInfo
  16. -
  17. pUserData : VmaAllocationCreateInfo, VmaAllocationInfo, VmaDeviceMemoryCallbacks, VmaVirtualAllocationCreateInfo, VmaVirtualAllocationInfo
  18. +
  19. pUserData : VmaAllocationCreateInfo, VmaAllocationInfo, VmaBufferSuballocationCreateInfo, VmaBufferSuballocationInfo, VmaDeviceMemoryCallbacks, VmaVirtualAllocationCreateInfo, VmaVirtualAllocationInfo
  20. pVulkanFunctions : VmaAllocatorCreateInfo
  21. @@ -156,7 +164,7 @@ $(function() {

    - s -

    diff --git a/docs/html/globals.html b/docs/html/globals.html index 5880f97..2f290e5 100644 --- a/docs/html/globals.html +++ b/docs/html/globals.html @@ -75,170 +75,6 @@ $(function() {
  22. PFN_vmaAllocateDeviceMemoryFunction : vk_mem_alloc.h
  23. PFN_vmaFreeDeviceMemoryFunction : vk_mem_alloc.h
  24. - - -

    - v -