Added documentation chapter: Frequenty asked questions
Some checks failed
Build code on Linux / linux (Debug, clang++-15, -stdlib=libc++, sudo apt install clang-15 libc++-15-dev libc++abi-15-dev) (push) Has been cancelled
Build code on Linux / linux (Debug, g++-12, sudo apt install g++-12) (push) Has been cancelled
Build code on Linux / linux (Release, clang++-15, -stdlib=libc++, sudo apt install clang-15 libc++-15-dev libc++abi-15-dev) (push) Has been cancelled
Build code on Linux / linux (Release, g++-12, sudo apt install g++-12) (push) Has been cancelled
Static code analysis (clang-tidy) / clang-tidy (push) Has been cancelled
Build code / Windows MSVC (Debug) (push) Has been cancelled
Build code / Windows MSVC (Release) (push) Has been cancelled

This commit is contained in:
Adam Sawicki 2025-04-14 18:09:25 +02:00
parent f378e7b3f1
commit 539c0a8d8e
29 changed files with 527 additions and 89 deletions

View file

@ -83,7 +83,7 @@ $(function(){ initResizable(false); });
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="index.html">Vulkan Memory Allocator</a></li> </ul>
<li class="navelem"><a class="el" href="index.html">Vulkan Memory Allocator</a></li><li class="navelem"><a class="el" href="faq.html">Frequenty asked questions</a></li> </ul>
</div>
</div><!-- top -->
<div id="doc-content">

View file

@ -45,6 +45,7 @@
<a href="enabling_buffer_device_address.html#enabling_buffer_device_address_initialization"/>
<a href="enabling_buffer_device_address.html#enabling_buffer_device_address_more_information"/>
<a href="enabling_buffer_device_address.html#enabling_buffer_device_address_usage"/>
<a href="faq.html"/>
<a href="files.html"/>
<a href="functions.html"/>
<a href="functions_vars.html"/>

176
docs/html/faq.html Normal file
View file

@ -0,0 +1,176 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.13.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Vulkan Memory Allocator: Frequenty asked questions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Vulkan Memory Allocator
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.13.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',false);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="index.html">Vulkan Memory Allocator</a></li> </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div><div class="header">
<div class="headertitle"><div class="title">Frequenty asked questions</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><b>What is VMA?</b></p>
<p>Vulkan(R) Memory Allocator (VMA) is a software library for developers who use the Vulkan graphics API in their code. It is written in C++.</p>
<p><b>What is the license of VMA?</b></p>
<p>VMA is licensed under MIT, which means it is open source and free software.</p>
<p><b>What is the purpose of VMA?</b></p>
<p>VMA helps with handling one aspect of Vulkan usage, which is device memory management - allocation of <code>VkDeviceMemory</code> objects, and creation of <code>VkBuffer</code> and <code>VkImage</code> objects.</p>
<p><b>Do I need to use VMA?</b></p>
<p>You don't need to, but it may be beneficial in many cases. Vulkan is a complex and low-level API, so libraries like this that abstract certain aspects of the API and bring them to a higher level are useful. When developing any non-trivial Vulkan application, you likely need to use a memory allocator. Using VMA can save time compared to implementing your own.</p>
<p><b>When should I not use VMA?</b></p>
<p>While VMA is useful for most applications that use the Vulkan API, there are cases when it may be a better choice not to use it. For example, if the application is very simple, e.g. serving as a sample or a learning exercise to help you understand or teach others the basics of Vulkan, and it creates only a small number of buffers and images, then including VMA may be an overkill. Developing your own memory allocator may also be a good learning exercise.</p>
<p><b>What are the benefits of using VMA?</b></p>
<ol type="1">
<li>VMA helps in choosing the optimal memory type for your resource (buffer or image). In Vulkan, we have a two-level hierarchy of memory heaps and types with different flags, and each device can expose a different set of those. Implementing logic that would select the best memory type on each platform is a non-trivial task. VMA does that, expecting only a high-level description of the intended usage of your resource. For more information, see <a class="el" href="choosing_memory_type.html">Choosing memory type</a>.</li>
<li>VMA allocates large blocks of <code>VkDeviceMemory</code> and sub-allocates parts of them for your resources. Allocating a new block of device memory may be a time-consuming operation. Some platforms also have a limit on the maximum number of those blocks (<code>VkPhysicalDeviceLimits::maxMemoryAllocationCount</code>) as low as 4096, so allocating a separate one for each resource is not an option. Sub-allocating parts of a memory block requires implementing an allocation algorithm, which is a non-trivial task. VMA does that, using an advanced and efficient algorithm that works well in various use cases.</li>
<li>VMA offers a simple API that allows creating buffers and textures within one function call. In Vulkan, the creation of a resource is a multi-step process. You need to create a <code>VkBuffer</code> or <code>VkImage</code>, ask it for memory requirements, allocate a <code>VkDeviceMemory</code> object, and finally bind the resource to the memory block. VMA does that automatically under a simple API within one function call: <a class="el" href="group__group__alloc.html#gac72ee55598617e8eecca384e746bab51" title="Creates a new VkBuffer, allocates and binds memory for it.">vmaCreateBuffer()</a>, <a class="el" href="group__group__alloc.html#ga02a94f25679275851a53e82eacbcfc73" title="Function similar to vmaCreateBuffer().">vmaCreateImage()</a>.</li>
</ol>
<p>The library is doing much more under the hood. For example, it respects limits like <code>bufferImageGranularity</code>, <code>nonCoherentAtomSize</code>, and <code>VkMemoryDedicatedRequirements</code> automatically, so you don't need to think about it.</p>
<p><b>Which version should I pick?</b></p>
<p>You can just pick <a href="https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator">the latest version from the "master" branch</a>. It is kept in a good shape most of the time, compiling and working correctly, with no compatibility-breaking changes and no unfinished code.</p>
<p>If you want an even more stable version, you can pick <a href="https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/releases">the latest official release</a>. Current code from the master branch is occasionally tagged as a release, with <a href="https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/blob/master/CHANGELOG.md">CHANGELOG</a> carefully curated to enumerate all important changes since the previous version.</p>
<p>The library uses <a href="https://semver.org/">Semantic Versioning</a>, which means versions that only differ in the patch number are forward and backward compatible (e.g., only fixing some bugs), while versions that differ in the minor number are backward compatible (e.g., only adding new functions to the API, but not removing or changing existing ones).</p>
<p><b>How to integrate it with my code?</b></p>
<p>VMA is an STB-style single-header C++ library.</p>
<p>You can pull the entire GitHub repository, e.g. using Git submodules. The repository contains ancillary files like the Cmake script, Doxygen config file, sample application, test suite, and others. You can compile it as a library and link with your project.</p>
<p>However, a simpler way is taking the single file "include/vk_mem_alloc.h" and including it in your project. This extensive file contains all you need: a copyright notice, declarations of the public library interface (API), its internal implementation, and even the documentation in form of Doxygen-style comments.</p>
<p>The "STB style" means not everything is implemented as inline functions in the header file. You need to extract the internal implementation using a special macro. This means that in every .cpp file where you need to use the library you should <code>#include "vk_mem_alloc.h"</code> to include its public interface, but additionally in exactly one .cpp file you should <code>#define VMA_IMPLEMENTATION</code> before this <code>#include</code> to enable its internal implementation. For more information, see <a class="el" href="quick_start.html#quick_start_project_setup">Project setup</a>.</p>
<p><b>Does the library work with C or C++?</b></p>
<p>The internal implementation of VMA is written in C++. It is distributed in the source format, so you need a compiler supporting at least C++14 to build it.</p>
<p>However, the public interface of the library is written in C - using only enums, structs, and global functions, in the same style as Vulkan, so you can use the library in the C code.</p>
<p><b>I am not a fan of modern C++. Can I still use it?</b></p>
<p>Very likely yes. We acknowledge that many C++ developers, especially in the games industry, do not appreciate all the latest features that the language has to offer.</p>
<ul>
<li>VMA doesn't throw or catch any C++ exceptions. It reports errors by returning a <code>VkResult</code> value instead, just like Vulkan. If you don't use exceptions in your project, your code is not exception-safe, or even if you disable exception handling in the compiler options, you can still use VMA.</li>
<li>VMA doesn't use C++ run-time type information like <code>typeid</code> or <code>dynamic_cast</code>, so if you disable RTTI in the compiler options, you can still use the library.</li>
<li>VMA uses only a limited subset of standard C and C++ library. It doesn't use STL containers like <code>std::vector</code>, <code>map</code>, or <code>string</code>, either in the public interface nor in the internal implementation. It implements its own containers instead.</li>
<li>If you don't use the default heap memory allocator through <code>malloc/free</code> or <code>new/delete</code> but implement your own allocator instead, you can pass it to VMA and the library will use your functions for every dynamic heap allocation made internally, as well as passing it further to Vulkan functions. For details, see <a class="el" href="configuration.html#custom_memory_allocator">Custom host memory allocator</a>.</li>
</ul>
<p><b>Is it available for other programming languages?</b></p>
<p>VMA is a C++ library with C interface in similar style as Vulkan. An object-oriented C++ wrapper or bindings to other programming languages are out of scope of this project, but they are welcome as external projects. Some of them are listed in <a href="https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator?tab=readme-ov-file#see-also">README.md, "See also" section</a>, including binding to C++, Python, Rust, and Haskell. Before using any of them, please check if they are still maintained and updated to use a recent version of VMA.</p>
<p><b>What platforms does it support?</b></p>
<p>VMA relies only on Vulkan and some parts of the standard C and C++ library, so it supports any platform where a C++ compiler and Vulkan are available. It is developed mostly on Microsoft(R) Windows(R), but it has been successfully used in Linux(R), MacOS, Android, and even FreeBSD and Raspberry Pi.</p>
<p><b>Does it only work on AMD GPUs?</b></p>
<p>No! While VMA is published by AMD, it works on any GPU that supports Vulkan, whether a discrete PC graphics card, a processor integrated graphics, or a mobile SoC. It doesn't give AMD GPUs any advantage over any other GPUs.</p>
<p><b>What Vulkan versions and extensions are supported?</b></p>
<p>VMA is updated to support the latest versions of Vulkan. It currently supports Vulkan up to 1.4. The library also supports older versions down to the first release of Vulkan 1.0. Defining a higher minimum version support would help simplify the code, but we acknowledge that developers on some platforms like Android still use older versions, so the support is provided for all of them.</p>
<p>Among many extensions available for Vulkan, only a few interact with memory management. VMA can automatically take advantage of them. Some of them are: VK_EXT_memory_budget, VK_EXT_memory_priority, VK_KHR_external_memory_win32, and VK_KHR_maintenance* extensions that are later promoted to the new versions of the core Vulkan API.</p>
<p>To use them, it is your responsibility to validate if they are available on the current system and if so, enable them while creating the Vulkan device object. You also need to pass appropriate <a class="el" href="group__group__init.html#ga4f87c9100d154a65a4ad495f7763cf7c" title="Flags for created VmaAllocator.">VmaAllocatorCreateFlagBits</a> to inform VMA that they are enabled. Then, the library will automatically take advantage of them. For more information and the full list of supported extensions, see <a class="el" href="quick_start.html#quick_start_initialization_enabling_extensions">Enabling extensions</a>.</p>
<p><b>Does it support other graphics APIs, like Microsoft DirectX(R) 12?</b></p>
<p>No, but we offer an equivalent library for DirectX 12: <a href="https://github.com/GPUOpen-LibrariesAndSDKs/D3D12MemoryAllocator">D3D12 Memory Allocator</a>. It uses the same core allocation algorithm. It also shares many features with VMA, like the support for custom pools and virtual allocator. However, it is not identical in terms of the features supported. Its API also looks different, because while the interface of VMA is similar in style to Vulkan, the interface of D3D12MA is similar to DirectX 12.</p>
<p><b>Is the library lightweight?</b></p>
<p>It depends on how you define it. VMA is implemented with high-performance and real-time applications like video games in mind. The CPU performance overhead of using this library is low. It uses a high-quality allocation algorithm called Two-Level Segregated Fit (TLSF), which in most cases can find a free place for a new allocation in few steps. The library also doesn't perform too many CPU heap allocations. In many cases, the allocation happens with 0 new CPU heap allocations performed by the library. Even the creation of a <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> object doesn't typically feature an CPU allocation, because these objects are returned out of a dedicated memory pool.</p>
<p>On the other hand, however, VMA needs some extra memory and extra time to maintain the metadata about the occupied and free regions of the memory blocks, and the algorithms and data structures used must be generic enough to work well in most cases. If you develop your program for a very resource-constrained platform, a custom allocator simpler than VMA may be a better choice.</p>
<p><b>Does it have a documentation?</b></p>
<p>Yes! VMA comes with full documentation of all elements of the API (functions, structures, enums), as well as many generic chapters that provide an introduction, describe core concepts of the library, good practices, etc. The entire documentation is written in form of code comments inside "vk_mem_alloc.h", in Doxygen format. You can access it in multiple ways:</p>
<ul>
<li>Browsable online: <a href="https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/">https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/</a></li>
<li>Local HTML pages available after you clone the repository and open file "docs/html/index.html".</li>
<li>You can rebuild the documentation in HTML or some other format from the source code using Doxygen. Configuration file "Doxyfile" is part of the repository.</li>
<li>Finally, you can just read the comments preceding declarations of any public functions of the library.</li>
</ul>
<p><b>Is it a mature project?</b></p>
<p>Yes! The library is in development since June 2017, has over 1000 commits, over 400 issue tickets and pull requests (most of them resolved), and over 70 contributors. It is distributed together with Vulkan SDK. It is used by many software projects, including some large and popular ones like Qt or Blender, as well as some AAA games. According to the <a href="https://www.lunarg.com/2024-ecosystem-survey-progress-report-released/">LunarG 2024 Ecosystem Survey</a>, it is used by over 50% of Vulkan developers.</p>
<p><b>How can I contribute to the project?</b></p>
<p>If you have an idea for improvement or a feature request, you can go to <a href="https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator">the library repository</a> and create an Issue ticket, describing your idea. You can also implement it yourself by forking the repository, making changes to the code, and creating a Pull request.</p>
<p>If you want to ask a question, you can also create a ticket the same way. Before doing this, please make sure you read the relevant part of the Vulkan specification and VMA documentation, where you may find the answers to your question.</p>
<p>If you want to report a suspected bug, you can also create a ticket the same way. Before doing this, please put some effort into the investigation of whether the bug is really in the library and not in your code or in the Vulkan implementation (the GPU driver) on your platform:</p>
<ul>
<li>Enable Vulkan validation layer and make sure it is free from any errors.</li>
<li>Make sure <code>VMA_ASSERT</code> is defined to an implementation that can report a failure and not ignore it.</li>
<li>Try making your allocation using pure Vulkan functions rather than VMA and see if the bug persists.</li>
</ul>
<p><b>I found some compilation warnings. How can we fix them?</b></p>
<p>Seeing compiler warnings may be annoying to some developers, but it is a design decision to not fix all of them. Due to the nature of the C++ language, certain preprocessor macros can make some variables unused, function parameters unreferenced, or conditional expressions constant in some configurations. The code of this library should not be bigger or more complicated just to silence these warnings. It is recommended to disable such warnings instead. For more information, see <a class="el" href="general_considerations.html#general_considerations_features_not_supported">Features not supported</a>.</p>
<p>However, if you observe a warning that is really dangerous, e.g., about an implicit conversion from a larger to a smaller integer type, please report it and it will be fixed ASAP. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.0
</small></address>
</div><!-- doc-content -->
</body>
</html>

View file

@ -94,7 +94,7 @@ See also: <a href="https://gpuopen.com/gaming-product/vulkan-memory-allocator/">
<p><b>API documentation divided into groups:</b> <a href="topics.html">Topics</a></p>
<p><b>General documentation chapters:</b></p>
<ul>
<li><b>User guide</b><ul>
<li><a class="el" href="faq.html">Frequenty asked questions</a></li>
<li><a class="el" href="quick_start.html">Quick start</a><ul>
<li><a class="el" href="quick_start.html#quick_start_project_setup">Project setup</a></li>
<li><a class="el" href="quick_start.html#quick_start_initialization">Initialization</a></li>
@ -154,8 +154,6 @@ See also: <a href="https://gpuopen.com/gaming-product/vulkan-memory-allocator/">
</ul>
</li>
<li><a class="el" href="other_api_interop.html">Interop with other graphics APIs</a></li>
</ul>
</li>
<li><a class="el" href="usage_patterns.html">Recommended usage patterns</a><ul>
<li><a class="el" href="usage_patterns.html#usage_patterns_gpu_only">GPU-only resource</a></li>
<li><a class="el" href="usage_patterns.html#usage_patterns_staging_copy_upload">Staging copy for upload</a></li>

View file

@ -31,5 +31,6 @@ var searchData=
['and_20units_28',['Alignment and units',['../virtual_allocator.html#virtual_allocator_alignment_and_units',1,'']]],
['and_20user_20data_29',['Allocation names and user data',['../allocation_annotation.html',1,'index']]],
['apis_30',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]],
['at_20once_31',['Free-at-once',['../custom_memory_pools.html#linear_algorithm_free_at_once',1,'']]]
['asked_20questions_31',['Frequenty asked questions',['../faq.html',1,'index']]],
['at_20once_32',['Free-at-once',['../custom_memory_pools.html#linear_algorithm_free_at_once',1,'']]]
];

View file

@ -4,7 +4,7 @@ var searchData=
['to_20use_20custom_20pools_1',['When not to use custom pools',['../custom_memory_pools.html#custom_memory_pools_when_not_use',1,'']]],
['to_20vulkan_20functions_2',['Pointers to Vulkan functions',['../configuration.html#config_Vulkan_functions',1,'']]],
['total_3',['total',['../struct_vma_total_statistics.html#a76f1935f7101883f5bb2a03b6c5649d2',1,'VmaTotalStatistics']]],
['type_4',['Choosing memory type',['../choosing_memory_type.html',1,'index']]],
['type_4',['Choosing memory type',['../choosing_memory_type.html',1,'faq']]],
['type_20index_5',['Choosing memory type index',['../custom_memory_pools.html#custom_memory_pools_MemTypeIndex',1,'']]],
['types_6',['Explicit memory types',['../choosing_memory_type.html#choosing_memory_type_explicit_memory_types',1,'']]]
];

View file

@ -3,7 +3,7 @@ var searchData=
['cache_20flush_20and_20invalidate_0',['Cache flush and invalidate',['../memory_mapping.html#memory_mapping_cache_control',1,'']]],
['callbacks_1',['Device memory allocation callbacks',['../configuration.html#allocation_callbacks',1,'']]],
['cases_2',['Other use cases',['../usage_patterns.html#usage_patterns_other_use_cases',1,'']]],
['choosing_20memory_20type_3',['Choosing memory type',['../choosing_memory_type.html',1,'index']]],
['choosing_20memory_20type_3',['Choosing memory type',['../choosing_memory_type.html',1,'faq']]],
['choosing_20memory_20type_20index_4',['Choosing memory type index',['../custom_memory_pools.html#custom_memory_pools_MemTypeIndex',1,'']]],
['compatibility_5',['Versioning and compatibility',['../general_considerations.html#general_considerations_versioning_and_compatibility',1,'']]],
['configuration_6',['Configuration',['../configuration.html',1,'index']]],

View file

@ -7,5 +7,6 @@ var searchData=
['for_20budget_4',['Querying for budget',['../staying_within_budget.html#staying_within_budget_querying_for_budget',1,'']]],
['for_20upload_5',['Staging copy for upload',['../usage_patterns.html#usage_patterns_staging_copy_upload',1,'']]],
['free_20at_20once_6',['Free-at-once',['../custom_memory_pools.html#linear_algorithm_free_at_once',1,'']]],
['functions_7',['functions',['../memory_mapping.html#memory_mapping_copy_functions',1,'Copy functions'],['../quick_start.html#quick_start_initialization_importing_vulkan_functions',1,'Importing Vulkan functions'],['../memory_mapping.html#memory_mapping_mapping_functions',1,'Mapping functions'],['../configuration.html#config_Vulkan_functions',1,'Pointers to Vulkan functions']]]
['frequenty_20asked_20questions_7',['Frequenty asked questions',['../faq.html',1,'index']]],
['functions_8',['functions',['../memory_mapping.html#memory_mapping_copy_functions',1,'Copy functions'],['../quick_start.html#quick_start_initialization_importing_vulkan_functions',1,'Importing Vulkan functions'],['../memory_mapping.html#memory_mapping_mapping_functions',1,'Mapping functions'],['../configuration.html#config_Vulkan_functions',1,'Pointers to Vulkan functions']]]
];

View file

@ -17,7 +17,7 @@ var searchData=
['memory_20limit_14',['Device heap memory limit',['../configuration.html#heap_memory_limit',1,'']]],
['memory_20mapping_15',['Memory mapping',['../memory_mapping.html',1,'index']]],
['memory_20pools_16',['memory pools',['../custom_memory_pools.html',1,'Custom memory pools'],['../choosing_memory_type.html#choosing_memory_type_custom_memory_pools',1,'Custom memory pools']]],
['memory_20type_17',['Choosing memory type',['../choosing_memory_type.html',1,'index']]],
['memory_20type_17',['Choosing memory type',['../choosing_memory_type.html',1,'faq']]],
['memory_20type_20index_18',['Choosing memory type index',['../custom_memory_pools.html#custom_memory_pools_MemTypeIndex',1,'']]],
['memory_20types_19',['Explicit memory types',['../choosing_memory_type.html#choosing_memory_type_explicit_memory_types',1,'']]],
['memory_20usage_20',['memory usage',['../staying_within_budget.html#staying_within_budget_controlling_memory_usage',1,'Controlling memory usage'],['../debugging_memory_usage.html',1,'Debugging incorrect memory usage']]],

View file

@ -1,5 +1,6 @@
var searchData=
[
['querying_20for_20budget_0',['Querying for budget',['../staying_within_budget.html#staying_within_budget_querying_for_budget',1,'']]],
['quick_20start_1',['Quick start',['../quick_start.html',1,'index']]]
['questions_1',['Frequenty asked questions',['../faq.html',1,'index']]],
['quick_20start_2',['Quick start',['../quick_start.html',1,'index']]]
];

View file

@ -6,5 +6,6 @@ var searchData=
['allocator_3',['Vulkan Memory Allocator',['../index.html',1,'']]],
['allocator_4',['Virtual allocator',['../virtual_allocator.html',1,'index']]],
['and_20user_20data_5',['Allocation names and user data',['../allocation_annotation.html',1,'index']]],
['apis_6',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]]
['apis_6',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]],
['asked_20questions_7',['Frequenty asked questions',['../faq.html',1,'index']]]
];

View file

@ -1,6 +1,4 @@
var searchData=
[
['usage_0',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]],
['usage_20patterns_1',['Recommended usage patterns',['../usage_patterns.html',1,'index']]],
['user_20data_2',['Allocation names and user data',['../allocation_annotation.html',1,'index']]]
['type_0',['Choosing memory type',['../choosing_memory_type.html',1,'faq']]]
];

View file

@ -1,9 +1,6 @@
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_5fext_5fmemory_5fpriority_2',['VK_EXT_memory_priority',['../vk_ext_memory_priority.html',1,'index']]],
['vk_5fkhr_5fdedicated_5fallocation_3',['VK_KHR_dedicated_allocation',['../vk_khr_dedicated_allocation.html',1,'index']]],
['vk_5fkhr_5fexternal_5fmemory_5fwin32_4',['VK_KHR_external_memory_win32',['../vk_khr_external_memory_win32.html',1,'index']]],
['vulkan_20memory_20allocator_5',['Vulkan Memory Allocator',['../index.html',1,'']]]
['usage_0',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]],
['usage_20patterns_1',['Recommended usage patterns',['../usage_patterns.html',1,'index']]],
['user_20data_2',['Allocation names and user data',['../allocation_annotation.html',1,'index']]]
];

View file

@ -1,5 +1,9 @@
var searchData=
[
['with_20other_20graphics_20apis_0',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]],
['within_20budget_1',['Staying within budget',['../staying_within_budget.html',1,'index']]]
['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_5fext_5fmemory_5fpriority_2',['VK_EXT_memory_priority',['../vk_ext_memory_priority.html',1,'index']]],
['vk_5fkhr_5fdedicated_5fallocation_3',['VK_KHR_dedicated_allocation',['../vk_khr_dedicated_allocation.html',1,'index']]],
['vk_5fkhr_5fexternal_5fmemory_5fwin32_4',['VK_KHR_external_memory_win32',['../vk_khr_external_memory_win32.html',1,'index']]],
['vulkan_20memory_20allocator_5',['Vulkan Memory Allocator',['../index.html',1,'']]]
];

View file

@ -0,0 +1,5 @@
var searchData=
[
['with_20other_20graphics_20apis_0',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]],
['within_20budget_1',['Staying within budget',['../staying_within_budget.html',1,'index']]]
];

View file

@ -1,6 +1,6 @@
var searchData=
[
['choosing_20memory_20type_0',['Choosing memory type',['../choosing_memory_type.html',1,'index']]],
['choosing_20memory_20type_0',['Choosing memory type',['../choosing_memory_type.html',1,'faq']]],
['configuration_1',['Configuration',['../configuration.html',1,'index']]],
['considerations_2',['General considerations',['../general_considerations.html',1,'index']]],
['custom_20memory_20pools_3',['Custom memory pools',['../custom_memory_pools.html',1,'index']]]

View file

@ -1,5 +1,4 @@
var searchData=
[
['general_20considerations_0',['General considerations',['../general_considerations.html',1,'index']]],
['graphics_20apis_1',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]]
['frequenty_20asked_20questions_0',['Frequenty asked questions',['../faq.html',1,'index']]]
];

View file

@ -1,5 +1,5 @@
var searchData=
[
['incorrect_20memory_20usage_0',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]],
['interop_20with_20other_20graphics_20apis_1',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]]
['general_20considerations_0',['General considerations',['../general_considerations.html',1,'index']]],
['graphics_20apis_1',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]]
];

View file

@ -1,4 +1,5 @@
var searchData=
[
['list_0',['Deprecated List',['../deprecated.html',1,'']]]
['incorrect_20memory_20usage_0',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]],
['interop_20with_20other_20graphics_20apis_1',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]]
];

View file

@ -1,9 +1,4 @@
var searchData=
[
['mapping_0',['Memory mapping',['../memory_mapping.html',1,'index']]],
['memory_20allocator_1',['Vulkan Memory Allocator',['../index.html',1,'']]],
['memory_20mapping_2',['Memory mapping',['../memory_mapping.html',1,'index']]],
['memory_20pools_3',['Custom memory pools',['../custom_memory_pools.html',1,'index']]],
['memory_20type_4',['Choosing memory type',['../choosing_memory_type.html',1,'index']]],
['memory_20usage_5',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]]
['list_0',['Deprecated List',['../deprecated.html',1,'']]]
];

View file

@ -1,4 +1,9 @@
var searchData=
[
['names_20and_20user_20data_0',['Allocation names and user data',['../allocation_annotation.html',1,'index']]]
['mapping_0',['Memory mapping',['../memory_mapping.html',1,'index']]],
['memory_20allocator_1',['Vulkan Memory Allocator',['../index.html',1,'']]],
['memory_20mapping_2',['Memory mapping',['../memory_mapping.html',1,'index']]],
['memory_20pools_3',['Custom memory pools',['../custom_memory_pools.html',1,'index']]],
['memory_20type_4',['Choosing memory type',['../choosing_memory_type.html',1,'faq']]],
['memory_20usage_5',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]]
];

View file

@ -1,5 +1,4 @@
var searchData=
[
['other_20graphics_20apis_0',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]],
['overlap_1',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]]
['names_20and_20user_20data_0',['Allocation names and user data',['../allocation_annotation.html',1,'index']]]
];

View file

@ -1,5 +1,5 @@
var searchData=
[
['patterns_0',['Recommended usage patterns',['../usage_patterns.html',1,'index']]],
['pools_1',['Custom memory pools',['../custom_memory_pools.html',1,'index']]]
['other_20graphics_20apis_0',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]],
['overlap_1',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]]
];

View file

@ -1,4 +1,5 @@
var searchData=
[
['quick_20start_0',['Quick start',['../quick_start.html',1,'index']]]
['patterns_0',['Recommended usage patterns',['../usage_patterns.html',1,'index']]],
['pools_1',['Custom memory pools',['../custom_memory_pools.html',1,'index']]]
];

View file

@ -1,5 +1,5 @@
var searchData=
[
['recommended_20usage_20patterns_0',['Recommended usage patterns',['../usage_patterns.html',1,'index']]],
['resource_20aliasing_20overlap_1',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]]
['questions_0',['Frequenty asked questions',['../faq.html',1,'index']]],
['quick_20start_1',['Quick start',['../quick_start.html',1,'index']]]
];

View file

@ -1,6 +1,5 @@
var searchData=
[
['start_0',['Quick start',['../quick_start.html',1,'index']]],
['statistics_1',['Statistics',['../statistics.html',1,'index']]],
['staying_20within_20budget_2',['Staying within budget',['../staying_within_budget.html',1,'index']]]
['recommended_20usage_20patterns_0',['Recommended usage patterns',['../usage_patterns.html',1,'index']]],
['resource_20aliasing_20overlap_1',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]]
];

View file

@ -1,4 +1,6 @@
var searchData=
[
['type_0',['Choosing memory type',['../choosing_memory_type.html',1,'index']]]
['start_0',['Quick start',['../quick_start.html',1,'index']]],
['statistics_1',['Statistics',['../statistics.html',1,'index']]],
['staying_20within_20budget_2',['Staying within budget',['../staying_within_budget.html',1,'index']]]
];

View file

@ -9,7 +9,7 @@ var indexSectionsWithContent =
6: "v",
7: "v",
8: "ailmsv",
9: "abcdegilmnopqrstuvw"
9: "abcdefgilmnopqrstuvw"
};
var indexSectionNames =

View file

@ -37,48 +37,48 @@ See also: [product page on GPUOpen](https://gpuopen.com/gaming-product/vulkan-me
<b>General documentation chapters:</b>
- <b>User guide</b>
- \subpage quick_start
- [Project setup](@ref quick_start_project_setup)
- [Initialization](@ref quick_start_initialization)
- [Resource allocation](@ref quick_start_resource_allocation)
- \subpage choosing_memory_type
- [Usage](@ref choosing_memory_type_usage)
- [Required and preferred flags](@ref choosing_memory_type_required_preferred_flags)
- [Explicit memory types](@ref choosing_memory_type_explicit_memory_types)
- [Custom memory pools](@ref choosing_memory_type_custom_memory_pools)
- [Dedicated allocations](@ref choosing_memory_type_dedicated_allocations)
- \subpage memory_mapping
- [Copy functions](@ref memory_mapping_copy_functions)
- [Mapping functions](@ref memory_mapping_mapping_functions)
- [Persistently mapped memory](@ref memory_mapping_persistently_mapped_memory)
- [Cache flush and invalidate](@ref memory_mapping_cache_control)
- \subpage staying_within_budget
- [Querying for budget](@ref staying_within_budget_querying_for_budget)
- [Controlling memory usage](@ref staying_within_budget_controlling_memory_usage)
- \subpage resource_aliasing
- \subpage custom_memory_pools
- [Choosing memory type index](@ref custom_memory_pools_MemTypeIndex)
- [When not to use custom pools](@ref custom_memory_pools_when_not_use)
- [Linear allocation algorithm](@ref linear_algorithm)
- [Free-at-once](@ref linear_algorithm_free_at_once)
- [Stack](@ref linear_algorithm_stack)
- [Double stack](@ref linear_algorithm_double_stack)
- [Ring buffer](@ref linear_algorithm_ring_buffer)
- \subpage defragmentation
- \subpage statistics
- [Numeric statistics](@ref statistics_numeric_statistics)
- [JSON dump](@ref statistics_json_dump)
- \subpage allocation_annotation
- [Allocation user data](@ref allocation_user_data)
- [Allocation names](@ref allocation_names)
- \subpage virtual_allocator
- \subpage debugging_memory_usage
- [Memory initialization](@ref debugging_memory_usage_initialization)
- [Margins](@ref debugging_memory_usage_margins)
- [Corruption detection](@ref debugging_memory_usage_corruption_detection)
- [Leak detection features](@ref debugging_memory_usage_leak_detection)
- \subpage other_api_interop
- \subpage faq
- \subpage quick_start
- [Project setup](@ref quick_start_project_setup)
- [Initialization](@ref quick_start_initialization)
- [Resource allocation](@ref quick_start_resource_allocation)
- \subpage choosing_memory_type
- [Usage](@ref choosing_memory_type_usage)
- [Required and preferred flags](@ref choosing_memory_type_required_preferred_flags)
- [Explicit memory types](@ref choosing_memory_type_explicit_memory_types)
- [Custom memory pools](@ref choosing_memory_type_custom_memory_pools)
- [Dedicated allocations](@ref choosing_memory_type_dedicated_allocations)
- \subpage memory_mapping
- [Copy functions](@ref memory_mapping_copy_functions)
- [Mapping functions](@ref memory_mapping_mapping_functions)
- [Persistently mapped memory](@ref memory_mapping_persistently_mapped_memory)
- [Cache flush and invalidate](@ref memory_mapping_cache_control)
- \subpage staying_within_budget
- [Querying for budget](@ref staying_within_budget_querying_for_budget)
- [Controlling memory usage](@ref staying_within_budget_controlling_memory_usage)
- \subpage resource_aliasing
- \subpage custom_memory_pools
- [Choosing memory type index](@ref custom_memory_pools_MemTypeIndex)
- [When not to use custom pools](@ref custom_memory_pools_when_not_use)
- [Linear allocation algorithm](@ref linear_algorithm)
- [Free-at-once](@ref linear_algorithm_free_at_once)
- [Stack](@ref linear_algorithm_stack)
- [Double stack](@ref linear_algorithm_double_stack)
- [Ring buffer](@ref linear_algorithm_ring_buffer)
- \subpage defragmentation
- \subpage statistics
- [Numeric statistics](@ref statistics_numeric_statistics)
- [JSON dump](@ref statistics_json_dump)
- \subpage allocation_annotation
- [Allocation user data](@ref allocation_user_data)
- [Allocation names](@ref allocation_names)
- \subpage virtual_allocator
- \subpage debugging_memory_usage
- [Memory initialization](@ref debugging_memory_usage_initialization)
- [Margins](@ref debugging_memory_usage_margins)
- [Corruption detection](@ref debugging_memory_usage_corruption_detection)
- [Leak detection features](@ref debugging_memory_usage_leak_detection)
- \subpage other_api_interop
- \subpage usage_patterns
- [GPU-only resource](@ref usage_patterns_gpu_only)
- [Staging copy for upload](@ref usage_patterns_staging_copy_upload)
@ -16839,6 +16839,260 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaGetMemoryWin32Handle(VmaAllocator VMA_NOT
#endif // VMA_IMPLEMENTATION
/**
\page faq Frequenty asked questions
<b>What is VMA?</b>
Vulkan(R) Memory Allocator (VMA) is a software library for developers who use the Vulkan graphics API in their code.
It is written in C++.
<b>What is the license of VMA?</b>
VMA is licensed under MIT, which means it is open source and free software.
<b>What is the purpose of VMA?</b>
VMA helps with handling one aspect of Vulkan usage, which is device memory management -
allocation of `VkDeviceMemory` objects, and creation of `VkBuffer` and `VkImage` objects.
<b>Do I need to use VMA?</b>
You don't need to, but it may be beneficial in many cases.
Vulkan is a complex and low-level API, so libraries like this that abstract certain aspects of the API
and bring them to a higher level are useful.
When developing any non-trivial Vulkan application, you likely need to use a memory allocator.
Using VMA can save time compared to implementing your own.
<b>When should I not use VMA?</b>
While VMA is useful for most applications that use the Vulkan API, there are cases
when it may be a better choice not to use it.
For example, if the application is very simple, e.g. serving as a sample or a learning exercise
to help you understand or teach others the basics of Vulkan,
and it creates only a small number of buffers and images, then including VMA may be an overkill.
Developing your own memory allocator may also be a good learning exercise.
<b>What are the benefits of using VMA?</b>
-# VMA helps in choosing the optimal memory type for your resource (buffer or image).
In Vulkan, we have a two-level hierarchy of memory heaps and types with different flags,
and each device can expose a different set of those.
Implementing logic that would select the best memory type on each platform is a non-trivial task.
VMA does that, expecting only a high-level description of the intended usage of your resource.
For more information, see \subpage choosing_memory_type.
-# VMA allocates large blocks of `VkDeviceMemory` and sub-allocates parts of them for your resources.
Allocating a new block of device memory may be a time-consuming operation.
Some platforms also have a limit on the maximum number of those blocks (`VkPhysicalDeviceLimits::maxMemoryAllocationCount`)
as low as 4096, so allocating a separate one for each resource is not an option.
Sub-allocating parts of a memory block requires implementing an allocation algorithm,
which is a non-trivial task.
VMA does that, using an advanced and efficient algorithm that works well in various use cases.
-# VMA offers a simple API that allows creating buffers and textures within one function call.
In Vulkan, the creation of a resource is a multi-step process.
You need to create a `VkBuffer` or `VkImage`, ask it for memory requirements,
allocate a `VkDeviceMemory` object, and finally bind the resource to the memory block.
VMA does that automatically under a simple API within one function call: vmaCreateBuffer(), vmaCreateImage().
The library is doing much more under the hood.
For example, it respects limits like `bufferImageGranularity`, `nonCoherentAtomSize`,
and `VkMemoryDedicatedRequirements` automatically, so you don't need to think about it.
<b>Which version should I pick?</b>
You can just pick [the latest version from the "master" branch](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator).
It is kept in a good shape most of the time, compiling and working correctly,
with no compatibility-breaking changes and no unfinished code.
If you want an even more stable version, you can pick
[the latest official release](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/releases).
Current code from the master branch is occasionally tagged as a release,
with [CHANGELOG](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/blob/master/CHANGELOG.md)
carefully curated to enumerate all important changes since the previous version.
The library uses [Semantic Versioning](https://semver.org/),
which means versions that only differ in the patch number are forward and backward compatible
(e.g., only fixing some bugs), while versions that differ in the minor number are backward compatible
(e.g., only adding new functions to the API, but not removing or changing existing ones).
<b>How to integrate it with my code?</b>
VMA is an STB-style single-header C++ library.
You can pull the entire GitHub repository, e.g. using Git submodules.
The repository contains ancillary files like the Cmake script, Doxygen config file,
sample application, test suite, and others.
You can compile it as a library and link with your project.
However, a simpler way is taking the single file "include/vk_mem_alloc.h" and including it in your project.
This extensive file contains all you need: a copyright notice,
declarations of the public library interface (API), its internal implementation,
and even the documentation in form of Doxygen-style comments.
The "STB style" means not everything is implemented as inline functions in the header file.
You need to extract the internal implementation using a special macro.
This means that in every .cpp file where you need to use the library you should
`#include "vk_mem_alloc.h"` to include its public interface,
but additionally in exactly one .cpp file you should `#define VMA_IMPLEMENTATION`
before this `#include` to enable its internal implementation.
For more information, see [Project setup](@ref quick_start_project_setup).
<b>Does the library work with C or C++?</b>
The internal implementation of VMA is written in C++.
It is distributed in the source format, so you need a compiler supporting at least C++14 to build it.
However, the public interface of the library is written in C - using only enums, structs, and global functions,
in the same style as Vulkan, so you can use the library in the C code.
<b>I am not a fan of modern C++. Can I still use it?</b>
Very likely yes.
We acknowledge that many C++ developers, especially in the games industry,
do not appreciate all the latest features that the language has to offer.
- VMA doesn't throw or catch any C++ exceptions.
It reports errors by returning a `VkResult` value instead, just like Vulkan.
If you don't use exceptions in your project, your code is not exception-safe,
or even if you disable exception handling in the compiler options, you can still use VMA.
- VMA doesn't use C++ run-time type information like `typeid` or `dynamic_cast`,
so if you disable RTTI in the compiler options, you can still use the library.
- VMA uses only a limited subset of standard C and C++ library.
It doesn't use STL containers like `std::vector`, `map`, or `string`,
either in the public interface nor in the internal implementation.
It implements its own containers instead.
- If you don't use the default heap memory allocator through `malloc/free` or `new/delete`
but implement your own allocator instead, you can pass it to VMA and
the library will use your functions for every dynamic heap allocation made internally,
as well as passing it further to Vulkan functions. For details, see [Custom host memory allocator](@ref custom_memory_allocator).
<b>Is it available for other programming languages?</b>
VMA is a C++ library with C interface in similar style as Vulkan.
An object-oriented C++ wrapper or bindings to other programming languages are out of scope of this project,
but they are welcome as external projects.
Some of them are listed in [README.md, "See also" section](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator?tab=readme-ov-file#see-also),
including binding to C++, Python, Rust, and Haskell.
Before using any of them, please check if they are still maintained and updated to use a recent version of VMA.
<b>What platforms does it support?</b>
VMA relies only on Vulkan and some parts of the standard C and C++ library,
so it supports any platform where a C++ compiler and Vulkan are available.
It is developed mostly on Microsoft(R) Windows(R),
but it has been successfully used in Linux(R), MacOS, Android, and even FreeBSD and Raspberry Pi.
<b>Does it only work on AMD GPUs?</b>
No! While VMA is published by AMD, it works on any GPU that supports Vulkan,
whether a discrete PC graphics card, a processor integrated graphics, or a mobile SoC.
It doesn't give AMD GPUs any advantage over any other GPUs.
<b>What Vulkan versions and extensions are supported?</b>
VMA is updated to support the latest versions of Vulkan.
It currently supports Vulkan up to 1.4.
The library also supports older versions down to the first release of Vulkan 1.0.
Defining a higher minimum version support would help simplify the code,
but we acknowledge that developers on some platforms like Android still use older versions,
so the support is provided for all of them.
Among many extensions available for Vulkan, only a few interact with memory management.
VMA can automatically take advantage of them. Some of them are:
VK_EXT_memory_budget, VK_EXT_memory_priority, VK_KHR_external_memory_win32, and VK_KHR_maintenance*
extensions that are later promoted to the new versions of the core Vulkan API.
To use them, it is your responsibility to validate if they are available on the current system and if so,
enable them while creating the Vulkan device object.
You also need to pass appropriate #VmaAllocatorCreateFlagBits to inform VMA that they are enabled.
Then, the library will automatically take advantage of them.
For more information and the full list of supported extensions, see [Enabling extensions](@ref quick_start_initialization_enabling_extensions).
<b>Does it support other graphics APIs, like Microsoft DirectX(R) 12?</b>
No, but we offer an equivalent library for DirectX 12:
[D3D12 Memory Allocator](https://github.com/GPUOpen-LibrariesAndSDKs/D3D12MemoryAllocator).
It uses the same core allocation algorithm.
It also shares many features with VMA, like the support for custom pools and virtual allocator.
However, it is not identical in terms of the features supported.
Its API also looks different, because while the interface of VMA is similar in style to Vulkan,
the interface of D3D12MA is similar to DirectX 12.
<b>Is the library lightweight?</b>
It depends on how you define it.
VMA is implemented with high-performance and real-time applications like video games in mind.
The CPU performance overhead of using this library is low.
It uses a high-quality allocation algorithm called Two-Level Segregated Fit (TLSF),
which in most cases can find a free place for a new allocation in few steps.
The library also doesn't perform too many CPU heap allocations.
In many cases, the allocation happens with 0 new CPU heap allocations performed by the library.
Even the creation of a #VmaAllocation object doesn't typically feature an CPU allocation,
because these objects are returned out of a dedicated memory pool.
On the other hand, however, VMA needs some extra memory and extra time
to maintain the metadata about the occupied and free regions of the memory blocks,
and the algorithms and data structures used must be generic enough to work well in most cases.
If you develop your program for a very resource-constrained platform,
a custom allocator simpler than VMA may be a better choice.
<b>Does it have a documentation?</b>
Yes! VMA comes with full documentation of all elements of the API (functions, structures, enums),
as well as many generic chapters that provide an introduction,
describe core concepts of the library, good practices, etc.
The entire documentation is written in form of code comments inside "vk_mem_alloc.h", in Doxygen format.
You can access it in multiple ways:
- Browsable online: https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/
- Local HTML pages available after you clone the repository and open file "docs/html/index.html".
- You can rebuild the documentation in HTML or some other format from the source code using Doxygen.
Configuration file "Doxyfile" is part of the repository.
- Finally, you can just read the comments preceding declarations of any public functions of the library.
<b>Is it a mature project?</b>
Yes! The library is in development since June 2017, has over 1000 commits, over 400 issue tickets
and pull requests (most of them resolved), and over 70 contributors.
It is distributed together with Vulkan SDK.
It is used by many software projects, including some large and popular ones like Qt or Blender,
as well as some AAA games.
According to the [LunarG 2024 Ecosystem Survey](https://www.lunarg.com/2024-ecosystem-survey-progress-report-released/),
it is used by over 50% of Vulkan developers.
<b>How can I contribute to the project?</b>
If you have an idea for improvement or a feature request,
you can go to [the library repository](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator)
and create an Issue ticket, describing your idea.
You can also implement it yourself by forking the repository, making changes to the code,
and creating a Pull request.
If you want to ask a question, you can also create a ticket the same way.
Before doing this, please make sure you read the relevant part of the Vulkan specification and VMA documentation,
where you may find the answers to your question.
If you want to report a suspected bug, you can also create a ticket the same way.
Before doing this, please put some effort into the investigation of whether the bug is really
in the library and not in your code or in the Vulkan implementation (the GPU driver) on your platform:
- Enable Vulkan validation layer and make sure it is free from any errors.
- Make sure `VMA_ASSERT` is defined to an implementation that can report a failure and not ignore it.
- Try making your allocation using pure Vulkan functions rather than VMA and see if the bug persists.
<b>I found some compilation warnings. How can we fix them?</b>
Seeing compiler warnings may be annoying to some developers,
but it is a design decision to not fix all of them.
Due to the nature of the C++ language, certain preprocessor macros can make some variables unused,
function parameters unreferenced, or conditional expressions constant in some configurations.
The code of this library should not be bigger or more complicated just to silence these warnings.
It is recommended to disable such warnings instead.
For more information, see [Features not supported](@ref general_considerations_features_not_supported).
However, if you observe a warning that is really dangerous, e.g.,
about an implicit conversion from a larger to a smaller integer type, please report it and it will be fixed ASAP.
\page quick_start Quick start
\section quick_start_project_setup Project setup