From d08dc0cd6a12cb23d48c9d11ac00c8ffea6ad8ad Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Tue, 17 Oct 2017 11:27:14 +0200 Subject: [PATCH] Reorganized Doxygen documentation into more separate pages. --- docs/html/annotated.html | 6 +- docs/html/configuration.html | 94 + docs/html/custom_memory_pools.html | 113 + docs/html/defragmentation.html | 80 + docs/html/functions.html | 2 +- docs/html/functions_vars.html | 2 +- docs/html/globals.html | 152 +- docs/html/globals_defs.html | 2 +- docs/html/globals_enum.html | 10 +- docs/html/globals_eval.html | 42 +- docs/html/globals_func.html | 60 +- docs/html/globals_type.html | 48 +- docs/html/group__general.html | 92 +- docs/html/index.html | 240 +- docs/html/lost_allocations.html | 138 ++ docs/html/menudata.js | 2 +- docs/html/pages.html | 77 + docs/html/persistently_mapped_memory.html | 106 + docs/html/quick_start.html | 113 + docs/html/search/all_2.js | 5 +- docs/html/search/all_3.js | 6 +- docs/html/search/all_4.js | 3 +- docs/html/search/all_5.js | 4 +- docs/html/search/all_8.js | 5 +- docs/html/search/all_9.js | 2 +- docs/html/search/all_a.js | 2 +- docs/html/search/all_b.js | 2 +- docs/html/search/all_c.js | 10 +- docs/html/search/all_d.js | 93 +- docs/html/search/all_e.html | 26 + docs/html/search/all_e.js | 88 + docs/html/search/defines_0.html | 26 + docs/html/search/defines_0.js | 4 + docs/html/search/enums_0.js | 8 +- docs/html/search/enumvalues_0.js | 36 +- docs/html/search/functions_0.js | 60 +- docs/html/search/pages_0.js | 3 +- docs/html/search/pages_1.html | 26 + docs/html/search/pages_1.js | 4 + docs/html/search/pages_2.html | 26 + docs/html/search/pages_2.js | 4 + docs/html/search/pages_3.html | 26 + docs/html/search/pages_3.js | 4 + docs/html/search/pages_4.html | 26 + docs/html/search/pages_4.js | 4 + docs/html/search/pages_5.html | 26 + docs/html/search/pages_5.js | 4 + docs/html/search/pages_6.html | 26 + docs/html/search/pages_6.js | 4 + docs/html/search/searchdata.js | 10 +- docs/html/search/typedefs_0.js | 4 +- docs/html/search/typedefs_1.js | 36 +- docs/html/search/variables_3.js | 2 +- .../struct_vma_allocation_create_info.html | 14 +- docs/html/struct_vma_allocation_info.html | 18 +- ...uct_vma_allocator_create_info-members.html | 2 +- .../struct_vma_allocator_create_info.html | 18 +- .../html/struct_vma_defragmentation_info.html | 6 +- .../struct_vma_defragmentation_stats.html | 6 +- .../struct_vma_device_memory_callbacks.html | 10 +- docs/html/struct_vma_pool_create_info.html | 6 +- docs/html/struct_vma_pool_stats.html | 2 +- docs/html/struct_vma_stat_info.html | 2 +- docs/html/struct_vma_stats.html | 2 +- docs/html/struct_vma_vulkan_functions.html | 2 +- docs/html/thread_safety.html | 83 + docs/html/user_guide.html | 254 +++ docs/html/vk__mem__alloc_8h.html | 1994 +++++++++++++++-- docs/html/vk__mem__alloc_8h_source.html | 300 +-- src/vk_mem_alloc.h | 85 +- 70 files changed, 3769 insertions(+), 1029 deletions(-) create mode 100644 docs/html/configuration.html create mode 100644 docs/html/custom_memory_pools.html create mode 100644 docs/html/defragmentation.html create mode 100644 docs/html/lost_allocations.html create mode 100644 docs/html/pages.html create mode 100644 docs/html/persistently_mapped_memory.html create mode 100644 docs/html/quick_start.html create mode 100644 docs/html/search/all_e.html create mode 100644 docs/html/search/all_e.js create mode 100644 docs/html/search/defines_0.html create mode 100644 docs/html/search/defines_0.js create mode 100644 docs/html/search/pages_1.html create mode 100644 docs/html/search/pages_1.js create mode 100644 docs/html/search/pages_2.html create mode 100644 docs/html/search/pages_2.js create mode 100644 docs/html/search/pages_3.html create mode 100644 docs/html/search/pages_3.js create mode 100644 docs/html/search/pages_4.html create mode 100644 docs/html/search/pages_4.js create mode 100644 docs/html/search/pages_5.html create mode 100644 docs/html/search/pages_5.js create mode 100644 docs/html/search/pages_6.html create mode 100644 docs/html/search/pages_6.js create mode 100644 docs/html/thread_safety.html create mode 100644 docs/html/user_guide.html diff --git a/docs/html/annotated.html b/docs/html/annotated.html index f898f5a..ed46442 100644 --- a/docs/html/annotated.html +++ b/docs/html/annotated.html @@ -65,10 +65,10 @@ $(function() {
Here are the classes, structs, unions and interfaces with brief descriptions:
- + - - + + diff --git a/docs/html/configuration.html b/docs/html/configuration.html new file mode 100644 index 0000000..5b471d9 --- /dev/null +++ b/docs/html/configuration.html @@ -0,0 +1,94 @@ + + + + + + + +Vulkan Memory Allocator: Configuration + + + + + + + + + +
+
+
 CVmaAllocationCreateInfo
 CVmaAllocationInfoParameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo()
 CVmaAllocationInfoParameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo()
 CVmaAllocatorCreateInfoDescription of a Allocator to be created
 CVmaDefragmentationInfoOptional configuration parameters to be passed to function vmaDefragment()
 CVmaDefragmentationStatsStatistics returned by function vmaDefragment()
 CVmaDefragmentationInfoOptional configuration parameters to be passed to function vmaDefragment()
 CVmaDefragmentationStatsStatistics returned by function vmaDefragment()
 CVmaDeviceMemoryCallbacksSet of callbacks that the library will call for vkAllocateMemory and vkFreeMemory
 CVmaPoolCreateInfoDescribes parameter of created VmaPool
 CVmaPoolStatsDescribes parameter of existing VmaPool
+ + + + + +
+
Vulkan Memory Allocator +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + + +
+
+
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.

+

+Pointers to Vulkan functions

+

The library uses Vulkan functions straight from the vulkan.h header by default. If you want to provide your own pointers to these functions, e.g. fetched using vkGetInstanceProcAddr() and vkGetDeviceProcAddr():

+
    +
  1. Define VMA_STATIC_VULKAN_FUNCTIONS 0.
  2. +
  3. Provide valid pointers through VmaAllocatorCreateInfo::pVulkanFunctions.
  4. +
+

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

+
+ + + + diff --git a/docs/html/custom_memory_pools.html b/docs/html/custom_memory_pools.html new file mode 100644 index 0000000..ffaac60 --- /dev/null +++ b/docs/html/custom_memory_pools.html @@ -0,0 +1,113 @@ + + + + + + + +Vulkan Memory Allocator: Custom memory pools + + + + + + + + + +
+
+ + + + + + +
+
Vulkan Memory Allocator +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
Custom memory pools
+
+
+

The library automatically creates and manages default memory pool for each memory type available on the device. A pool contains a number of VkDeviceMemory blocks. You can create custom pool and allocate memory out of it. It can be useful if you want to:

+
    +
  • Keep certain kind of allocations separate from others.
  • +
  • Enforce particular size of Vulkan memory blocks.
  • +
  • Limit maximum amount of Vulkan memory allocated for that pool.
  • +
+

To use custom memory pools:

+
    +
  1. Fill VmaPoolCreateInfo structure.
  2. +
  3. Call vmaCreatePool() to obtain VmaPool handle.
  4. +
  5. When making an allocation, set VmaAllocationCreateInfo::pool to this handle. You don't need to specify any other parameters of this structure, like usage.
  6. +
+

Example:

+
.// Create a pool that could have at most 2 blocks, 128 MB each.
+VmaPoolCreateInfo poolCreateInfo = {};
+poolCreateInfo.memoryTypeIndex = ...
+poolCreateInfo.blockSize = 128ull * 1024 * 1024;
+poolCreateInfo.maxBlockCount = 2;
+
+VmaPool pool;
+vmaCreatePool(allocator, &poolCreateInfo, &pool);
+
+.// Allocate a buffer out of it.
+VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
+bufCreateInfo.size = 1024;
+bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+
+VmaAllocationCreateInfo allocCreateInfo = {};
+allocCreateInfo.pool = pool;
+
+VkBuffer buf;
+VmaAllocation alloc;
+VmaAllocationInfo allocInfo;
+vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);
+

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

+
vmaDestroyBuffer(allocator, buf, alloc);
+vmaDestroyPool(allocator, pool);
+ + + + diff --git a/docs/html/defragmentation.html b/docs/html/defragmentation.html new file mode 100644 index 0000000..6df573c --- /dev/null +++ b/docs/html/defragmentation.html @@ -0,0 +1,80 @@ + + + + + + + +Vulkan Memory Allocator: Defragmentation + + + + + + + + + +
+
+ + + + + + +
+
Vulkan Memory Allocator +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
Defragmentation
+
+
+

Interleaved allocations and deallocations of many objects of varying size can cause fragmentation, which can lead to a situation where the library is unable to find a continuous range of free memory for a new allocation despite there is enough free space, just scattered across many small free ranges between existing allocations.

+

To mitigate this problem, you can use vmaDefragment(). Given set of allocations, this function can move them to compact used memory, ensure more continuous free space and possibly also free some VkDeviceMemory. It can work only on allocations made from memory type that is HOST_VISIBLE. Allocations are modified to point to the new VkDeviceMemory and offset. Data in this memory is also memmove-ed to the new place. However, if you have images or buffers bound to these allocations (and you certainly do), you need to destroy, recreate, and bind them to the new place in memory.

+

For further details and example code, see documentation of function vmaDefragment().

+
+ + + + diff --git a/docs/html/functions.html b/docs/html/functions.html index d7cef82..bb64a0b 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -112,7 +112,7 @@ $(function() {

- f -