From 727e8b269f71d7d3c20a2cc61c2040ec94f0d330 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Mon, 12 Mar 2018 15:34:32 +0100 Subject: [PATCH] More documentation. Refactored table of contents. --- docs/html/general_considerations.html | 104 +++++++++++ docs/html/index.html | 58 +++++-- docs/html/pages.html | 1 + docs/html/quick_start.html | 4 +- docs/html/search/all_c.js | 3 +- docs/html/search/all_d.js | 1 - docs/html/search/pages_7.js | 2 +- docs/html/search/pages_9.html | 26 +++ docs/html/search/pages_9.js | 5 + docs/html/search/searchdata.js | 2 +- docs/html/statistics.html | 73 ++++++++ docs/html/vk__mem__alloc_8h_source.html | 218 ++++++++++++------------ src/vk_mem_alloc.h | 46 +++-- 13 files changed, 405 insertions(+), 138 deletions(-) create mode 100644 docs/html/general_considerations.html create mode 100644 docs/html/search/pages_9.html create mode 100644 docs/html/search/pages_9.js create mode 100644 docs/html/statistics.html diff --git a/docs/html/general_considerations.html b/docs/html/general_considerations.html new file mode 100644 index 0000000..2353a62 --- /dev/null +++ b/docs/html/general_considerations.html @@ -0,0 +1,104 @@ + + + + + + + +Vulkan Memory Allocator: General considerations + + + + + + + + + +
+
+ + + + + + +
+
Vulkan Memory Allocator +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
General considerations
+
+
+

+Thread safety

+
    +
  • The library has no global state, so separate VmaAllocator objects can be used independently. There should be no need to create multiple such objects though - one per VkDevice is enough.
  • +
  • By default, all calls to functions that take VmaAllocator as first parameter are safe to call from multiple threads simultaneously because they are synchronized internally when needed.
  • +
  • When the allocator is created with VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT flag, calls to functions that take such VmaAllocator object must be synchronized externally.
  • +
  • Access to a VmaAllocation object must be externally synchronized. For example, you must not call vmaGetAllocationInfo() and vmaMapMemory() from different threads at the same time if you pass the same VmaAllocation object to these functions.
  • +
+

+Allocation algorithm

+

The library uses following algorithm for allocation, in order:

+
    +
  1. Try to find free range of memory in existing blocks.
  2. +
  3. If failed, try to create a new block of VkDeviceMemory, with preferred block size.
  4. +
  5. If failed, try to create such block with size/2, size/4, size/8.
  6. +
  7. If failed and VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flag was specified, try to find space in existing blocks, possilby making some other allocations lost.
  8. +
  9. If failed, try to allocate separate VkDeviceMemory for this allocation, just like when you use VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
  10. +
  11. If failed, choose other memory type that meets the requirements specified in VmaAllocationCreateInfo and go to point 1.
  12. +
  13. If failed, return VK_ERROR_OUT_OF_DEVICE_MEMORY.
  14. +
+

+Features not supported

+

Features deliberately excluded from the scope of this library:

+
    +
  • Data transfer - issuing commands that transfer data between buffers or images, any usage of VkCommandList or VkCommandQueue and related synchronization is responsibility of the user.
  • +
  • Support for any programming languages other than C/C++. Bindings to other languages are welcomed as external projects.
  • +
+
+ + + + diff --git a/docs/html/index.html b/docs/html/index.html index fc99c02..80749f3 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -66,29 +66,63 @@ $(function() {

Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved.
License: MIT

Documentation of all members: vk_mem_alloc.h

-

Table of contents:

+

+Table of contents