You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">pBuffer</td><td>Buffer that was created. </td></tr>
1638
1638
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">pAllocation</td><td>Allocation that was created. </td></tr>
1639
-
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">pAllocationInfo</td><td>Optional. Information about allocated memory. It can be later fetched using function<aclass="el" href="#ga86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a>.</td></tr>
1639
+
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">pAllocationInfo</td><td>Optional, can be null. Information about allocated memory. It can be also fetched later using<aclass="el" href="#ga86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a>.</td></tr>
<p>If any of these operations fail, buffer and allocation are not created, returned value is negative error code, <spanclass="tt">*pBuffer</span> and <spanclass="tt">*pAllocation</span> are null.</p>
1649
+
<p>If any of these operations fail, buffer and allocation are not created, returned value is negative error code, <spanclass="tt">*pBuffer</span> and <spanclass="tt">*pAllocation</span> are returned as null.</p>
1650
1650
<p>If the function succeeded, you must destroy both buffer and allocation when you no longer need them using either convenience function <aclass="el" href="#ga0d9f4e4ba5bf9aab1f1c746387753d77" title="Destroys Vulkan buffer and frees allocated memory.">vmaDestroyBuffer()</a> or separately, using <spanclass="tt">vkDestroyBuffer()</span> and <aclass="el" href="#ga11f0fbc034fa81a4efedd73d61ce7568" title="Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(),...">vmaFreeMemory()</a>.</p>
1651
-
<p>If <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 was used, VK_KHR_dedicated_allocation extension is used internally to query driver whether it requires or prefers the new buffer to have dedicated allocation. If yes, and if dedicated allocation is possible (<aclass="el" href="#ggad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff" title="Set this flag to only try to allocate from existing VkDeviceMemory blocks and never create new such b...">VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT</a> is not used), it creates dedicated allocation for this buffer, just like when using <aclass="el" href="#ggad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f" title="Set this flag if the allocation should have its own memory block.">VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT</a>.</p>
1652
-
<dlclass="section note"><dt>Note</dt><dd>This function creates a new <spanclass="tt">VkBuffer</span>. Sub-allocation of parts of one large buffer, although recommended as a good practice, is out of scope of this library and could be implemented by the user as a higher-level logic on top of VMA. </dd></dl>
1651
+
<p>If VK_KHR_dedicated_allocation extenion or Vulkan version >= 1.1 is used, the function queries the driver whether it requires or prefers the new buffer to have dedicated allocation. If yes, and if dedicated allocation is possible (<aclass="el" href="#ggad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff" title="Set this flag to only try to allocate from existing VkDeviceMemory blocks and never create new such b...">VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT</a> is not used), it creates dedicated allocation for this buffer, just like when using <aclass="el" href="#ggad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f" title="Set this flag if the allocation should have its own memory block.">VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT</a>.</p>
1652
+
<dlclass="section note"><dt>Note</dt><dd>This function creates a new <spanclass="tt">VkBuffer</span>. Sub-allocation of parts of one large buffer, although recommended as a good practice, is out of scope of this library and could be implemented by the user as a higher-level logic on top of VMA.</dd></dl>
1653
+
<p>There is also an extended version of this function available with additional parameter <spanclass="tt">minAlignment</span> - see <aclass="el" href="#gaa06a690013a0d01e60894ac378083834" title="Creates a buffer with additional minimum alignment.">vmaCreateBufferWithAlignment()</a>. </p>
0 commit comments