From 2dccf1167b223466c5fcd64f842cb8a59d91f151 Mon Sep 17 00:00:00 2001 From: sawickiap Date: Thu, 4 Jun 2026 23:12:49 +0200 Subject: [PATCH 1/3] Prepared version 3.4.0 --- CHANGELOG.md | 2 +- CMakeLists.txt | 2 +- include/vk_mem_alloc.h | 2 +- src/VulkanSample.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63643f62..a51c1505 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 3.4.0 (2026-??-??) +# 3.4.0 (2026-06-05) - Added file `AGENTS.md` for agentic AI. - Added member `VmaAllocationCreateInfo::minAlignment` (#523). diff --git a/CMakeLists.txt b/CMakeLists.txt index 1547f472..2f574cc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ cmake_minimum_required(VERSION 3.15...3.26) -project(VMA VERSION 3.3.0 LANGUAGES CXX) +project(VMA VERSION 3.4.0 LANGUAGES CXX) add_library(VulkanMemoryAllocator INTERFACE) add_library(GPUOpen::VulkanMemoryAllocator ALIAS VulkanMemoryAllocator) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index d09d613b..f2b58bf6 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -25,7 +25,7 @@ /** \mainpage Vulkan Memory Allocator -Version 3.4.0-development +Version 3.4.0 Copyright (c) 2017-2026 Advanced Micro Devices, Inc. All rights reserved. \n License: MIT \n diff --git a/src/VulkanSample.cpp b/src/VulkanSample.cpp index 564e59d4..3fd6e9f1 100644 --- a/src/VulkanSample.cpp +++ b/src/VulkanSample.cpp @@ -36,8 +36,8 @@ static const char* const SHADER_PATH1 = "./Shaders/"; static const char* const SHADER_PATH2 = "../bin/"; static const wchar_t* const WINDOW_CLASS_NAME = L"VULKAN_MEMORY_ALLOCATOR_SAMPLE"; static const char* const VALIDATION_LAYER_NAME = "VK_LAYER_KHRONOS_validation"; -static const char* const APP_TITLE_A = "Vulkan Memory Allocator Sample 3.3.0"; -static const wchar_t* const APP_TITLE_W = L"Vulkan Memory Allocator Sample 3.3.0"; +static const char* const APP_TITLE_A = "Vulkan Memory Allocator Sample 3.4.0"; +static const wchar_t* const APP_TITLE_W = L"Vulkan Memory Allocator Sample 3.4.0"; static const bool VSYNC = true; static const uint32_t COMMAND_BUFFER_COUNT = 2; From c407a7bb7872460412ed5ae0acc120ac6b573b29 Mon Sep 17 00:00:00 2001 From: sawickiap Date: Thu, 4 Jun 2026 23:13:00 +0200 Subject: [PATCH 2/3] Rebuilt the documentation --- docs/html/allocation_annotation.html | 61 +- docs/html/annotated.html | 49 +- docs/html/choosing_memory_type.html | 69 ++- docs/html/classes.html | 49 +- docs/html/clipboard.js | 4 +- docs/html/codefolding.js | 143 +++++ docs/html/configuration.html | 49 +- docs/html/custom_memory_pools.html | 65 +- docs/html/debugging_memory_usage.html | 49 +- docs/html/defragmentation.html | 71 ++- docs/html/deprecated.html | 49 +- .../dir_d44c64559bbebec7f509842c48db8b23.html | 49 +- docs/html/doxygen.css | 36 +- docs/html/doxygen_crawl.html | 4 +- docs/html/enabling_buffer_device_address.html | 49 +- docs/html/faq.html | 49 +- docs/html/files.html | 53 +- docs/html/functions.html | 54 +- docs/html/functions_vars.html | 54 +- docs/html/general_considerations.html | 49 +- docs/html/globals.html | 54 +- docs/html/globals_defs.html | 54 +- docs/html/globals_enum.html | 53 +- docs/html/globals_eval.html | 53 +- docs/html/globals_func.html | 53 +- docs/html/globals_type.html | 53 +- docs/html/group__group__alloc.html | 49 +- docs/html/group__group__init.html | 71 ++- docs/html/group__group__stats.html | 49 +- docs/html/group__group__virtual.html | 49 +- docs/html/index.html | 51 +- docs/html/memory_mapping.html | 65 +- docs/html/menu.js | 580 +++++++++++++++--- docs/html/other_api_interop.html | 63 +- docs/html/pages.html | 49 +- docs/html/quick_start.html | 71 ++- docs/html/resource_aliasing.html | 53 +- docs/html/search/all_14.js | 86 +-- docs/html/search/defines_0.js | 3 +- docs/html/search/variables_c.js | 11 +- docs/html/statistics.html | 49 +- docs/html/staying_within_budget.html | 49 +- docs/html/struct_vma_allocation.html | 49 +- ...ct_vma_allocation_create_info-members.html | 49 +- .../struct_vma_allocation_create_info.html | 49 +- .../struct_vma_allocation_info-members.html | 49 +- docs/html/struct_vma_allocation_info.html | 49 +- .../struct_vma_allocation_info2-members.html | 49 +- docs/html/struct_vma_allocation_info2.html | 49 +- docs/html/struct_vma_allocator.html | 49 +- ...uct_vma_allocator_create_info-members.html | 49 +- .../struct_vma_allocator_create_info.html | 49 +- .../struct_vma_allocator_info-members.html | 49 +- docs/html/struct_vma_allocator_info.html | 49 +- docs/html/struct_vma_budget-members.html | 49 +- docs/html/struct_vma_budget.html | 49 +- .../struct_vma_defragmentation_context.html | 49 +- ...ruct_vma_defragmentation_info-members.html | 49 +- .../html/struct_vma_defragmentation_info.html | 49 +- ...ruct_vma_defragmentation_move-members.html | 49 +- .../html/struct_vma_defragmentation_move.html | 49 +- ...efragmentation_pass_move_info-members.html | 49 +- ...ct_vma_defragmentation_pass_move_info.html | 49 +- ...uct_vma_defragmentation_stats-members.html | 49 +- .../struct_vma_defragmentation_stats.html | 49 +- ...truct_vma_detailed_statistics-members.html | 49 +- docs/html/struct_vma_detailed_statistics.html | 49 +- ...t_vma_device_memory_callbacks-members.html | 49 +- .../struct_vma_device_memory_callbacks.html | 49 +- docs/html/struct_vma_pool.html | 49 +- .../struct_vma_pool_create_info-members.html | 49 +- docs/html/struct_vma_pool_create_info.html | 49 +- docs/html/struct_vma_statistics-members.html | 49 +- docs/html/struct_vma_statistics.html | 49 +- .../struct_vma_total_statistics-members.html | 49 +- docs/html/struct_vma_total_statistics.html | 49 +- docs/html/struct_vma_virtual_allocation.html | 49 +- ...irtual_allocation_create_info-members.html | 49 +- ...ct_vma_virtual_allocation_create_info.html | 49 +- ...t_vma_virtual_allocation_info-members.html | 49 +- .../struct_vma_virtual_allocation_info.html | 49 +- docs/html/struct_vma_virtual_block.html | 49 +- ...vma_virtual_block_create_info-members.html | 49 +- .../struct_vma_virtual_block_create_info.html | 49 +- .../struct_vma_vulkan_functions-members.html | 58 +- docs/html/struct_vma_vulkan_functions.html | 67 +- docs/html/tabs.css | 483 ++++++++++++++- docs/html/topics.html | 49 +- docs/html/usage_patterns.html | 73 ++- docs/html/virtual_allocator.html | 69 ++- docs/html/vk__mem__alloc_8h.html | 64 +- docs/html/vk_amd_device_coherent_memory.html | 49 +- docs/html/vk_ext_memory_priority.html | 61 +- docs/html/vk_khr_dedicated_allocation.html | 51 +- 94 files changed, 4597 insertions(+), 1208 deletions(-) create mode 100644 docs/html/codefolding.js diff --git a/docs/html/allocation_annotation.html b/docs/html/allocation_annotation.html index bfe2afdc..e8069878 100644 --- a/docs/html/allocation_annotation.html +++ b/docs/html/allocation_annotation.html @@ -3,17 +3,21 @@ - + Vulkan Memory Allocator: Allocation names and user data - - + + @@ -31,22 +35,45 @@ - + - + +
VmaAllocation allocation;
vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buffer, &allocation, nullptr);
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
Definition vk_mem_alloc.h:553
-
Parameters of new VmaAllocation.
Definition vk_mem_alloc.h:1294
-
void * pUserData
Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo...
Definition vk_mem_alloc.h:1333
-
VmaMemoryUsage usage
Intended usage of memory.
Definition vk_mem_alloc.h:1302
+
@ VMA_MEMORY_USAGE_AUTO
Definition vk_mem_alloc.h:563
+
Parameters of new VmaAllocation.
Definition vk_mem_alloc.h:1308
+
void * pUserData
Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo...
Definition vk_mem_alloc.h:1347
+
VmaMemoryUsage usage
Intended usage of memory.
Definition vk_mem_alloc.h:1316
Represents single memory allocation.

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

vmaGetAllocationInfo(allocator, allocation, &allocInfo);
MyBufferMetadata* pMetadata = (MyBufferMetadata*)allocInfo.pUserData;
void vmaGetAllocationInfo(VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)
Returns current information about specified allocation.
-
Definition vk_mem_alloc.h:1432
-
void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition vk_mem_alloc.h:1479
+
Definition vk_mem_alloc.h:1446
+
void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition vk_mem_alloc.h:1493

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.

@@ -120,7 +147,7 @@

diff --git a/docs/html/annotated.html b/docs/html/annotated.html index b479d003..0bc00028 100644 --- a/docs/html/annotated.html +++ b/docs/html/annotated.html @@ -3,17 +3,21 @@ - + Vulkan Memory Allocator: Class List - - + + @@ -31,22 +35,45 @@ - + - + +
@@ -106,7 +133,7 @@
diff --git a/docs/html/choosing_memory_type.html b/docs/html/choosing_memory_type.html index b258de8f..d5f6f3df 100644 --- a/docs/html/choosing_memory_type.html +++ b/docs/html/choosing_memory_type.html @@ -3,17 +3,21 @@ - + Vulkan Memory Allocator: Choosing memory type - - + + @@ -31,22 +35,45 @@ - + - + +
VmaAllocation allocation;
vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
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
Definition vk_mem_alloc.h:553
-
Parameters of new VmaAllocation.
Definition vk_mem_alloc.h:1294
-
VmaMemoryUsage usage
Intended usage of memory.
Definition vk_mem_alloc.h:1302
+
@ VMA_MEMORY_USAGE_AUTO
Definition vk_mem_alloc.h:563
+
Parameters of new VmaAllocation.
Definition vk_mem_alloc.h:1308
+
VmaMemoryUsage usage
Intended usage of memory.
Definition vk_mem_alloc.h:1316
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.

@@ -121,8 +148,8 @@

VkBuffer stagingBuffer;
VmaAllocation stagingAllocation;
vmaCreateBuffer(allocator, &stagingBufferInfo, &stagingAllocInfo, &stagingBuffer, &stagingAllocation, nullptr);
-
@ VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT
Definition vk_mem_alloc.h:662
-
VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition vk_mem_alloc.h:1296
+
@ VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT
Definition vk_mem_alloc.h:672
+
VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition vk_mem_alloc.h:1310

For more examples of creating different kinds of resources, see chapter Recommended usage patterns. See also: Memory mapping.

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 deprecated.
@@ -137,10 +164,10 @@

VkBuffer buffer;
VmaAllocation allocation;
vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
-
@ 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:613
-
@ VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
Definition vk_mem_alloc.h:674
-
VkMemoryPropertyFlags preferredFlags
Flags that preferably should be set in a memory type chosen for an allocation.
Definition vk_mem_alloc.h:1312
-
VkMemoryPropertyFlags requiredFlags
Flags that must be set in a Memory Type chosen for an allocation.
Definition vk_mem_alloc.h:1307
+
@ 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:623
+
@ VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
Definition vk_mem_alloc.h:684
+
VkMemoryPropertyFlags preferredFlags
Flags that preferably should be set in a memory type chosen for an allocation.
Definition vk_mem_alloc.h:1326
+
VkMemoryPropertyFlags requiredFlags
Flags that must be set in a Memory Type chosen for an allocation.
Definition vk_mem_alloc.h:1321

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).

@@ -155,7 +182,7 @@

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:1320
+
uint32_t memoryTypeBits
Bitmask containing one bit set for every memory type acceptable for this allocation.
Definition vk_mem_alloc.h:1334

You can also use this parameter to exclude some memory types. If you inspect memory heaps and types available on the current physical device and you determine that for some reason you don't want to use a specific memory type for the allocation, you can enable automatic memory type selection but exclude certain memory type or types by setting all bits of memoryTypeBits to 1 except the ones you choose.

// ...
uint32_t excludedMemoryTypeIndex = 2;
@@ -178,7 +205,7 @@

diff --git a/docs/html/classes.html b/docs/html/classes.html index 489d8b97..beb816da 100644 --- a/docs/html/classes.html +++ b/docs/html/classes.html @@ -3,17 +3,21 @@ - + Vulkan Memory Allocator: Class Index - - + + @@ -31,22 +35,45 @@ - + - + +
@@ -83,7 +110,7 @@
diff --git a/docs/html/clipboard.js b/docs/html/clipboard.js index 9da9f3ca..6a0f42cd 100644 --- a/docs/html/clipboard.js +++ b/docs/html/clipboard.js @@ -32,7 +32,7 @@ let clipboard_icon = `` let clipboard_successDuration = 1000 -$(function() { +document.addEventListener('DOMContentLoaded', function() { if(navigator.clipboard) { const fragments = document.getElementsByClassName("fragment") for(const fragment of fragments) { @@ -40,7 +40,7 @@ $(function() { clipboard_div.classList.add("clipboard") clipboard_div.innerHTML = clipboard_icon clipboard_div.title = clipboard_title - $(clipboard_div).click(function() { + clipboard_div.addEventListener('click', function() { const content = this.parentNode.cloneNode(true) // filter out line number and folded fragments from file listings content.querySelectorAll(".lineno, .ttc, .foldclosed").forEach((node) => { node.remove() }) diff --git a/docs/html/codefolding.js b/docs/html/codefolding.js new file mode 100644 index 00000000..5b55e8b6 --- /dev/null +++ b/docs/html/codefolding.js @@ -0,0 +1,143 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2026 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ + +let codefold = { + opened : true, + + show_plus : function(el) { + if (el) { + el.classList.remove('minus'); + el.classList.add('plus'); + } + }, + + show_minus : function(el) { + if (el) { + el.classList.add('minus'); + el.classList.remove('plus'); + } + }, + + // toggle all folding blocks + toggle_all : function() { + if (this.opened) { + const foldAll = document.getElementById('fold_all'); + this.show_plus(foldAll); + document.querySelectorAll('div[id^=foldopen]').forEach(el => el.style.display = 'none'); + document.querySelectorAll('div[id^=foldclosed]').forEach(el => el.style.display = ''); + document.querySelectorAll('div[id^=foldclosed] span.fold').forEach(el => this.show_plus(el)); + } else { + const foldAll = document.getElementById('fold_all'); + this.show_minus(foldAll); + document.querySelectorAll('div[id^=foldopen]').forEach(el => el.style.display = ''); + document.querySelectorAll('div[id^=foldclosed]').forEach(el => el.style.display = 'none'); + } + this.opened=!this.opened; + }, + + // toggle single folding block + toggle : function(id) { + const openEl = document.getElementById('foldopen'+id); + const closedEl = document.getElementById('foldclosed'+id); + if (openEl) { + openEl.style.display = openEl.style.display === 'none' ? '' : 'none'; + const nextEl = openEl.nextElementSibling; + if (nextEl) { + nextEl.querySelectorAll('span.fold').forEach(el => this.show_plus(el)); + } + } + if (closedEl) { + closedEl.style.display = closedEl.style.display === 'none' ? '' : 'none'; + } + }, + + init : function() { + // add code folding line and global control + document.querySelectorAll('span.lineno').forEach((el, index) => { + el.style.paddingRight = '4px'; + el.style.marginRight = '2px'; + el.style.display = 'inline-block'; + el.style.width = '54px'; + el.style.background = 'linear-gradient(var(--fold-line-color),var(--fold-line-color)) no-repeat 46px/2px 100%'; + const span = document.createElement('span'); + if (index === 0) { // add global toggle to first line + span.className = 'fold minus'; + span.id = 'fold_all'; + span.onclick = () => codefold.toggle_all(); + } else { // add vertical lines to other rows + span.className = 'fold' + } + el.appendChild(span); + }); + // add toggle controls to lines with fold divs + document.querySelectorAll('div.foldopen').forEach(el => { + // extract specific id to use + const id = el.getAttribute('id').replace('foldopen',''); + // extract start and end foldable fragment attributes + const start = el.getAttribute('data-start'); + const end = el.getAttribute('data-end'); + // replace normal fold span with controls for the first line of a foldable fragment + const firstFold = el.querySelector('span.fold'); + if (firstFold) { + const span = document.createElement('span'); + span.className = 'fold minus'; + span.onclick = () => codefold.toggle(id); + firstFold.replaceWith(span); + } + // append div for folded (closed) representation + const closedDiv = document.createElement('div'); + closedDiv.id = 'foldclosed'+id; + closedDiv.className = 'foldclosed'; + closedDiv.style.display = 'none'; + el.after(closedDiv); + // extract the first line from the "open" section to represent closed content + const line = el.children[0] ? el.children[0].cloneNode(true) : null; + if (line) { + // remove any glow that might still be active on the original line + line.classList.remove('glow'); + if (start) { + // if line already ends with a start marker (e.g. trailing {), remove it + line.innerHTML = line.innerHTML.replace(new RegExp('\\s*'+start+'\\s*$','g'),''); + } + // replace minus with plus symbol + line.querySelectorAll('span.fold').forEach(span => { + codefold.show_plus(span); + // re-apply click handler as it is not copied with cloneNode + span.onclick = () => codefold.toggle(id); + }); + // append ellipsis + const ellipsisLink = document.createElement('a'); + ellipsisLink.href = "javascript:codefold.toggle('"+id+"')"; + ellipsisLink.innerHTML = '…'; + line.appendChild(document.createTextNode(' '+start)); + line.appendChild(ellipsisLink); + line.appendChild(document.createTextNode(end)); + // insert constructed line into closed div + closedDiv.appendChild(line); + } + }); + }, +}; +/* @license-end */ diff --git a/docs/html/configuration.html b/docs/html/configuration.html index 546dad53..e5b15ee2 100644 --- a/docs/html/configuration.html +++ b/docs/html/configuration.html @@ -3,17 +3,21 @@ - + Vulkan Memory Allocator: Configuration - - + + @@ -31,22 +35,45 @@ - + - + +
diff --git a/docs/html/custom_memory_pools.html b/docs/html/custom_memory_pools.html index 66eb8ca7..a6e98e2c 100644 --- a/docs/html/custom_memory_pools.html +++ b/docs/html/custom_memory_pools.html @@ -3,17 +3,21 @@ - + Vulkan Memory Allocator: Custom memory pools - - + + @@ -31,22 +35,45 @@ - + - + +
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)
Creates a new VkBuffer, allocates and binds memory for it.
VkResult vmaFindMemoryTypeIndexForBufferInfo(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
-
@ VMA_MEMORY_USAGE_AUTO
Definition vk_mem_alloc.h:553
-
Parameters of new VmaAllocation.
Definition vk_mem_alloc.h:1294
-
VmaPool pool
Pool that this allocation should be created in.
Definition vk_mem_alloc.h:1326
-
VmaMemoryUsage usage
Intended usage of memory.
Definition vk_mem_alloc.h:1302
+
@ VMA_MEMORY_USAGE_AUTO
Definition vk_mem_alloc.h:563
+
Parameters of new VmaAllocation.
Definition vk_mem_alloc.h:1308
+
VmaPool pool
Pool that this allocation should be created in.
Definition vk_mem_alloc.h:1340
+
VmaMemoryUsage usage
Intended usage of memory.
Definition vk_mem_alloc.h:1316
Represents single memory allocation.
-
Describes parameter of created VmaPool.
Definition vk_mem_alloc.h:1358
-
uint32_t memoryTypeIndex
Vulkan memory type index to allocate this pool from.
Definition vk_mem_alloc.h:1361
-
VkDeviceSize blockSize
Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes....
Definition vk_mem_alloc.h:1374
-
size_t maxBlockCount
Maximum number of blocks that can be allocated in this pool. Optional.
Definition vk_mem_alloc.h:1387
+
Describes parameter of created VmaPool.
Definition vk_mem_alloc.h:1372
+
uint32_t memoryTypeIndex
Vulkan memory type index to allocate this pool from.
Definition vk_mem_alloc.h:1375
+
VkDeviceSize blockSize
Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes....
Definition vk_mem_alloc.h:1388
+
size_t maxBlockCount
Maximum number of blocks that can be allocated in this pool. Optional.
Definition vk_mem_alloc.h:1401
Represents custom memory pool.

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

vmaDestroyBuffer(allocator, buf, alloc);
@@ -227,7 +254,7 @@

diff --git a/docs/html/debugging_memory_usage.html b/docs/html/debugging_memory_usage.html index 22f08433..645ab174 100644 --- a/docs/html/debugging_memory_usage.html +++ b/docs/html/debugging_memory_usage.html @@ -3,17 +3,21 @@ - + Vulkan Memory Allocator: Debugging incorrect memory usage - - + + @@ -31,22 +35,45 @@ - + - + +
diff --git a/docs/html/defragmentation.html b/docs/html/defragmentation.html index 24282ac2..a6b10f6a 100644 --- a/docs/html/defragmentation.html +++ b/docs/html/defragmentation.html @@ -3,17 +3,21 @@ - + Vulkan Memory Allocator: Defragmentation - - + + @@ -31,22 +35,45 @@ - + - + +
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:770
-
Definition vk_mem_alloc.h:1432
-
void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition vk_mem_alloc.h:1479
+
@ VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT
Definition vk_mem_alloc.h:780
+
Definition vk_mem_alloc.h:1446
+
void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition vk_mem_alloc.h:1493
An opaque object that represents started defragmentation process.
-
Parameters for defragmentation.
Definition vk_mem_alloc.h:1522
-
VmaPool pool
Custom pool to be defragmented.
Definition vk_mem_alloc.h:1529
-
VmaDefragmentationFlags flags
Use combination of VmaDefragmentationFlagBits.
Definition vk_mem_alloc.h:1524
-
VmaAllocation srcAllocation
Allocation that should be moved.
Definition vk_mem_alloc.h:1555
-
VmaAllocation dstTmpAllocation
Temporary allocation pointing to destination memory that will replace srcAllocation.
Definition vk_mem_alloc.h:1562
-
Parameters for incremental defragmentation steps.
Definition vk_mem_alloc.h:1570
-
uint32_t moveCount
Number of elements in the pMoves array.
Definition vk_mem_alloc.h:1572
-
VmaDefragmentationMove * pMoves
Array of moves to be performed by the user in the current defragmentation pass.
Definition vk_mem_alloc.h:1596
+
Parameters for defragmentation.
Definition vk_mem_alloc.h:1536
+
VmaPool pool
Custom pool to be defragmented.
Definition vk_mem_alloc.h:1543
+
VmaDefragmentationFlags flags
Use combination of VmaDefragmentationFlagBits.
Definition vk_mem_alloc.h:1538
+
VmaAllocation srcAllocation
Allocation that should be moved.
Definition vk_mem_alloc.h:1569
+
VmaAllocation dstTmpAllocation
Temporary allocation pointing to destination memory that will replace srcAllocation.
Definition vk_mem_alloc.h:1576
+
Parameters for incremental defragmentation steps.
Definition vk_mem_alloc.h:1584
+
uint32_t moveCount
Number of elements in the pMoves array.
Definition vk_mem_alloc.h:1586
+
VmaDefragmentationMove * pMoves
Array of moves to be performed by the user in the current defragmentation pass.
Definition vk_mem_alloc.h:1610

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: