diff --git a/.gitignore b/.gitignore index f56901a..35324aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,3 @@ /bin/* - /build/* -!/build/src/ -/build/src/* -!/build/src/Release/ -/build/src/Release/* -!/build/src/Release/VmaSample.exe -!/build/src/VmaReplay/ -/build/src/VmaReplay/* -!/build/src/VmaReplay/Release/ -/build/src/VmaReplay/Release/* -!/build/src/VmaReplay/Release/VmaReplay.exe +!/bin/VmaSample_Release_vs2019.exe diff --git a/CHANGELOG.md b/CHANGELOG.md index 218a98b..5d5498d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,53 @@ +# 3.0.0 (2022-03-25) + +It has been a long time since the previous official release, so hopefully everyone has been using the latest code from "master" branch, which is always maintained in a good state, not the old version. For completeness, here is the list of changes since v2.3.0. The major version number has changed, so there are some compatibility-breaking changes, but the basic API stays the same and is mostly backward-compatible. + +Major features added (some compatibility-breaking): + +- Added new API for selecting preferred memory type: flags `VMA_MEMORY_USAGE_AUTO`, `VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE`, `VMA_MEMORY_USAGE_AUTO_PREFER_HOST`, `VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT`, `VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT`, `VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT`. Old values like `VMA_MEMORY_USAGE_GPU_ONLY` still work as before, for backward compatibility, but are not recommended. +- Added new defragmentation API and algorithm, replacing the old one. See structure `VmaDefragmentationInfo`, `VmaDefragmentationMove`, `VmaDefragmentationPassMoveInfo`, `VmaDefragmentationStats`, function `vmaBeginDefragmentation`, `vmaEndDefragmentation`, `vmaBeginDefragmentationPass`, `vmaEndDefragmentationPass`. +- Redesigned API for statistics, replacing the old one. See structures: `VmaStatistics`, `VmaDetailedStatistics`, `VmaTotalStatistics`. `VmaBudget`, functions: `vmaGetHeapBudgets`, `vmaCalculateStatistics`, `vmaGetPoolStatistics`, `vmaCalculatePoolStatistics`, `vmaGetVirtualBlockStatistics`, `vmaCalculateVirtualBlockStatistics`. +- Added "Virtual allocator" feature - possibility to use core allocation algorithms for allocation of custom memory, not necessarily Vulkan device memory. See functions like `vmaCreateVirtualBlock`, `vmaDestroyVirtualBlock` and many more. +- `VmaAllocation` now keeps both `void* pUserData` and `char* pName`. Added function `vmaSetAllocationName`, member `VmaAllocationInfo::pName`. Flag `VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT` is now deprecated. +- Clarified and cleaned up various ways of importing Vulkan functions. See macros `VMA_STATIC_VULKAN_FUNCTIONS`, `VMA_DYNAMIC_VULKAN_FUNCTIONS`, structure `VmaVulkanFunctions`. Added members `VmaVulkanFunctions::vkGetInstanceProcAddr`, `vkGetDeviceProcAddr`, which are now required when using `VMA_DYNAMIC_VULKAN_FUNCTIONS`. + +Removed (compatibility-breaking): + +- Removed whole "lost allocations" feature. Removed from the interface: `VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT`, `VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT`, `vmaCreateLostAllocation`, `vmaMakePoolAllocationsLost`, `vmaTouchAllocation`, `VmaAllocatorCreateInfo::frameInUseCount`, `VmaPoolCreateInfo::frameInUseCount`. +- Removed whole "record & replay" feature. Removed from the API: `VmaAllocatorCreateInfo::pRecordSettings`, `VmaRecordSettings`, `VmaRecordFlagBits`, `VmaRecordFlags`. Removed VmaReplay application. +- Removed "buddy" algorithm - removed flag `VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT`. + +Minor but compatibility-breaking changes: + +- Changes in `ALLOCATION_CREATE_STRATEGY` flags. Removed flags: `VMA_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT`, `VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT`, `VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT`, which were aliases to other existing flags. +- Added a member `void* pUserData` to `VmaDeviceMemoryCallbacks`. Updated `PFN_vmaAllocateDeviceMemoryFunction`, `PFN_vmaFreeDeviceMemoryFunction` to use the new `pUserData` member. +- Removed function `vmaResizeAllocation` that was already deprecated. + +Other major changes: + +- Added new features to custom pools: support for dedicated allocations, new member `VmaPoolCreateInfo::pMemoryAllocateNext`, `minAllocationAlignment`. +- Added support for Vulkan 1.2, 1.3. +- Added support for VK_KHR_buffer_device_address extension - flag `VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT`. +- Added support for VK_EXT_memory_priority extension - flag `VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT`, members `VmaAllocationCreateInfo::priority`, `VmaPoolCreateInfo::priority`. +- Added support for VK_AMD_device_coherent_memory extension - flag `VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT`. +- Added member `VmaAllocatorCreateInfo::pTypeExternalMemoryHandleTypes`. +- Added function `vmaGetAllocatorInfo`, structure `VmaAllocatorInfo`. +- Added functions `vmaFlushAllocations`, `vmaInvalidateAllocations` for multiple allocations at once. +- Added flag `VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT`. +- Added function `vmaCreateBufferWithAlignment`. +- Added convenience function `vmaGetAllocationMemoryProperties`. +- Added convenience functions: `vmaCreateAliasingBuffer`, `vmaCreateAliasingImage`. + +Other minor changes: + +- Implemented Two-Level Segregated Fit (TLSF) allocation algorithm, replacing previous default one. It is much faster, especially when freeing many allocations at once or when `bufferImageGranularity` is large. +- Renamed debug macro `VMA_DEBUG_ALIGNMENT` to `VMA_MIN_ALIGNMENT`. +- Added CMake support - CMakeLists.txt files. Removed Premake support. +- Changed `vmaInvalidateAllocation` and `vmaFlushAllocation` to return `VkResult`. +- Added nullability annotations for Clang: `VMA_NULLABLE`, `VMA_NOT_NULL`, `VMA_NULLABLE_NON_DISPATCHABLE`, `VMA_NOT_NULL_NON_DISPATCHABLE`, `VMA_LEN_IF_NOT_NULL`. +- JSON dump format has changed. +- Countless fixes and improvements, including performance optimizations, compatibility with various platforms and compilers, documentation. + # 2.3.0 (2019-12-04) Major release after a year of development in "master" branch and feature branches. Notable new features: supporting Vulkan 1.1, supporting query for memory budget. diff --git a/bin/VmaSample_Release_vs2019.exe b/bin/VmaSample_Release_vs2019.exe new file mode 100644 index 0000000..c9a36e0 Binary files /dev/null and b/bin/VmaSample_Release_vs2019.exe differ diff --git a/build/src/Release/VmaSample.exe b/build/src/Release/VmaSample.exe deleted file mode 100644 index 8ec81f5..0000000 Binary files a/build/src/Release/VmaSample.exe and /dev/null differ diff --git a/docs/html/index.html b/docs/html/index.html index c5ce1d2..8d81d72 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -65,7 +65,7 @@ $(function() {
Vulkan Memory Allocator
-

Version 3.0.0-development

+

Version 3.0.0 (2022-03-25)

Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved.
License: MIT

API documentation divided into groups: Modules

diff --git a/docs/html/lost_allocations.html b/docs/html/lost_allocations.html deleted file mode 100644 index 38c75e9..0000000 --- a/docs/html/lost_allocations.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - -Vulkan Memory Allocator: Lost allocations - - - - - - - - - -
-
- - - - - - -
-
Vulkan Memory Allocator -
-
-
- - - - - - - - -
-
- - -
- -
- - -
-
-
Lost allocations
-
-
-

If your game oversubscribes video memory, if may work OK in previous-generation graphics APIs (DirectX 9, 10, 11, OpenGL) because resources are automatically paged to system RAM. In Vulkan you can't do it because when you run out of memory, an allocation just fails. If you have more data (e.g. textures) that can fit into VRAM and you don't need it all at once, you may want to upload them to GPU on demand and "push out" ones that are not used for a long time to make room for the new ones, effectively using VRAM (or a cartain memory pool) as a form of cache. Vulkan Memory Allocator can help you with that by supporting a concept of "lost allocations".

-

To create an allocation that can become lost, include VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag in VmaAllocationCreateInfo::flags. Before using a buffer or image bound to such allocation in every new frame, you need to query it if it is not lost. To check it, call vmaTouchAllocation(). If the allocation is lost, you should not use it or buffer/image bound to it. You mustn't forget to destroy this allocation and this buffer/image. vmaGetAllocationInfo() can also be used for checking status of the allocation. Allocation is lost when returned VmaAllocationInfo::deviceMemory == VK_NULL_HANDLE.

-

To create an allocation that can make some other allocations lost to make room for it, use VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flag. You will usually use both flags VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT and VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT at the same time.

-

Warning! Current implementation uses quite naive, brute force algorithm, which can make allocation calls that use VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flag quite slow. A new, more optimal algorithm and data structure to speed this up is planned for the future.

-

Q: When interleaving creation of new allocations with usage of existing ones, how do you make sure that an allocation won't become lost while it is used in the current frame?

-

It is ensured because vmaTouchAllocation() / vmaGetAllocationInfo() not only returns allocation status/parameters and checks whether it is not lost, but when it is not, it also atomically marks it as used in the current frame, which makes it impossible to become lost in that frame. It uses lockless algorithm, so it works fast and doesn't involve locking any internal mutex.

-

Q: What if my allocation may still be in use by the GPU when it is rendering a previous frame while I already submit new frame on the CPU?

-

You can make sure that allocations "touched" by vmaTouchAllocation() / vmaGetAllocationInfo() will not become lost for a number of additional frames back from the current one by specifying this number as VmaAllocatorCreateInfo::frameInUseCount (for default memory pool) and VmaPoolCreateInfo::frameInUseCount (for custom pool).

-

Q: How do you inform the library when new frame starts?

-

You need to call function vmaSetCurrentFrameIndex().

-

Example code:

-
struct MyBuffer
-
{
-
VkBuffer m_Buf = nullptr;
-
VmaAllocation m_Alloc = nullptr;
-
-
// Called when the buffer is really needed in the current frame.
-
void EnsureBuffer();
-
};
-
-
void MyBuffer::EnsureBuffer()
-
{
-
// Buffer has been created.
-
if(m_Buf != VK_NULL_HANDLE)
-
{
-
// Check if its allocation is not lost + mark it as used in current frame.
-
if(vmaTouchAllocation(allocator, m_Alloc))
-
{
-
// It is all OK - safe to use m_Buf.
-
return;
-
}
-
}
-
-
// Buffer not yet exists or lost - destroy and recreate it.
-
-
vmaDestroyBuffer(allocator, m_Buf, m_Alloc);
-
-
VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
-
bufCreateInfo.size = 1024;
-
bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
-
-
VmaAllocationCreateInfo allocCreateInfo = {};
-
allocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY;
- - -
-
vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &m_Buf, &m_Alloc, nullptr);
-
}
-
Definition: vk_mem_alloc.h:1098
-
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1106
-
VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:1100
-
Represents single memory allocation.
-
void vmaDestroyBuffer(VmaAllocator allocator, VkBuffer buffer, VmaAllocation allocation)
Destroys Vulkan buffer and frees allocated memory.
-
VkBool32 vmaTouchAllocation(VmaAllocator allocator, VmaAllocation allocation)
Returns VK_TRUE if allocation is not lost and atomically marks it as used in current frame.
-
@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:458
-
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
-
@ VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT
Definition: vk_mem_alloc.h:547
-
@ VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT
Definition: vk_mem_alloc.h:554
-

When using lost allocations, you may see some Vulkan validation layer warnings about overlapping regions of memory bound to different kinds of buffers and images. This is still valid as long as you implement proper handling of lost allocations (like in the example above) and don't use them.

-

You can create an allocation that is already in lost state from the beginning using function vmaCreateLostAllocation(). It may be useful if you need a "dummy" allocation that is not null.

-

You can call function vmaMakePoolAllocationsLost() to set all eligible allocations in a specified custom pool to lost state. Allocations that have been "touched" in current frame or VmaPoolCreateInfo::frameInUseCount frames back cannot become lost.

-

Q: Can I touch allocation that cannot become lost?

-

Yes, although it has no visible effect. Calls to vmaGetAllocationInfo() and vmaTouchAllocation() update last use frame index also for allocations that cannot become lost, but the only way to observe it is to dump internal allocator state using vmaBuildStatsString(). You can use this feature for debugging purposes to explicitly mark allocations that you use in current frame and then analyze JSON dump to see for how long each allocation stays unused.

-
-
- - - - diff --git a/docs/html/record_and_replay.html b/docs/html/record_and_replay.html deleted file mode 100644 index 3d2359c..0000000 --- a/docs/html/record_and_replay.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - -Vulkan Memory Allocator: Record and replay - - - - - - - - - -
-
- - - - - - -
-
Vulkan Memory Allocator -
-
-
- - - - - - - - -
-
- - -
- -
- - -
-
-
Record and replay
-
-
-

-Introduction

-

While using the library, sequence of calls to its functions together with their parameters can be recorded to a file and later replayed using standalone player application. It can be useful to:

-
    -
  • Test correctness - check if same sequence of calls will not cause crash or failures on a target platform.
  • -
  • Gather statistics - see number of allocations, peak memory usage, number of calls etc.
  • -
  • Benchmark performance - see how much time it takes to replay the whole sequence.
  • -
-

-Usage

-

Recording functionality is disabled by default. To enable it, define following macro before every include of this library:

-
#define VMA_RECORDING_ENABLED 1
-

To record sequence of calls to a file: Fill in VmaAllocatorCreateInfo::pRecordSettings member while creating VmaAllocator object. File is opened and written during whole lifetime of the allocator.

-

To replay file: Use VmaReplay - standalone command-line program. Precompiled binary can be found in "bin" directory. Its source can be found in "src/VmaReplay" directory. Its project is generated by Premake. Command line syntax is printed when the program is launched without parameters. Basic usage:

VmaReplay.exe MyRecording.csv
-

Documentation of file format can be found in file: "docs/Recording file format.md". It is a human-readable, text file in CSV format (Comma Separated Values).

-

-Additional considerations

-
    -
  • Replaying file that was recorded on a different GPU (with different parameters like bufferImageGranularity, nonCoherentAtomSize, and especially different set of memory heaps and types) may give different performance and memory usage results, as well as issue some warnings and errors.
  • -
  • Current implementation of recording in VMA, as well as VmaReplay application, is coded and tested only on Windows. Inclusion of recording code is driven by VMA_RECORDING_ENABLED macro. Support for other platforms should be easy to add. Contributions are welcomed.
  • -
-
-
- - - - diff --git a/docs/html/search/pages_b.html b/docs/html/search/pages_b.html deleted file mode 100644 index f9e5af4..0000000 --- a/docs/html/search/pages_b.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/docs/html/search/pages_b.js b/docs/html/search/pages_b.js deleted file mode 100644 index 6fb4603..0000000 --- a/docs/html/search/pages_b.js +++ /dev/null @@ -1,7 +0,0 @@ -var searchData= -[ - ['virtual_20allocator_0',['Virtual allocator',['../virtual_allocator.html',1,'index']]], - ['vk_5famd_5fdevice_5fcoherent_5fmemory_1',['VK_AMD_device_coherent_memory',['../vk_amd_device_coherent_memory.html',1,'index']]], - ['vk_5fkhr_5fdedicated_5fallocation_2',['VK_KHR_dedicated_allocation',['../vk_khr_dedicated_allocation.html',1,'index']]], - ['vulkan_20memory_20allocator_3',['Vulkan Memory Allocator',['../index.html',1,'']]] -]; diff --git a/docs/html/search/variables_d.html b/docs/html/search/variables_d.html deleted file mode 100644 index 9f3a67c..0000000 --- a/docs/html/search/variables_d.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/docs/html/search/variables_d.js b/docs/html/search/variables_d.js deleted file mode 100644 index 896216d..0000000 --- a/docs/html/search/variables_d.js +++ /dev/null @@ -1,30 +0,0 @@ -var searchData= -[ - ['vkallocatememory_0',['vkAllocateMemory',['../struct_vma_vulkan_functions.html#a2943bf99dfd784a0e8f599d987e22e6c',1,'VmaVulkanFunctions']]], - ['vkbindbuffermemory_1',['vkBindBufferMemory',['../struct_vma_vulkan_functions.html#a94fc4f3a605d9880bb3c0ba2c2fc80b2',1,'VmaVulkanFunctions']]], - ['vkbindbuffermemory2khr_2',['vkBindBufferMemory2KHR',['../struct_vma_vulkan_functions.html#a0c4907235aab9df2767b79836afa2dc9',1,'VmaVulkanFunctions']]], - ['vkbindimagememory_3',['vkBindImageMemory',['../struct_vma_vulkan_functions.html#a1338d96a128a5ade648b8d934907c637',1,'VmaVulkanFunctions']]], - ['vkbindimagememory2khr_4',['vkBindImageMemory2KHR',['../struct_vma_vulkan_functions.html#ab95aaa73ab8a3fe9fd3daaaec4e0b2bf',1,'VmaVulkanFunctions']]], - ['vkcmdcopybuffer_5',['vkCmdCopyBuffer',['../struct_vma_vulkan_functions.html#ae5c0db8c89a3b82593dc16aa6a49fa3a',1,'VmaVulkanFunctions']]], - ['vkcreatebuffer_6',['vkCreateBuffer',['../struct_vma_vulkan_functions.html#ae8084315a25006271a2edfc3a447519f',1,'VmaVulkanFunctions']]], - ['vkcreateimage_7',['vkCreateImage',['../struct_vma_vulkan_functions.html#a23ebe70be515b9b5010a1d691200e325',1,'VmaVulkanFunctions']]], - ['vkdestroybuffer_8',['vkDestroyBuffer',['../struct_vma_vulkan_functions.html#a7e054606faddb07f0e8556f3ed317d45',1,'VmaVulkanFunctions']]], - ['vkdestroyimage_9',['vkDestroyImage',['../struct_vma_vulkan_functions.html#a90b898227039b1dcb3520f6e91f09ffa',1,'VmaVulkanFunctions']]], - ['vkflushmappedmemoryranges_10',['vkFlushMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a33c322f4c4ad2810f8a9c97a277572f9',1,'VmaVulkanFunctions']]], - ['vkfreememory_11',['vkFreeMemory',['../struct_vma_vulkan_functions.html#a4c658701778564d62034255b5dda91b4',1,'VmaVulkanFunctions']]], - ['vkgetbuffermemoryrequirements_12',['vkGetBufferMemoryRequirements',['../struct_vma_vulkan_functions.html#a5b92901df89a4194b0d12f6071d4d143',1,'VmaVulkanFunctions']]], - ['vkgetbuffermemoryrequirements2khr_13',['vkGetBufferMemoryRequirements2KHR',['../struct_vma_vulkan_functions.html#a9d8d1b05d2b1e7e1d9b27f6f585acf9c',1,'VmaVulkanFunctions']]], - ['vkgetdevicebuffermemoryrequirements_14',['vkGetDeviceBufferMemoryRequirements',['../struct_vma_vulkan_functions.html#a3d6cc5633bdbfec728213d6dfae7d413',1,'VmaVulkanFunctions']]], - ['vkgetdeviceimagememoryrequirements_15',['vkGetDeviceImageMemoryRequirements',['../struct_vma_vulkan_functions.html#afd4780c565028cd15498528883f51fc6',1,'VmaVulkanFunctions']]], - ['vkgetdeviceprocaddr_16',['vkGetDeviceProcAddr',['../struct_vma_vulkan_functions.html#ac383ab9af127e5e136622fa4ebea9e57',1,'VmaVulkanFunctions']]], - ['vkgetimagememoryrequirements_17',['vkGetImageMemoryRequirements',['../struct_vma_vulkan_functions.html#a475f6f49f8debe4d10800592606d53f4',1,'VmaVulkanFunctions']]], - ['vkgetimagememoryrequirements2khr_18',['vkGetImageMemoryRequirements2KHR',['../struct_vma_vulkan_functions.html#a9cdcdc1e2b2ea7c571f7d27e30ba6875',1,'VmaVulkanFunctions']]], - ['vkgetinstanceprocaddr_19',['vkGetInstanceProcAddr',['../struct_vma_vulkan_functions.html#a3eafa102f5f8915f093f40675636b849',1,'VmaVulkanFunctions']]], - ['vkgetphysicaldevicememoryproperties_20',['vkGetPhysicalDeviceMemoryProperties',['../struct_vma_vulkan_functions.html#a60d25c33bba06bb8592e6875cbaa9830',1,'VmaVulkanFunctions']]], - ['vkgetphysicaldevicememoryproperties2khr_21',['vkGetPhysicalDeviceMemoryProperties2KHR',['../struct_vma_vulkan_functions.html#a0d992896e6ffcf92b9d7ea049fa5c445',1,'VmaVulkanFunctions']]], - ['vkgetphysicaldeviceproperties_22',['vkGetPhysicalDeviceProperties',['../struct_vma_vulkan_functions.html#a77b7a74082823e865dd6546623468f96',1,'VmaVulkanFunctions']]], - ['vkinvalidatemappedmemoryranges_23',['vkInvalidateMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a5c1093bc32386a8060c37c9f282078a1',1,'VmaVulkanFunctions']]], - ['vkmapmemory_24',['vkMapMemory',['../struct_vma_vulkan_functions.html#ab5c1f38dea3a2cf00dc9eb4f57218c49',1,'VmaVulkanFunctions']]], - ['vkunmapmemory_25',['vkUnmapMemory',['../struct_vma_vulkan_functions.html#acc798589736f0becb317fc2196c1d8b9',1,'VmaVulkanFunctions']]], - ['vulkanapiversion_26',['vulkanApiVersion',['../struct_vma_allocator_create_info.html#ae0ffc55139b54520a6bb704b29ffc285',1,'VmaAllocatorCreateInfo']]] -]; diff --git a/docs/html/struct_vma_defragmentation_info2-members.html b/docs/html/struct_vma_defragmentation_info2-members.html deleted file mode 100644 index a17b9ef..0000000 --- a/docs/html/struct_vma_defragmentation_info2-members.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - -Vulkan Memory Allocator: Member List - - - - - - - - - -
-
- - - - - - -
-
Vulkan Memory Allocator -
-
-
- - - - - - - - -
-
- - -
- -
- -
-
-
VmaDefragmentationInfo2 Member List
-
- - - - - diff --git a/docs/html/struct_vma_defragmentation_info2.html b/docs/html/struct_vma_defragmentation_info2.html deleted file mode 100644 index 2c9cc25..0000000 --- a/docs/html/struct_vma_defragmentation_info2.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - -Vulkan Memory Allocator: VmaDefragmentationInfo2 Struct Reference - - - - - - - - - -
-
- - - - - - -
-
Vulkan Memory Allocator -
-
-
- - - - - - - - -
-
- - -
- -
- -
-
- -
VmaDefragmentationInfo2 Struct Reference
-
-
- -

Parameters for defragmentation. - More...

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Attributes

VmaDefragmentationFlags flags
 Reserved for future use. Should be 0. More...
 
uint32_t allocationCount
 Number of allocations in pAllocations array. More...
 
const VmaAllocationpAllocations
 Pointer to array of allocations that can be defragmented. More...
 
VkBool32 * pAllocationsChanged
 Optional, output. Pointer to array that will be filled with information whether the allocation at certain index has been changed during defragmentation. More...
 
uint32_t poolCount
 Numer of pools in pPools array. More...
 
const VmaPoolpPools
 Either null or pointer to array of pools to be defragmented. More...
 
VkDeviceSize maxCpuBytesToMove
 Maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on CPU side, like memcpy(), memmove(). More...
 
uint32_t maxCpuAllocationsToMove
 Maximum number of allocations that can be moved to a different place using transfers on CPU side, like memcpy(), memmove(). More...
 
VkDeviceSize maxGpuBytesToMove
 Maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on GPU side, posted to commandBuffer. More...
 
uint32_t maxGpuAllocationsToMove
 Maximum number of allocations that can be moved to a different place using transfers on GPU side, posted to commandBuffer. More...
 
VkCommandBuffer commandBuffer
 Optional. Command buffer where GPU copy commands will be posted. More...
 
-

Detailed Description

-

Parameters for defragmentation.

-

To be used with function vmaDefragmentationBegin().

-

Member Data Documentation

- -

◆ allocationCount

- -
-
- - - - -
uint32_t VmaDefragmentationInfo2::allocationCount
-
- -

Number of allocations in pAllocations array.

- -
-
- -

◆ commandBuffer

- -
-
- - - - -
VkCommandBuffer VmaDefragmentationInfo2::commandBuffer
-
- -

Optional. Command buffer where GPU copy commands will be posted.

-

If not null, it must be a valid command buffer handle that supports Transfer queue type. It must be in the recording state and outside of a render pass instance. You need to submit it and make sure it finished execution before calling vmaDefragmentationEnd().

-

Passing null means that only CPU defragmentation will be performed.

- -
-
- -

◆ flags

- -
-
- - - - -
VmaDefragmentationFlags VmaDefragmentationInfo2::flags
-
- -

Reserved for future use. Should be 0.

- -
-
- -

◆ maxCpuAllocationsToMove

- -
-
- - - - -
uint32_t VmaDefragmentationInfo2::maxCpuAllocationsToMove
-
- -

Maximum number of allocations that can be moved to a different place using transfers on CPU side, like memcpy(), memmove().

-

UINT32_MAX means no limit.

- -
-
- -

◆ maxCpuBytesToMove

- -
-
- - - - -
VkDeviceSize VmaDefragmentationInfo2::maxCpuBytesToMove
-
- -

Maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on CPU side, like memcpy(), memmove().

-

VK_WHOLE_SIZE means no limit.

- -
-
- -

◆ maxGpuAllocationsToMove

- -
-
- - - - -
uint32_t VmaDefragmentationInfo2::maxGpuAllocationsToMove
-
- -

Maximum number of allocations that can be moved to a different place using transfers on GPU side, posted to commandBuffer.

-

UINT32_MAX means no limit.

- -
-
- -

◆ maxGpuBytesToMove

- -
-
- - - - -
VkDeviceSize VmaDefragmentationInfo2::maxGpuBytesToMove
-
- -

Maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on GPU side, posted to commandBuffer.

-

VK_WHOLE_SIZE means no limit.

- -
-
- -

◆ pAllocations

- -
-
- - - - -
const VmaAllocation* VmaDefragmentationInfo2::pAllocations
-
- -

Pointer to array of allocations that can be defragmented.

-

The array should have allocationCount elements. The array should not contain nulls. Elements in the array should be unique - same allocation cannot occur twice. All allocations not present in this array are considered non-moveable during this defragmentation.

- -
-
- -

◆ pAllocationsChanged

- -
-
- - - - -
VkBool32* VmaDefragmentationInfo2::pAllocationsChanged
-
- -

Optional, output. Pointer to array that will be filled with information whether the allocation at certain index has been changed during defragmentation.

-

The array should have allocationCount elements. You can pass null if you are not interested in this information.

- -
-
- -

◆ poolCount

- -
-
- - - - -
uint32_t VmaDefragmentationInfo2::poolCount
-
- -

Numer of pools in pPools array.

- -
-
- -

◆ pPools

- -
-
- - - - -
const VmaPool* VmaDefragmentationInfo2::pPools
-
- -

Either null or pointer to array of pools to be defragmented.

-

All the allocations in the specified pools can be moved during defragmentation and there is no way to check if they were really moved as in pAllocationsChanged, so you must query all the allocations in all these pools for new VkDeviceMemory and offset using vmaGetAllocationInfo() if you might need to recreate buffers and images bound to them.

-

The array should have poolCount elements. The array should not contain nulls. Elements in the array should be unique - same pool cannot occur twice.

-

Using this array is equivalent to specifying all allocations from the pools in pAllocations. It might be more efficient.

- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/docs/html/struct_vma_defragmentation_pass_info-members.html b/docs/html/struct_vma_defragmentation_pass_info-members.html deleted file mode 100644 index 4d33a3a..0000000 --- a/docs/html/struct_vma_defragmentation_pass_info-members.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - -Vulkan Memory Allocator: Member List - - - - - - - - - -
-
- - - - - - -
-
Vulkan Memory Allocator -
-
-
- - - - - - - - -
-
- - -
- -
- -
-
-
VmaDefragmentationPassInfo Member List
-
-
- -

This is the complete list of members for VmaDefragmentationPassInfo, including all inherited members.

- - - -
moveCountVmaDefragmentationPassInfo
pMovesVmaDefragmentationPassInfo
- - - - diff --git a/docs/html/struct_vma_defragmentation_pass_info.html b/docs/html/struct_vma_defragmentation_pass_info.html deleted file mode 100644 index 8ce9f68..0000000 --- a/docs/html/struct_vma_defragmentation_pass_info.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - -Vulkan Memory Allocator: VmaDefragmentationPassInfo Struct Reference - - - - - - - - - -
-
- - - - - - -
-
Vulkan Memory Allocator -
-
-
- - - - - - - - -
-
- - -
- -
- -
-
- -
VmaDefragmentationPassInfo Struct Reference
-
-
- -

Parameters for incremental defragmentation steps. - More...

- - - - - - -

-Public Attributes

uint32_t moveCount
 
VmaDefragmentationPassMoveInfopMoves
 
-

Detailed Description

-

Parameters for incremental defragmentation steps.

-

To be used with function vmaBeginDefragmentationPass().

-

Member Data Documentation

- -

◆ moveCount

- -
-
- - - - -
uint32_t VmaDefragmentationPassInfo::moveCount
-
- -
-
- -

◆ pMoves

- -
-
- - - - -
VmaDefragmentationPassMoveInfo* VmaDefragmentationPassInfo::pMoves
-
- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/docs/html/struct_vma_pool_stats-members.html b/docs/html/struct_vma_pool_stats-members.html deleted file mode 100644 index 0597048..0000000 --- a/docs/html/struct_vma_pool_stats-members.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - -Vulkan Memory Allocator: Member List - - - - - - - - - -
-
- - - - - - -
-
Vulkan Memory Allocator -
-
-
- - - - - - - - -
-
- - -
- -
- -
-
-
VmaPoolStats Member List
-
-
- -

This is the complete list of members for VmaPoolStats, including all inherited members.

- - - - - - -
allocationCountVmaPoolStats
blockCountVmaPoolStats
sizeVmaPoolStats
unusedRangeCountVmaPoolStats
unusedSizeVmaPoolStats
- - - - diff --git a/docs/html/struct_vma_pool_stats.html b/docs/html/struct_vma_pool_stats.html deleted file mode 100644 index e22277f..0000000 --- a/docs/html/struct_vma_pool_stats.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - -Vulkan Memory Allocator: VmaPoolStats Struct Reference - - - - - - - - - -
-
- - - - - - -
-
Vulkan Memory Allocator -
-
-
- - - - - - - - -
-
- - -
- -
- -
-
- -
VmaPoolStats Struct Reference
-
-
- -

Describes parameter of existing VmaPool. - More...

- - - - - - - - - - - - - - - - - -

-Public Attributes

VkDeviceSize size
 Total amount of VkDeviceMemory allocated from Vulkan for this pool, in bytes. More...
 
VkDeviceSize unusedSize
 Total number of bytes in the pool not used by any VmaAllocation. More...
 
size_t allocationCount
 Number of VmaAllocation objects created from this pool that were not destroyed. More...
 
size_t unusedRangeCount
 Number of continuous memory ranges in the pool not used by any VmaAllocation. More...
 
size_t blockCount
 Number of VkDeviceMemory blocks allocated for this pool. More...
 
-

Detailed Description

-

Describes parameter of existing VmaPool.

-

Member Data Documentation

- -

◆ allocationCount

- -
-
- - - - -
size_t VmaPoolStats::allocationCount
-
- -

Number of VmaAllocation objects created from this pool that were not destroyed.

- -
-
- -

◆ blockCount

- -
-
- - - - -
size_t VmaPoolStats::blockCount
-
- -

Number of VkDeviceMemory blocks allocated for this pool.

- -
-
- -

◆ size

- -
-
- - - - -
VkDeviceSize VmaPoolStats::size
-
- -

Total amount of VkDeviceMemory allocated from Vulkan for this pool, in bytes.

- -
-
- -

◆ unusedRangeCount

- -
-
- - - - -
size_t VmaPoolStats::unusedRangeCount
-
- -

Number of continuous memory ranges in the pool not used by any VmaAllocation.

- -
-
- -

◆ unusedSize

- -
-
- - - - -
VkDeviceSize VmaPoolStats::unusedSize
-
- -

Total number of bytes in the pool not used by any VmaAllocation.

- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/docs/html/struct_vma_record_settings-members.html b/docs/html/struct_vma_record_settings-members.html deleted file mode 100644 index 7724949..0000000 --- a/docs/html/struct_vma_record_settings-members.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - -Vulkan Memory Allocator: Member List - - - - - - - - - -
-
- - - - - - -
-
Vulkan Memory Allocator -
-
-
- - - - - - - - -
-
- - -
- -
- -
-
-
VmaRecordSettings Member List
-
-
- -

This is the complete list of members for VmaRecordSettings, including all inherited members.

- - - -
flagsVmaRecordSettings
pFilePathVmaRecordSettings
- - - - diff --git a/docs/html/struct_vma_record_settings.html b/docs/html/struct_vma_record_settings.html deleted file mode 100644 index da6cd19..0000000 --- a/docs/html/struct_vma_record_settings.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - -Vulkan Memory Allocator: VmaRecordSettings Struct Reference - - - - - - - - - -
-
- - - - - - -
-
Vulkan Memory Allocator -
-
-
- - - - - - - - -
-
- - -
- -
- -
-
- -
VmaRecordSettings Struct Reference
-
-
- -

Parameters for recording calls to VMA functions. To be used in VmaAllocatorCreateInfo::pRecordSettings. - More...

- -

#include <vk_mem_alloc.h>

- - - - - - - - -

-Public Attributes

VmaRecordFlags flags
 Flags for recording. Use VmaRecordFlagBits enum. More...
 
const char * pFilePath
 Path to the file that should be written by the recording. More...
 
-

Detailed Description

-

Parameters for recording calls to VMA functions. To be used in VmaAllocatorCreateInfo::pRecordSettings.

-

Member Data Documentation

- -

◆ flags

- -
-
- - - - -
VmaRecordFlags VmaRecordSettings::flags
-
- -

Flags for recording. Use VmaRecordFlagBits enum.

- -
-
- -

◆ pFilePath

- -
-
- - - - -
const char* VmaRecordSettings::pFilePath
-
- -

Path to the file that should be written by the recording.

-

Suggested extension: "csv". If the file already exists, it will be overwritten. It will be opened for the whole time VmaAllocator object is alive. If opening this file fails, creation of the whole allocator object fails.

- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/docs/html/struct_vma_stat_info-members.html b/docs/html/struct_vma_stat_info-members.html deleted file mode 100644 index e498b99..0000000 --- a/docs/html/struct_vma_stat_info-members.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - -Vulkan Memory Allocator: Member List - - - - - - - - - -
-
- - - - - - -
-
Vulkan Memory Allocator -
-
-
- - - - - - - - -
-
- - -
- -
- -
-
-
VmaStatInfo Member List
-
- - - - - diff --git a/docs/html/struct_vma_stat_info.html b/docs/html/struct_vma_stat_info.html deleted file mode 100644 index 11ee192..0000000 --- a/docs/html/struct_vma_stat_info.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - - -Vulkan Memory Allocator: VmaStatInfo Struct Reference - - - - - - - - - -
-
- - - - - - -
-
Vulkan Memory Allocator -
-
-
- - - - - - - - -
-
- - -
- -
- -
-
- -
VmaStatInfo Struct Reference
-
-
- -

Calculated statistics of memory usage in entire allocator. - More...

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Attributes

uint32_t blockCount
 Number of VkDeviceMemory Vulkan memory blocks allocated. More...
 
uint32_t allocationCount
 Number of VmaAllocation allocation objects allocated. More...
 
uint32_t unusedRangeCount
 Number of free ranges of memory between allocations. More...
 
VkDeviceSize usedBytes
 Total number of bytes occupied by all allocations. More...
 
VkDeviceSize unusedBytes
 Total number of bytes occupied by unused ranges. More...
 
VkDeviceSize allocationSizeMin
 
VkDeviceSize allocationSizeAvg
 
VkDeviceSize allocationSizeMax
 
VkDeviceSize unusedRangeSizeMin
 
VkDeviceSize unusedRangeSizeAvg
 
VkDeviceSize unusedRangeSizeMax
 
-

Detailed Description

-

Calculated statistics of memory usage in entire allocator.

-

Member Data Documentation

- -

◆ allocationCount

- -
-
- - - - -
uint32_t VmaStatInfo::allocationCount
-
- -

Number of VmaAllocation allocation objects allocated.

- -
-
- -

◆ allocationSizeAvg

- -
-
- - - - -
VkDeviceSize VmaStatInfo::allocationSizeAvg
-
- -
-
- -

◆ allocationSizeMax

- -
-
- - - - -
VkDeviceSize VmaStatInfo::allocationSizeMax
-
- -
-
- -

◆ allocationSizeMin

- -
-
- - - - -
VkDeviceSize VmaStatInfo::allocationSizeMin
-
- -
-
- -

◆ blockCount

- -
-
- - - - -
uint32_t VmaStatInfo::blockCount
-
- -

Number of VkDeviceMemory Vulkan memory blocks allocated.

- -
-
- -

◆ unusedBytes

- -
-
- - - - -
VkDeviceSize VmaStatInfo::unusedBytes
-
- -

Total number of bytes occupied by unused ranges.

- -
-
- -

◆ unusedRangeCount

- -
-
- - - - -
uint32_t VmaStatInfo::unusedRangeCount
-
- -

Number of free ranges of memory between allocations.

- -
-
- -

◆ unusedRangeSizeAvg

- -
-
- - - - -
VkDeviceSize VmaStatInfo::unusedRangeSizeAvg
-
- -
-
- -

◆ unusedRangeSizeMax

- -
-
- - - - -
VkDeviceSize VmaStatInfo::unusedRangeSizeMax
-
- -
-
- -

◆ unusedRangeSizeMin

- -
-
- - - - -
VkDeviceSize VmaStatInfo::unusedRangeSizeMin
-
- -
-
- -

◆ usedBytes

- -
-
- - - - -
VkDeviceSize VmaStatInfo::usedBytes
-
- -

Total number of bytes occupied by all allocations.

- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/docs/html/struct_vma_stats-members.html b/docs/html/struct_vma_stats-members.html deleted file mode 100644 index 4a25867..0000000 --- a/docs/html/struct_vma_stats-members.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - -Vulkan Memory Allocator: Member List - - - - - - - - - -
-
- - - - - - -
-
Vulkan Memory Allocator -
-
-
- - - - - - - - -
-
- - -
- -
- -
-
-
VmaStats Member List
-
-
- -

This is the complete list of members for VmaStats, including all inherited members.

- - - - -
memoryHeapVmaStats
memoryTypeVmaStats
totalVmaStats
- - - - diff --git a/docs/html/struct_vma_stats.html b/docs/html/struct_vma_stats.html deleted file mode 100644 index bc174f5..0000000 --- a/docs/html/struct_vma_stats.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - -Vulkan Memory Allocator: VmaStats Struct Reference - - - - - - - - - -
-
- - - - - - -
-
Vulkan Memory Allocator -
-
-
- - - - - - - - -
-
- - -
- -
- -
-
- -
VmaStats Struct Reference
-
-
- -

General statistics from current state of Allocator. - More...

- - - - - - - - -

-Public Attributes

VmaStatInfo memoryType [VK_MAX_MEMORY_TYPES]
 
VmaStatInfo memoryHeap [VK_MAX_MEMORY_HEAPS]
 
VmaStatInfo total
 
-

Detailed Description

-

General statistics from current state of Allocator.

-

Member Data Documentation

- -

◆ memoryHeap

- -
-
- - - - -
VmaStatInfo VmaStats::memoryHeap[VK_MAX_MEMORY_HEAPS]
-
- -
-
- -

◆ memoryType

- -
-
- - - - -
VmaStatInfo VmaStats::memoryType[VK_MAX_MEMORY_TYPES]
-
- -
-
- -

◆ total

- -
-
- - - - -
VmaStatInfo VmaStats::total
-
- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index d6bd74b..2cf4094 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -25,7 +25,7 @@ /** \mainpage Vulkan Memory Allocator -Version 3.0.0-development +Version 3.0.0 (2022-03-25) Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved. \n License: MIT