diff --git a/docs/html/allocation_annotation.html b/docs/html/allocation_annotation.html index 04456f6..01151dc 100644 --- a/docs/html/allocation_annotation.html +++ b/docs/html/allocation_annotation.html @@ -1,9 +1,9 @@ - + - + Vulkan Memory Allocator: Allocation names and user data @@ -29,10 +29,10 @@ - + @@ -55,9 +55,16 @@ $(function() {
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

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.

+

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

Allocation names

An allocation can also carry a null-terminated string, giving a name to the allocation. To set it, call vmaSetAllocationName(). The library creates internal copy of the string, so the pointer you pass doesn't need to be valid for whole lifetime of the allocation. You can free it after the call.

@@ -105,13 +112,13 @@ Allocation names
imageName += fileName;
vmaSetAllocationName(allocator, allocation, imageName.c_str());
vmaSetAllocationName
void vmaSetAllocationName(VmaAllocator allocator, VmaAllocation allocation, const char *pName)
Sets pName in given allocation to new value.
-

The string can be later retrieved by inspecting VmaAllocationInfo::pName. It is also printed in JSON report created by vmaBuildStatsString().

+

The string can be later retrieved by inspecting VmaAllocationInfo::pName. It is also printed in JSON report created by vmaBuildStatsString().

Note
Setting 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.
diff --git a/docs/html/annotated.html b/docs/html/annotated.html index 17dfe90..a9ae67f 100644 --- a/docs/html/annotated.html +++ b/docs/html/annotated.html @@ -1,9 +1,9 @@ - + - + Vulkan Memory Allocator: Class List @@ -29,10 +29,10 @@ - + @@ -56,9 +56,16 @@ $(function() {
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -68,35 +75,35 @@ $(function() {
Here are the classes, structs, unions and interfaces with brief descriptions:
- + - + - + - + - + - + - + - + - + - + - + - +
 CVmaAllocationRepresents single memory allocation
 CVmaAllocationCreateInfoParameters of new VmaAllocation
 CVmaAllocationCreateInfoParameters of new VmaAllocation
 CVmaAllocationInfoParameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo()
 CVmaAllocatorRepresents main object of this library initialized
 CVmaAllocatorRepresents main object of this library initialized
 CVmaAllocatorCreateInfoDescription of a Allocator to be created
 CVmaAllocatorInfoInformation about existing VmaAllocator object
 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
 CVmaDefragmentationContextAn opaque object that represents started defragmentation process
 CVmaDefragmentationInfoParameters for defragmentation
 CVmaDefragmentationMoveSingle move of an allocation to be done 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()
 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
 CVmaDeviceMemoryCallbacksSet of callbacks that the library will call for vkAllocateMemory and vkFreeMemory
 CVmaPoolRepresents custom memory pool
 CVmaPoolCreateInfoDescribes parameter of created VmaPool
 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
 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()
 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
 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
 CVmaVulkanFunctionsPointers to some Vulkan functions - a subset used by the library
diff --git a/docs/html/bc_sd.png b/docs/html/bc_sd.png new file mode 100644 index 0000000..31ca888 Binary files /dev/null and b/docs/html/bc_sd.png differ diff --git a/docs/html/choosing_memory_type.html b/docs/html/choosing_memory_type.html index 51db66e..f19939d 100644 --- a/docs/html/choosing_memory_type.html +++ b/docs/html/choosing_memory_type.html @@ -1,9 +1,9 @@ - + - + Vulkan Memory Allocator: Choosing memory type @@ -29,10 +29,10 @@ - + @@ -55,9 +55,16 @@ $(function() {
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

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.

-

For example, a staging buffer that will be filled via mapped pointer and then used as a source of transfer to the buffer described previously can be created like this. It will likely and up in a memory type that is HOST_VISIBLE and HOST_COHERENT but not HOST_CACHED (meaning uncached, write-combined) and not DEVICE_LOCAL (meaning system RAM).

+

For example, a staging buffer that will be filled via mapped pointer and then used as a source of transfer to the buffer described previously can be created like this. It will likely end up in a memory type that is HOST_VISIBLE and HOST_COHERENT but not HOST_CACHED (meaning uncached, write-combined) and not DEVICE_LOCAL (meaning system RAM).

VkBufferCreateInfo stagingBufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
stagingBufferInfo.size = 65536;
stagingBufferInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
@@ -162,7 +169,7 @@ Dedicated allocations
diff --git a/docs/html/classes.html b/docs/html/classes.html index e6b1373..bd2069e 100644 --- a/docs/html/classes.html +++ b/docs/html/classes.html @@ -1,9 +1,9 @@ - + - + Vulkan Memory Allocator: Class Index @@ -29,10 +29,10 @@ - + @@ -56,9 +56,16 @@ $(function() {
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -74,7 +81,7 @@ $(function() {
diff --git a/docs/html/configuration.html b/docs/html/configuration.html index 68629e0..7dea06c 100644 --- a/docs/html/configuration.html +++ b/docs/html/configuration.html @@ -1,9 +1,9 @@ - + - + Vulkan Memory Allocator: Configuration @@ -29,10 +29,10 @@ - + @@ -55,9 +55,16 @@ $(function() {
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
diff --git a/docs/html/custom_memory_pools.html b/docs/html/custom_memory_pools.html index 83126d0..e853668 100644 --- a/docs/html/custom_memory_pools.html +++ b/docs/html/custom_memory_pools.html @@ -1,9 +1,9 @@ - + - + Vulkan Memory Allocator: Custom memory pools @@ -29,10 +29,10 @@ - + @@ -55,9 +55,16 @@ $(function() {
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
diff --git a/docs/html/debugging_memory_usage.html b/docs/html/debugging_memory_usage.html index fb2d74c..9b9911e 100644 --- a/docs/html/debugging_memory_usage.html +++ b/docs/html/debugging_memory_usage.html @@ -1,9 +1,9 @@ - + - + Vulkan Memory Allocator: Debugging incorrect memory usage @@ -29,10 +29,10 @@ - + @@ -55,9 +55,16 @@ $(function() {
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
diff --git a/docs/html/defragmentation.html b/docs/html/defragmentation.html index a2b2d30..011c9b6 100644 --- a/docs/html/defragmentation.html +++ b/docs/html/defragmentation.html @@ -1,9 +1,9 @@ - + - + Vulkan Memory Allocator: Defragmentation @@ -29,10 +29,10 @@ - + @@ -55,9 +55,16 @@ $(function() {
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

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: