- Custom memory allocator
+- Configuration
- Thread safety
@@ -295,10 +297,16 @@ void MyBuffer::EnsureBuffer()
Configuration
-Please check "CONFIGURATION SECTION" in the code to find macros that you can define before each #include
of this file or change directly in this file to provide your own implementation of basic facilities like assert, min and max functions, mutex etc. C++ STL is used by default, but changing these allows you to get rid of any STL usage if you want, as many game developers tend to do.
+Please check "CONFIGURATION SECTION" in the code to find macros that you can define before each #include
of this file or change directly in this file to provide your own implementation of basic facilities like assert, min()
and max()
functions, mutex etc. C++ STL is used by default, but changing these allows you to get rid of any STL usage if you want, as many game developers tend to do.
-Custom memory allocator
-You can use custom memory allocator by filling optional member VmaAllocatorCreateInfo::pAllocationCallbacks. These functions will be passed to Vulkan, as well as used by the library itself to make any CPU-side allocations.
+Custom host memory allocator
+If you use custom allocator for CPU memory rather than default operator new
and delete
from C++, you can make this library using your allocator as well by filling optional member VmaAllocatorCreateInfo::pAllocationCallbacks. These functions will be passed to Vulkan, as well as used by the library itself to make any CPU-side allocations.
+
+Device memory allocation callbacks
+The library makes calls to vkAllocateMemory()
and vkFreeMemory()
internally. You can setup callbacks to be informed about these calls, e.g. for the purpose of gathering some statistics. To do it, fill optional member VmaAllocatorCreateInfo::pDeviceMemoryCallbacks.
+
+Device heap memory limit
+If you want to test how your program behaves with limited amount of Vulkan device memory available (without switching your graphics card to one that really has smaller VRAM), you can use a feature of this library intended for this purpose. To do it, fill optional member VmaAllocatorCreateInfo::pHeapSizeLimit.
Thread safety
diff --git a/docs/html/search/all_8.js b/docs/html/search/all_8.js
index 48da8dd..7e837ac 100644
--- a/docs/html/search/all_8.js
+++ b/docs/html/search/all_8.js
@@ -6,6 +6,7 @@ var searchData=
['pfn_5fvmafreedevicememoryfunction',['PFN_vmaFreeDeviceMemoryFunction',['../group__general.html#gaef2545dc2e9dd4f29ab9ba6ac6fe2f49',1,'vk_mem_alloc.h']]],
['pfnallocate',['pfnAllocate',['../struct_vma_device_memory_callbacks.html#a4f17f7b255101e733b44d5633aceabfb',1,'VmaDeviceMemoryCallbacks']]],
['pfnfree',['pfnFree',['../struct_vma_device_memory_callbacks.html#abe8a3328bbc916f6f712fdb6b299444c',1,'VmaDeviceMemoryCallbacks']]],
+ ['pheapsizelimit',['pHeapSizeLimit',['../struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b',1,'VmaAllocatorCreateInfo']]],
['physicaldevice',['physicalDevice',['../struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156',1,'VmaAllocatorCreateInfo']]],
['pmappeddata',['pMappedData',['../struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2',1,'VmaAllocationInfo']]],
['pool',['pool',['../struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150',1,'VmaAllocationCreateInfo']]],
diff --git a/docs/html/search/all_c.js b/docs/html/search/all_c.js
index 91686af..4c01446 100644
--- a/docs/html/search/all_c.js
+++ b/docs/html/search/all_c.js
@@ -1,7 +1,7 @@
var searchData=
[
['unusedbytes',['UnusedBytes',['../struct_vma_stat_info.html#a394d2aef4348cb58abf73764804b4f2d',1,'VmaStatInfo']]],
- ['unusedrangecount',['UnusedRangeCount',['../struct_vma_stat_info.html#a56c4fb4dba646479180b601854cde2a6',1,'VmaStatInfo::UnusedRangeCount()'],['../struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4',1,'VmaPoolStats::unusedRangeCount()']]],
+ ['unusedrangecount',['unusedRangeCount',['../struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4',1,'VmaPoolStats::unusedRangeCount()'],['../struct_vma_stat_info.html#a56c4fb4dba646479180b601854cde2a6',1,'VmaStatInfo::UnusedRangeCount()']]],
['unusedrangesizeavg',['UnusedRangeSizeAvg',['../struct_vma_stat_info.html#a88ad9bdc2b3a98964a4d0c338c0c9060',1,'VmaStatInfo']]],
['unusedrangesizemax',['UnusedRangeSizeMax',['../struct_vma_stat_info.html#a10c52c0841f01ca704e8ddb1ea6a635d',1,'VmaStatInfo']]],
['unusedrangesizemin',['UnusedRangeSizeMin',['../struct_vma_stat_info.html#a07c508f42a4d3424bd0c259784a7f2d6',1,'VmaStatInfo']]],
diff --git a/docs/html/search/variables_6.js b/docs/html/search/variables_6.js
index 2b404e1..9113c5c 100644
--- a/docs/html/search/variables_6.js
+++ b/docs/html/search/variables_6.js
@@ -4,6 +4,7 @@ var searchData=
['pdevicememorycallbacks',['pDeviceMemoryCallbacks',['../struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e',1,'VmaAllocatorCreateInfo']]],
['pfnallocate',['pfnAllocate',['../struct_vma_device_memory_callbacks.html#a4f17f7b255101e733b44d5633aceabfb',1,'VmaDeviceMemoryCallbacks']]],
['pfnfree',['pfnFree',['../struct_vma_device_memory_callbacks.html#abe8a3328bbc916f6f712fdb6b299444c',1,'VmaDeviceMemoryCallbacks']]],
+ ['pheapsizelimit',['pHeapSizeLimit',['../struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b',1,'VmaAllocatorCreateInfo']]],
['physicaldevice',['physicalDevice',['../struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156',1,'VmaAllocatorCreateInfo']]],
['pmappeddata',['pMappedData',['../struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2',1,'VmaAllocationInfo']]],
['pool',['pool',['../struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150',1,'VmaAllocationCreateInfo']]],
diff --git a/docs/html/search/variables_a.js b/docs/html/search/variables_a.js
index 91686af..4c01446 100644
--- a/docs/html/search/variables_a.js
+++ b/docs/html/search/variables_a.js
@@ -1,7 +1,7 @@
var searchData=
[
['unusedbytes',['UnusedBytes',['../struct_vma_stat_info.html#a394d2aef4348cb58abf73764804b4f2d',1,'VmaStatInfo']]],
- ['unusedrangecount',['UnusedRangeCount',['../struct_vma_stat_info.html#a56c4fb4dba646479180b601854cde2a6',1,'VmaStatInfo::UnusedRangeCount()'],['../struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4',1,'VmaPoolStats::unusedRangeCount()']]],
+ ['unusedrangecount',['unusedRangeCount',['../struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4',1,'VmaPoolStats::unusedRangeCount()'],['../struct_vma_stat_info.html#a56c4fb4dba646479180b601854cde2a6',1,'VmaStatInfo::UnusedRangeCount()']]],
['unusedrangesizeavg',['UnusedRangeSizeAvg',['../struct_vma_stat_info.html#a88ad9bdc2b3a98964a4d0c338c0c9060',1,'VmaStatInfo']]],
['unusedrangesizemax',['UnusedRangeSizeMax',['../struct_vma_stat_info.html#a10c52c0841f01ca704e8ddb1ea6a635d',1,'VmaStatInfo']]],
['unusedrangesizemin',['UnusedRangeSizeMin',['../struct_vma_stat_info.html#a07c508f42a4d3424bd0c259784a7f2d6',1,'VmaStatInfo']]],
diff --git a/docs/html/struct_vma_allocator_create_info-members.html b/docs/html/struct_vma_allocator_create_info-members.html
index 63f4c83..629a078 100644
--- a/docs/html/struct_vma_allocator_create_info-members.html
+++ b/docs/html/struct_vma_allocator_create_info-members.html
@@ -70,9 +70,10 @@ $(function() {
frameInUseCount | VmaAllocatorCreateInfo | |
pAllocationCallbacks | VmaAllocatorCreateInfo | |
pDeviceMemoryCallbacks | VmaAllocatorCreateInfo | |
- physicalDevice | VmaAllocatorCreateInfo | |
- preferredLargeHeapBlockSize | VmaAllocatorCreateInfo | |
- preferredSmallHeapBlockSize | VmaAllocatorCreateInfo | |
+ pHeapSizeLimit | VmaAllocatorCreateInfo | |
+ physicalDevice | VmaAllocatorCreateInfo | |
+ preferredLargeHeapBlockSize | VmaAllocatorCreateInfo | |
+ preferredSmallHeapBlockSize | VmaAllocatorCreateInfo | |