<divclass="textblock"><p>VK_KHR_dedicated_allocation is a Vulkan extension which can be used to improve performance on some GPUs. It augments Vulkan API with possibility to query driver whether it prefers particular buffer or image to have its own, dedicated allocation (separate <code>VkDeviceMemory</code> block) for better efficiency - to be able to do some internal optimizations.</p>
<p>The extension is supported by this library. It will be used automatically when enabled. To enable it:</p>
<p>1 . When creating Vulkan device, check if following 2 device extensions are supported (call <code>vkEnumerateDeviceExtensionProperties()</code>). If yes, enable them (fill <code>VkDeviceCreateInfo::ppEnabledExtensionNames</code>).</p>
<p>2 . Use <aclass="el"href="group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7cace7da7cc6e71a625dfa763c55a597878"title="Enables usage of VK_KHR_dedicated_allocation extension.">VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT</a> flag when creating your <aclass="el"href="struct_vma_allocator.html"title="Represents main object of this library initialized.">VmaAllocator</a>`to inform the library that you enabled required extensions and you want the library to use them.</p>
</div><!-- fragment --><p>That is all. The extension will be automatically used whenever you create a buffer using <aclass="el"href="group__group__alloc.html#gac72ee55598617e8eecca384e746bab51">vmaCreateBuffer()</a> or image using <aclass="el"href="group__group__alloc.html#ga02a94f25679275851a53e82eacbcfc73"title="Function similar to vmaCreateBuffer().">vmaCreateImage()</a>.</p>
<p>When using the extension together with Vulkan Validation Layer, you will receive warnings like this: </p><preclass="fragment">vkBindBufferMemory(): Binding memory to buffer 0x33 but vkGetBufferMemoryRequirements() has not been called on that buffer.
</pre><p> It is OK, you should just ignore it. It happens because you use function <code>vkGetBufferMemoryRequirements2KHR()</code> instead of standard <code>vkGetBufferMemoryRequirements()</code>, while the validation layer seems to be unaware of it.</p>
<li><ahref="https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/chap50.html#VK_KHR_dedicated_allocation">VK_KHR_dedicated_allocation in Vulkan specification</a></li>