From 07a7deb09dc170bb1124a672b33db4b8e240b76f Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Tue, 17 Oct 2017 12:07:39 +0200 Subject: [PATCH] Improvements in documentation formatting. --- .../_v_k__k_h_r_dedicated_allocation.html | 2 + docs/html/custom_memory_pools.html | 26 +- docs/html/lost_allocations.html | 41 +-- docs/html/persistently_mapped_memory.html | 29 +- docs/html/quick_start.html | 27 +- docs/html/vk__mem__alloc_8h.html | 38 +-- docs/html/vk__mem__alloc_8h_source.html | 218 +++++++------- src/vk_mem_alloc.h | 283 ++++++++++-------- 8 files changed, 276 insertions(+), 388 deletions(-) diff --git a/docs/html/_v_k__k_h_r_dedicated_allocation.html b/docs/html/_v_k__k_h_r_dedicated_allocation.html index ca38bb3..fded3c2 100644 --- a/docs/html/_v_k__k_h_r_dedicated_allocation.html +++ b/docs/html/_v_k__k_h_r_dedicated_allocation.html @@ -82,6 +82,8 @@ $(function() {

Other members of this structure can be null as long as you leave VMA_STATIC_VULKAN_FUNCTIONS defined to 1, which is the default.

VmaVulkanFunctions vulkanFunctions = {};
(PFN_vkGetBufferMemoryRequirements2KHR)vkGetDeviceProcAddr(device, "vkGetBufferMemoryRequirements2KHR");
(PFN_vkGetImageMemoryRequirements2KHR)vkGetDeviceProcAddr(device, "vkGetImageMemoryRequirements2KHR");
VmaAllocatorCreateInfo allocatorInfo = {};
allocatorInfo.pVulkanFunctions = &vulkanFunctions;
// Fill other members of allocatorInfo...

3 . Use VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT flag when creating your VmaAllocator to inform the library that you enabled required extensions and you want the library to use them.

vmaCreateAllocator(&allocatorInfo, &allocator);

That's all. The extension will be automatically used whenever you create a buffer using vmaCreateBuffer() or image using vmaCreateImage().

+

When using the extension together with Vulkan Validation Layer, you will receive warnings like this:

vkBindBufferMemory(): Binding memory to buffer 0x33 but vkGetBufferMemoryRequirements() has not been called on that buffer.
+

It is OK, you should just ignore it. It happens because you use function vkGetBufferMemoryRequirements2KHR() instead of standard vkGetBufferMemoryRequirements(), while the validation layer seems to be unaware of it.

To learn more about this extension, see: