From 0790b5f0a9b96cd79fe75e4f458fc6b468dd9ec3 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Mon, 21 Jun 2021 14:55:01 +0200 Subject: [PATCH] Regenerated documentation Used new Doxygen 1.9.1 --- docs/html/allocation_annotation.html | 32 +- docs/html/annotated.html | 8 +- docs/html/choosing_memory_type.html | 28 +- docs/html/classes.html | 47 +- docs/html/configuration.html | 8 +- docs/html/custom_memory_pools.html | 38 +- docs/html/debugging_memory_usage.html | 8 +- docs/html/defragmentation.html | 52 +- docs/html/deprecated.html | 16 +- .../dir_d44c64559bbebec7f509842c48db8b23.html | 84 + docs/html/doxygen.css | 117 +- docs/html/enabling_buffer_device_address.html | 8 +- docs/html/files.html | 13 +- docs/html/functions.html | 18 +- docs/html/functions_vars.html | 18 +- docs/html/general_considerations.html | 13 +- docs/html/globals.html | 17 +- docs/html/globals_defs.html | 11 +- docs/html/globals_enum.html | 8 +- docs/html/globals_eval.html | 11 +- docs/html/globals_func.html | 11 +- docs/html/globals_type.html | 8 +- docs/html/index.html | 12 +- docs/html/lost_allocations.html | 28 +- docs/html/memory_mapping.html | 41 +- docs/html/pages.html | 8 +- docs/html/quick_start.html | 47 +- docs/html/record_and_replay.html | 10 +- docs/html/resource_aliasing.html | 24 +- docs/html/search/all_0.html | 13 +- docs/html/search/all_1.html | 13 +- docs/html/search/all_10.html | 13 +- docs/html/search/all_10.js | 16 +- docs/html/search/all_11.html | 13 +- docs/html/search/all_11.js | 309 +- docs/html/search/all_2.html | 13 +- docs/html/search/all_3.html | 13 +- docs/html/search/all_4.html | 13 +- docs/html/search/all_5.html | 13 +- docs/html/search/all_6.html | 13 +- docs/html/search/all_7.html | 13 +- docs/html/search/all_8.html | 13 +- docs/html/search/all_9.html | 13 +- docs/html/search/all_9.js | 5 +- docs/html/search/all_a.html | 13 +- docs/html/search/all_a.js | 2 +- docs/html/search/all_b.html | 13 +- docs/html/search/all_b.js | 44 +- docs/html/search/all_c.html | 13 +- docs/html/search/all_c.js | 2 +- docs/html/search/all_d.html | 13 +- docs/html/search/all_d.js | 8 +- docs/html/search/all_e.html | 13 +- docs/html/search/all_e.js | 6 +- docs/html/search/all_f.html | 13 +- docs/html/search/all_f.js | 2 +- docs/html/search/classes_0.html | 13 +- docs/html/search/classes_0.js | 42 +- docs/html/search/defines_0.html | 13 +- docs/html/search/defines_0.js | 15 +- docs/html/search/enums_0.html | 13 +- docs/html/search/enums_0.js | 12 +- docs/html/search/enumvalues_0.html | 13 +- docs/html/search/enumvalues_0.js | 83 +- docs/html/search/files_0.html | 13 +- docs/html/search/files_0.js | 2 +- docs/html/search/functions_0.html | 13 +- docs/html/search/functions_0.js | 103 +- docs/html/search/nomatches.html | 3 +- docs/html/search/pages_0.html | 13 +- docs/html/search/pages_0.js | 2 +- docs/html/search/pages_1.html | 13 +- docs/html/search/pages_1.js | 6 +- docs/html/search/pages_2.html | 13 +- docs/html/search/pages_2.js | 6 +- docs/html/search/pages_3.html | 13 +- docs/html/search/pages_3.js | 2 +- docs/html/search/pages_4.html | 13 +- docs/html/search/pages_4.js | 2 +- docs/html/search/pages_5.html | 13 +- docs/html/search/pages_5.js | 2 +- docs/html/search/pages_6.html | 13 +- docs/html/search/pages_6.js | 2 +- docs/html/search/pages_7.html | 13 +- docs/html/search/pages_7.js | 2 +- docs/html/search/pages_8.html | 13 +- docs/html/search/pages_8.js | 6 +- docs/html/search/pages_9.html | 13 +- docs/html/search/pages_9.js | 4 +- docs/html/search/pages_a.html | 13 +- docs/html/search/pages_a.js | 6 +- docs/html/search/search.css | 4 +- docs/html/search/search.js | 12 +- docs/html/search/typedefs_0.html | 13 +- docs/html/search/typedefs_0.js | 4 +- docs/html/search/typedefs_1.html | 13 +- docs/html/search/typedefs_1.js | 56 +- docs/html/search/variables_0.html | 13 +- docs/html/search/variables_0.js | 14 +- docs/html/search/variables_1.html | 13 +- docs/html/search/variables_1.js | 12 +- docs/html/search/variables_2.html | 13 +- docs/html/search/variables_2.js | 2 +- docs/html/search/variables_3.html | 13 +- docs/html/search/variables_3.js | 6 +- docs/html/search/variables_4.html | 13 +- docs/html/search/variables_4.js | 4 +- docs/html/search/variables_5.html | 13 +- docs/html/search/variables_5.js | 2 +- docs/html/search/variables_6.html | 13 +- docs/html/search/variables_6.js | 29 +- docs/html/search/variables_7.html | 13 +- docs/html/search/variables_7.js | 2 +- docs/html/search/variables_8.html | 13 +- docs/html/search/variables_8.js | 40 +- docs/html/search/variables_9.html | 13 +- docs/html/search/variables_9.js | 2 +- docs/html/search/variables_a.html | 13 +- docs/html/search/variables_a.js | 2 +- docs/html/search/variables_b.html | 13 +- docs/html/search/variables_b.js | 2 +- docs/html/search/variables_c.html | 13 +- docs/html/search/variables_c.js | 16 +- docs/html/search/variables_d.html | 13 +- docs/html/search/variables_d.js | 36 +- docs/html/statistics.html | 8 +- docs/html/staying_within_budget.html | 8 +- docs/html/struct_vma_allocation.html | 10 +- ...ct_vma_allocation_create_info-members.html | 15 +- .../struct_vma_allocation_create_info.html | 30 +- .../struct_vma_allocation_info-members.html | 8 +- docs/html/struct_vma_allocation_info.html | 15 +- docs/html/struct_vma_allocator.html | 10 +- ...uct_vma_allocator_create_info-members.html | 8 +- .../struct_vma_allocator_create_info.html | 12 +- .../struct_vma_allocator_info-members.html | 8 +- docs/html/struct_vma_allocator_info.html | 10 +- docs/html/struct_vma_budget-members.html | 8 +- docs/html/struct_vma_budget.html | 10 +- .../struct_vma_defragmentation_context.html | 10 +- ...ruct_vma_defragmentation_info-members.html | 8 +- .../html/struct_vma_defragmentation_info.html | 12 +- ...uct_vma_defragmentation_info2-members.html | 8 +- .../struct_vma_defragmentation_info2.html | 10 +- ...vma_defragmentation_pass_info-members.html | 8 +- .../struct_vma_defragmentation_pass_info.html | 10 +- ...efragmentation_pass_move_info-members.html | 8 +- ...ct_vma_defragmentation_pass_move_info.html | 10 +- ...uct_vma_defragmentation_stats-members.html | 8 +- .../struct_vma_defragmentation_stats.html | 10 +- ...t_vma_device_memory_callbacks-members.html | 8 +- .../struct_vma_device_memory_callbacks.html | 10 +- docs/html/struct_vma_pool.html | 10 +- .../struct_vma_pool_create_info-members.html | 13 +- docs/html/struct_vma_pool_create_info.html | 71 +- docs/html/struct_vma_pool_stats-members.html | 8 +- docs/html/struct_vma_pool_stats.html | 10 +- .../struct_vma_record_settings-members.html | 8 +- docs/html/struct_vma_record_settings.html | 10 +- docs/html/struct_vma_stat_info-members.html | 8 +- docs/html/struct_vma_stat_info.html | 10 +- docs/html/struct_vma_stats-members.html | 8 +- docs/html/struct_vma_stats.html | 10 +- .../struct_vma_vulkan_functions-members.html | 8 +- docs/html/struct_vma_vulkan_functions.html | 10 +- docs/html/usage_patterns.html | 10 +- docs/html/vk__mem__alloc_8h.html | 185 +- docs/html/vk__mem__alloc_8h_source.html | 32018 ++++++++-------- docs/html/vk_amd_device_coherent_memory.html | 8 +- docs/html/vk_khr_dedicated_allocation.html | 19 +- include/vk_mem_alloc.h | 2 +- 171 files changed, 17849 insertions(+), 17203 deletions(-) create mode 100644 docs/html/dir_d44c64559bbebec7f509842c48db8b23.html diff --git a/docs/html/allocation_annotation.html b/docs/html/allocation_annotation.html index cf72ea1..ca4a557 100644 --- a/docs/html/allocation_annotation.html +++ b/docs/html/allocation_annotation.html @@ -3,7 +3,7 @@ - + Vulkan Memory Allocator: Allocation names and user data @@ -29,10 +29,10 @@ - + @@ -84,10 +84,19 @@ Allocation user data
VkBuffer buffer;
VmaAllocation allocation;
vmaCreateBuffer(allocator, &bufferInfo, &allocCreateInfo, &buffer, &allocation, nullptr);
+
Definition: vk_mem_alloc.h:2879
+
void * pUserData
Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo...
Definition: vk_mem_alloc.h:2918
+
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:2887
+
Represents single memory allocation.
+
@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:2721
+
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)

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

vmaGetAllocationInfo(allocator, allocation, &allocInfo);
MyBufferMetadata* pMetadata = (MyBufferMetadata*)allocInfo.pUserData;
+
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:3246
+
void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition: vk_mem_alloc.h:3295
+
void vmaGetAllocationInfo(VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)
Returns current information about specified allocation and atomically marks it as used in current fra...

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.

@@ -107,6 +116,9 @@ Allocation names

VkImage image;
VmaAllocation allocation;
vmaCreateImage(allocator, &imageInfo, &allocCreateInfo, &image, &allocation, nullptr);
+
VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:2881
+
VkResult vmaCreateImage(VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
Function similar to vmaCreateBuffer().
+
@ VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT
Definition: vk_mem_alloc.h:2824

The value of pUserData pointer of the allocation will be different than the one you passed when setting allocation's name - pointing to a buffer managed internally that holds copy of the string.

vmaGetAllocationInfo(allocator, allocation, &allocInfo);
@@ -116,21 +128,9 @@ Allocation names
Note
Passing string name to VMA allocation doesn't automatically set it to the Vulkan buffer or image created with it. You must do it manually using an extension like VK_EXT_debug_utils, which is independent of this library.
-
@ VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT
Definition: vk_mem_alloc.h:2781
-
void * pUserData
Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo...
Definition: vk_mem_alloc.h:2875
-
void vmaGetAllocationInfo(VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)
Returns current information about specified allocation and atomically marks it as used in current fra...
-
Represents single memory allocation.
-
@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:2678
-
VkResult vmaCreateImage(VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
Function similar to vmaCreateBuffer().
-
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:2844
-
void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition: vk_mem_alloc.h:3217
-
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
-
VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:2838
-
Definition: vk_mem_alloc.h:2836
-
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:3173
diff --git a/docs/html/annotated.html b/docs/html/annotated.html index 4725674..5d50e51 100644 --- a/docs/html/annotated.html +++ b/docs/html/annotated.html @@ -3,7 +3,7 @@ - + Vulkan Memory Allocator: Class List @@ -29,10 +29,10 @@ - + @@ -93,7 +93,7 @@ $(function() { diff --git a/docs/html/choosing_memory_type.html b/docs/html/choosing_memory_type.html index 63ebe12..db95c57 100644 --- a/docs/html/choosing_memory_type.html +++ b/docs/html/choosing_memory_type.html @@ -3,7 +3,7 @@ - + Vulkan Memory Allocator: Choosing memory type @@ -29,10 +29,10 @@ - + @@ -93,6 +93,11 @@ Usage
VkBuffer buffer;
VmaAllocation allocation;
vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
+
Definition: vk_mem_alloc.h:2879
+
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:2887
+
Represents single memory allocation.
+
@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:2721
+
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)

Required and preferred flags

You can specify more detailed requirements by filling members VmaAllocationCreateInfo::requiredFlags and VmaAllocationCreateInfo::preferredFlags with a combination of bits from enum VkMemoryPropertyFlags. For example, if you want to create a buffer that will be persistently mapped on host (so it must be HOST_VISIBLE) and preferably will also be HOST_COHERENT and HOST_CACHED, use following code:

@@ -104,6 +109,10 @@ Required and preferred flags
VkBuffer buffer;
VmaAllocation allocation;
vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
+
VkMemoryPropertyFlags preferredFlags
Flags that preferably should be set in a memory type chosen for an allocation.
Definition: vk_mem_alloc.h:2897
+
VkMemoryPropertyFlags requiredFlags
Flags that must be set in a Memory Type chosen for an allocation.
Definition: vk_mem_alloc.h:2892
+
VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:2881
+
@ 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:2798

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

If you use VmaAllocationCreateInfo::usage, it is just internally converted to a set of required and preferred flags.

@@ -118,6 +127,7 @@ Explicit memory types

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

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.

@@ -131,19 +141,9 @@ Dedicated allocations -
Represents single memory allocation.
-
@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:2678
-
VkMemoryPropertyFlags requiredFlags
Flags that must be set in a Memory Type chosen for an allocation.
Definition: vk_mem_alloc.h:2849
-
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:2844
-
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
-
@ 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:2755
-
VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:2838
-
Definition: vk_mem_alloc.h:2836
-
VkMemoryPropertyFlags preferredFlags
Flags that preferably should be set in a memory type chosen for an allocation.
Definition: vk_mem_alloc.h:2854
-
uint32_t memoryTypeBits
Bitmask containing one bit set for every memory type acceptable for this allocation.
Definition: vk_mem_alloc.h:2862
diff --git a/docs/html/classes.html b/docs/html/classes.html index 64fc825..e63f3fa 100644 --- a/docs/html/classes.html +++ b/docs/html/classes.html @@ -3,7 +3,7 @@ - + Vulkan Memory Allocator: Class Index @@ -29,10 +29,10 @@ - + @@ -65,43 +65,16 @@ $(function() {
Class Index
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  v  
-
VmaAllocator   VmaDefragmentationInfo   VmaDeviceMemoryCallbacks   VmaStatInfo   
VmaAllocatorCreateInfo   VmaDefragmentationInfo2   VmaPool   VmaStats   
VmaAllocation   VmaAllocatorInfo   VmaDefragmentationPassInfo   VmaPoolCreateInfo   VmaVulkanFunctions   
VmaAllocationCreateInfo   VmaBudget   VmaDefragmentationPassMoveInfo   VmaPoolStats   
VmaAllocationInfo   VmaDefragmentationContext   VmaDefragmentationStats   VmaRecordSettings   
- + +
diff --git a/docs/html/configuration.html b/docs/html/configuration.html index 721d735..555858a 100644 --- a/docs/html/configuration.html +++ b/docs/html/configuration.html @@ -3,7 +3,7 @@ - + Vulkan Memory Allocator: Configuration @@ -29,10 +29,10 @@ - + @@ -95,7 +95,7 @@ Device heap memory limit diff --git a/docs/html/custom_memory_pools.html b/docs/html/custom_memory_pools.html index 1e30c39..ef50582 100644 --- a/docs/html/custom_memory_pools.html +++ b/docs/html/custom_memory_pools.html @@ -3,7 +3,7 @@ - + Vulkan Memory Allocator: Custom memory pools @@ -29,10 +29,10 @@ - + @@ -105,9 +105,21 @@ $(function() {
VmaAllocation alloc;
VmaAllocationInfo allocInfo;
vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);
+
Definition: vk_mem_alloc.h:2879
+
VmaPool pool
Pool that this allocation should be created in.
Definition: vk_mem_alloc.h:2911
+
Represents single memory allocation.
+
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:3246
+
Describes parameter of created VmaPool.
Definition: vk_mem_alloc.h:3047
+
uint32_t memoryTypeIndex
Vulkan memory type index to allocate this pool from.
Definition: vk_mem_alloc.h:3050
+
size_t maxBlockCount
Maximum number of blocks that can be allocated in this pool. Optional.
Definition: vk_mem_alloc.h:3075
+
Represents custom memory pool.
+
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)

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

vmaDestroyBuffer(allocator, buf, alloc);
vmaDestroyPool(allocator, pool);
+
void vmaDestroyBuffer(VmaAllocator allocator, VkBuffer buffer, VmaAllocation allocation)
Destroys Vulkan buffer and frees allocated memory.
+
void vmaDestroyPool(VmaAllocator allocator, VmaPool pool)
Destroys VmaPool object and frees Vulkan device memory.

Choosing memory type index

When creating a pool, you must explicitly specify memory type index. To find the one suitable for your buffers or images, you can use helper functions vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo(). You need to provide structures with example parameters of buffers or images that you are going to create in that pool.

@@ -124,6 +136,9 @@ Choosing memory type index
VmaPoolCreateInfo poolCreateInfo = {};
poolCreateInfo.memoryTypeIndex = memTypeIndex;
// ...
+
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:2887
+
@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:2721
+
VkResult vmaFindMemoryTypeIndexForBufferInfo(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.

When creating buffers/images allocated in that pool, provide following parameters:

-
uint32_t memoryTypeIndex
Vulkan memory type index to allocate this pool from.
Definition: vk_mem_alloc.h:3000
-
VmaPool pool
Pool that this allocation should be created in.
Definition: vk_mem_alloc.h:2868
-
void vmaDestroyPool(VmaAllocator allocator, VmaPool pool)
Destroys VmaPool object and frees Vulkan device memory.
-
Represents single memory allocation.
-
@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:2678
-
VkResult vmaCreatePool(VmaAllocator allocator, const VmaPoolCreateInfo *pCreateInfo, VmaPool *pPool)
Allocates Vulkan device memory and creates VmaPool object.
-
size_t maxBlockCount
Maximum number of blocks that can be allocated in this pool. Optional.
Definition: vk_mem_alloc.h:3025
-
Describes parameter of created VmaPool.
Definition: vk_mem_alloc.h:2997
-
Represents custom memory pool.
-
VkResult vmaFindMemoryTypeIndexForBufferInfo(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
-
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:2844
-
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
-
void vmaDestroyBuffer(VmaAllocator allocator, VkBuffer buffer, VmaAllocation allocation)
Destroys Vulkan buffer and frees allocated memory.
-
Definition: vk_mem_alloc.h:2836
-
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:3173
diff --git a/docs/html/debugging_memory_usage.html b/docs/html/debugging_memory_usage.html index 7ab422d..ce21667 100644 --- a/docs/html/debugging_memory_usage.html +++ b/docs/html/debugging_memory_usage.html @@ -3,7 +3,7 @@ - + Vulkan Memory Allocator: Debugging incorrect memory usage @@ -29,10 +29,10 @@ - + @@ -106,7 +106,7 @@ Corruption detection diff --git a/docs/html/defragmentation.html b/docs/html/defragmentation.html index 3ea8256..1320787 100644 --- a/docs/html/defragmentation.html +++ b/docs/html/defragmentation.html @@ -3,7 +3,7 @@ - + Vulkan Memory Allocator: Defragmentation @@ -29,10 +29,10 @@ - + @@ -73,7 +73,7 @@ $(function() {

To mitigate this problem, you can use defragmentation feature: structure VmaDefragmentationInfo2, function vmaDefragmentationBegin(), vmaDefragmentationEnd(). Given set of allocations, this function can move them to compact used memory, ensure more continuous free space and possibly also free some VkDeviceMemory blocks.

What the defragmentation does is:

What it doesn't do, so you need to do it yourself:

@@ -120,15 +120,28 @@ Defragmenting CPU memory
// Create new buffer with same parameters.
VkBufferCreateInfo bufferInfo = ...;
vkCreateBuffer(device, &bufferInfo, nullptr, &buffers[i]);
-
+
// You can make dummy call to vkGetBufferMemoryRequirements here to silence validation layer warning.
-
+
// Bind new buffer to new memory region. Data contained in it is already moved.
VmaAllocationInfo allocInfo;
vmaGetAllocationInfo(allocator, allocations[i], &allocInfo);
vmaBindBufferMemory(allocator, allocations[i], buffers[i]);
}
}
+
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:3246
+
Represents main object of this library initialized.
+
Represents Opaque object that represents started defragmentation process.
+
Parameters for defragmentation.
Definition: vk_mem_alloc.h:3645
+
uint32_t allocationCount
Number of allocations in pAllocations array.
Definition: vk_mem_alloc.h:3651
+
VkBool32 * pAllocationsChanged
Optional, output. Pointer to array that will be filled with information whether the allocation at cer...
Definition: vk_mem_alloc.h:3666
+
uint32_t maxCpuAllocationsToMove
Maximum number of allocations that can be moved to a different place using transfers on CPU side,...
Definition: vk_mem_alloc.h:3695
+
const VmaAllocation * pAllocations
Pointer to array of allocations that can be defragmented.
Definition: vk_mem_alloc.h:3660
+
VkDeviceSize maxCpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:3690
+
VkResult vmaDefragmentationBegin(VmaAllocator allocator, const VmaDefragmentationInfo2 *pInfo, VmaDefragmentationStats *pStats, VmaDefragmentationContext *pContext)
Begins defragmentation process.
+
VkResult vmaBindBufferMemory(VmaAllocator allocator, VmaAllocation allocation, VkBuffer buffer)
Binds buffer to allocation.
+
void vmaGetAllocationInfo(VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)
Returns current information about specified allocation and atomically marks it as used in current fra...
+
VkResult vmaDefragmentationEnd(VmaAllocator allocator, VmaDefragmentationContext context)
Ends defragmentation process.

Setting VmaDefragmentationInfo2::pAllocationsChanged is optional. This output array tells whether particular allocation in VmaDefragmentationInfo2::pAllocations at the same index has been modified during defragmentation. You can pass null, but you then need to query every allocation passed to defragmentation for new parameters using vmaGetAllocationInfo() if you might need to recreate and rebind a buffer or image associated with it.

If you use Custom memory pools, you can fill VmaDefragmentationInfo2::poolCount and VmaDefragmentationInfo2::pPools instead of VmaDefragmentationInfo2::allocationCount and VmaDefragmentationInfo2::pAllocations to defragment all allocations in given pools. You cannot use VmaDefragmentationInfo2::pAllocationsChanged in that case. You can also combine both methods.

@@ -181,15 +194,18 @@ Defragmenting GPU memory

// Create new buffer with same parameters.
VkBufferCreateInfo bufferInfo = ...;
vkCreateBuffer(device, &bufferInfo, nullptr, &buffers[i]);
-
+
// You can make dummy call to vkGetBufferMemoryRequirements here to silence validation layer warning.
-
+
// Bind new buffer to new memory region. Data contained in it is already moved.
VmaAllocationInfo allocInfo;
vmaGetAllocationInfo(allocator, allocations[i], &allocInfo);
vmaBindBufferMemory(allocator, allocations[i], buffers[i]);
}
}
+
uint32_t maxGpuAllocationsToMove
Maximum number of allocations that can be moved to a different place using transfers on GPU side,...
Definition: vk_mem_alloc.h:3705
+
VkDeviceSize maxGpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:3700
+
VkCommandBuffer commandBuffer
Optional. Command buffer where GPU copy commands will be posted.
Definition: vk_mem_alloc.h:3714

You can combine these two methods by specifying non-zero maxGpu* as well as maxCpu* parameters. The library automatically chooses best method to defragment each memory pool.

You may try not to block your entire program to wait until defragmentation finishes, but do it in the background, as long as you carefully fullfill requirements described in function vmaDefragmentationBegin().

@@ -202,7 +218,7 @@ Additional notes

Defragmentation of images created with VK_IMAGE_TILING_OPTIMAL or in any other layout may give undefined results.

If you defragment allocations bound to images, new images to be bound to new memory region after defragmentation should be created with VK_IMAGE_LAYOUT_PREINITIALIZED and then transitioned to their original layout from before defragmentation if needed using an image memory barrier.

While using defragmentation, you may experience validation layer warnings, which you just need to ignore. See Validation layer warnings.

-

Please don't expect memory to be fully compacted after defragmentation. Algorithms inside are based on some heuristics that try to maximize number of Vulkan memory blocks to make totally empty to release them, as well as to maximimze continuous empty space inside remaining blocks, while minimizing the number and size of allocations that need to be moved. Some fragmentation may still remain - this is normal.

+

Please don't expect memory to be fully compacted after defragmentation. Algorithms inside are based on some heuristics that try to maximize number of Vulkan memory blocks to make totally empty to release them, as well as to maximize continuous empty space inside remaining blocks, while minimizing the number and size of allocations that need to be moved. Some fragmentation may still remain - this is normal.

Writing custom defragmentation algorithm

If you want to implement your own, custom defragmentation algorithm, there is infrastructure prepared for that, but it is not exposed through the library API - you need to hack its source code. Here are steps needed to do this:

@@ -214,25 +230,9 @@ Writing custom defragmentation algorithm -
uint32_t allocationCount
Number of allocations in pAllocations array.
Definition: vk_mem_alloc.h:3585
-
Represents main object of this library initialized.
-
void vmaGetAllocationInfo(VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)
Returns current information about specified allocation and atomically marks it as used in current fra...
-
VkResult vmaDefragmentationEnd(VmaAllocator allocator, VmaDefragmentationContext context)
Ends defragmentation process.
-
VkDeviceSize maxGpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:3634
-
VkCommandBuffer commandBuffer
Optional. Command buffer where GPU copy commands will be posted.
Definition: vk_mem_alloc.h:3648
-
Parameters for defragmentation.
Definition: vk_mem_alloc.h:3579
-
VkResult vmaBindBufferMemory(VmaAllocator allocator, VmaAllocation allocation, VkBuffer buffer)
Binds buffer to allocation.
-
const VmaAllocation * pAllocations
Pointer to array of allocations that can be defragmented.
Definition: vk_mem_alloc.h:3594
-
uint32_t maxGpuAllocationsToMove
Maximum number of allocations that can be moved to a different place using transfers on GPU side,...
Definition: vk_mem_alloc.h:3639
-
VkDeviceSize maxCpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:3624
-
VkResult vmaDefragmentationBegin(VmaAllocator allocator, const VmaDefragmentationInfo2 *pInfo, VmaDefragmentationStats *pStats, VmaDefragmentationContext *pContext)
Begins defragmentation process.
-
VkBool32 * pAllocationsChanged
Optional, output. Pointer to array that will be filled with information whether the allocation at cer...
Definition: vk_mem_alloc.h:3600
-
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:3173
-
Represents Opaque object that represents started defragmentation process.
-
uint32_t maxCpuAllocationsToMove
Maximum number of allocations that can be moved to a different place using transfers on CPU side,...
Definition: vk_mem_alloc.h:3629
diff --git a/docs/html/deprecated.html b/docs/html/deprecated.html index 0bf54e0..033bb68 100644 --- a/docs/html/deprecated.html +++ b/docs/html/deprecated.html @@ -3,7 +3,7 @@ - + Vulkan Memory Allocator: Deprecated List @@ -29,10 +29,10 @@ - + @@ -66,18 +66,16 @@ $(function() {
-
Member vmaResizeAllocation (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize newSize)
-
In version 2.2.0 it used to try to change allocation's size without moving or reallocating it. In current version it returns VK_SUCCESS only if newSize equals current allocation's size. Otherwise returns VK_ERROR_OUT_OF_POOL_MEMORY, indicating that allocation's size could not be changed.
-
Member VmaDefragmentationInfo
-
This is a part of the old interface. It is recommended to use structure VmaDefragmentationInfo2 and function vmaDefragmentationBegin() instead.
Member vmaDefragment (VmaAllocator allocator, const VmaAllocation *pAllocations, size_t allocationCount, VkBool32 *pAllocationsChanged, const VmaDefragmentationInfo *pDefragmentationInfo, VmaDefragmentationStats *pDefragmentationStats)
-
This is a part of the old interface. It is recommended to use structure VmaDefragmentationInfo2 and function vmaDefragmentationBegin() instead.
+
This is a part of the old interface. It is recommended to use structure VmaDefragmentationInfo2 and function vmaDefragmentationBegin() instead.
+
Member VmaDefragmentationInfo
+
This is a part of the old interface. It is recommended to use structure VmaDefragmentationInfo2 and function vmaDefragmentationBegin() instead.
diff --git a/docs/html/dir_d44c64559bbebec7f509842c48db8b23.html b/docs/html/dir_d44c64559bbebec7f509842c48db8b23.html new file mode 100644 index 0000000..32f53c1 --- /dev/null +++ b/docs/html/dir_d44c64559bbebec7f509842c48db8b23.html @@ -0,0 +1,84 @@ + + + + + + + +Vulkan Memory Allocator: include Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
Vulkan Memory Allocator +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
include Directory Reference
+
+
+ + + + +

+Files

file  vk_mem_alloc.h [code]
 
+
+ + + + diff --git a/docs/html/doxygen.css b/docs/html/doxygen.css index f640966..ffbff02 100644 --- a/docs/html/doxygen.css +++ b/docs/html/doxygen.css @@ -1,4 +1,4 @@ -/* The standard CSS for doxygen 1.8.20 */ +/* The standard CSS for doxygen 1.9.1 */ body, table, div, p, dl { font: 400 14px/22px Roboto,sans-serif; @@ -103,30 +103,96 @@ caption { } span.legend { - font-size: 70%; - text-align: center; -} - -h3.version { - font-size: 90%; - text-align: center; -} - -div.qindex, div.navtab{ - background-color: #EBEFF6; - border: 1px solid #A3B4D7; + font-size: 70%; text-align: center; } -div.qindex, div.navpath { - width: 100%; - line-height: 140%; +h3.version { + font-size: 90%; + text-align: center; } div.navtab { - margin-right: 15px; + border-right: 1px solid #A3B4D7; + padding-right: 15px; + text-align: right; + line-height: 110%; } +div.navtab table { + border-spacing: 0; +} + +td.navtab { + padding-right: 6px; + padding-left: 6px; +} +td.navtabHL { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL a, td.navtabHL a:visited { + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} + +a.navtab { + font-weight: bold; +} + +div.qindex{ + text-align: center; + width: 100%; + line-height: 140%; + font-size: 130%; + color: #A0A0A0; +} + +dt.alphachar{ + font-size: 180%; + font-weight: bold; +} + +.alphachar a{ + color: black; +} + +.alphachar a:hover, .alphachar a:visited{ + text-decoration: none; +} + +.classindex dl { + padding: 25px; + column-count:1 +} + +.classindex dd { + display:inline-block; + margin-left: 50px; + width: 90%; + line-height: 1.15em; +} + +.classindex dl.odd { + background-color: #F8F9FC; +} + +@media(min-width: 1120px) { + .classindex dl { + column-count:2 + } +} + +@media(min-width: 1320px) { + .classindex dl { + column-count:3 + } +} + + /* @group Link Styling */ a { @@ -143,17 +209,6 @@ a:hover { text-decoration: underline; } -a.qindex { - font-weight: bold; -} - -a.qindexHL { - font-weight: bold; - background-color: #9CAFD4; - color: #FFFFFF; - border: 1px double #869DCA; -} - .contents a.qindexHL:visited { color: #FFFFFF; } @@ -1426,6 +1481,12 @@ div.toc li.level4 { margin-left: 45px; } +span.emoji { + /* font family used at the site: https://unicode.org/emoji/charts/full-emoji-list.html + * font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort; + */ +} + .PageDocRTL-title div.toc li.level1 { margin-left: 0 !important; margin-right: 0; diff --git a/docs/html/enabling_buffer_device_address.html b/docs/html/enabling_buffer_device_address.html index 1619eb6..d02eb88 100644 --- a/docs/html/enabling_buffer_device_address.html +++ b/docs/html/enabling_buffer_device_address.html @@ -3,7 +3,7 @@ - + Vulkan Memory Allocator: Enabling buffer device address @@ -29,10 +29,10 @@ - + @@ -90,7 +90,7 @@ More information diff --git a/docs/html/files.html b/docs/html/files.html index 3ad6e89..2037f34 100644 --- a/docs/html/files.html +++ b/docs/html/files.html @@ -3,7 +3,7 @@ - + Vulkan Memory Allocator: File List @@ -29,10 +29,10 @@ - + @@ -66,14 +66,15 @@ $(function() {
Here is a list of all files with brief descriptions:
- - +
[detail level 12]
 vk_mem_alloc.h
+ +
  include
 vk_mem_alloc.h
diff --git a/docs/html/functions.html b/docs/html/functions.html index d4499bb..40453da 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -3,7 +3,7 @@ - + Vulkan Memory Allocator: Class Members @@ -29,10 +29,10 @@ - + @@ -195,6 +195,9 @@ $(function() {
  • memoryTypeIndex : VmaPoolCreateInfo
  • +
  • minAllocationAlignment +: VmaPoolCreateInfo +
  • minBlockCount : VmaPoolCreateInfo
  • @@ -244,6 +247,9 @@ $(function() {
  • pMappedData : VmaAllocationInfo
  • +
  • pMemoryAllocateNext +: VmaPoolCreateInfo +
  • pMoves : VmaDefragmentationPassInfo
  • @@ -265,6 +271,10 @@ $(function() {
  • preferredLargeHeapBlockSize : VmaAllocatorCreateInfo
  • +
  • priority +: VmaAllocationCreateInfo +, VmaPoolCreateInfo +
  • pUserData : VmaAllocationCreateInfo , VmaAllocationInfo @@ -388,7 +398,7 @@ $(function() { diff --git a/docs/html/functions_vars.html b/docs/html/functions_vars.html index bd2646e..36607ac 100644 --- a/docs/html/functions_vars.html +++ b/docs/html/functions_vars.html @@ -3,7 +3,7 @@ - + Vulkan Memory Allocator: Class Members - Variables @@ -29,10 +29,10 @@ - + @@ -195,6 +195,9 @@ $(function() {
  • memoryTypeIndex : VmaPoolCreateInfo
  • +
  • minAllocationAlignment +: VmaPoolCreateInfo +
  • minBlockCount : VmaPoolCreateInfo
  • @@ -244,6 +247,9 @@ $(function() {
  • pMappedData : VmaAllocationInfo
  • +
  • pMemoryAllocateNext +: VmaPoolCreateInfo +
  • pMoves : VmaDefragmentationPassInfo
  • @@ -265,6 +271,10 @@ $(function() {
  • preferredLargeHeapBlockSize : VmaAllocatorCreateInfo
  • +
  • priority +: VmaAllocationCreateInfo +, VmaPoolCreateInfo +
  • pUserData : VmaAllocationCreateInfo , VmaAllocationInfo @@ -388,7 +398,7 @@ $(function() { diff --git a/docs/html/general_considerations.html b/docs/html/general_considerations.html index f9e8e44..eba9e82 100644 --- a/docs/html/general_considerations.html +++ b/docs/html/general_considerations.html @@ -3,7 +3,7 @@ - + Vulkan Memory Allocator: General considerations @@ -29,10 +29,10 @@ - + @@ -90,7 +90,7 @@ Validation layer warnings
  • Non-linear image 0xebc91 is aliased with linear buffer 0xeb8e4 which may indicate a bug.
  • @@ -111,8 +111,9 @@ Allocation algorithm Features not supported

    Features deliberately excluded from the scope of this library: