diff --git a/CHANGELOG.md b/CHANGELOG.md index 2795689..57472de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,9 @@ Major changes: Minor changes: -- Changed behavior of custom pools: `VmaPoolCreateInfo::blockSize` = 0 (default) now means that pool may use variable block sizes, just like default pools do. +- Changes in custom pools: + - Added new structure member `VmaPoolStats::blockCount`. + - Changed behavior of `VmaPoolCreateInfo::blockSize` = 0 (default) - it now means that pool may use variable block sizes, just like default pools do. - Improved logic of `vmaFindMemoryTypeIndex` for some cases, especially integrated GPUs. - VulkanSample application: Removed dependency on external library MathFu. Added own vector and matrix structures. - Code changes that improve compatibility with various platforms, including: Visual Studio 2012, 32-bit code, C compilers. diff --git a/bin/VmaReplay_Release_vs2015.exe b/bin/VmaReplay_Release_vs2015.exe index 6613d41..ab644a5 100644 Binary files a/bin/VmaReplay_Release_vs2015.exe and b/bin/VmaReplay_Release_vs2015.exe differ diff --git a/bin/VulkanSample_Release_vs2015.exe b/bin/VulkanSample_Release_vs2015.exe index 104e15f..a8b2014 100644 Binary files a/bin/VulkanSample_Release_vs2015.exe and b/bin/VulkanSample_Release_vs2015.exe differ diff --git a/docs/html/custom_memory_pools.html b/docs/html/custom_memory_pools.html index 8b7e428..35197c6 100644 --- a/docs/html/custom_memory_pools.html +++ b/docs/html/custom_memory_pools.html @@ -101,19 +101,20 @@ Linear allocation algorithm Linear allocation algorithm

With this one flag, you can create a custom pool that can be used in many ways: free-at-once, stack, double stack, and ring buffer. See below for details.

-

Pools with linear algorithm must have only one memory block - VmaPoolCreateInfo::maxBlockCount must be 1.

Free-at-once

In a pool that uses linear algorithm, you still need to free all the allocations individually, e.g. by using vmaFreeMemory() or vmaDestroyBuffer(). You can free them in any order. New allocations are always made after last one - free space in the middle is not reused. However, when you release all the allocation and the pool becomes empty, allocation starts from the beginning again. This way you can use linear algorithm to speed up creation of allocations that you are going to release all at once.

Free-at-once
+

This mode is also available for pools created with VmaPoolCreateInfo::maxBlockCount value that allows multiple memory blocks.

Stack

When you free an allocation that was created last, its space can be reused. Thanks to this, if you always release allocations in the order opposite to their creation (LIFO - Last In First Out), you can achieve behavior of a stack.

Stack
+

This mode is also available for pools created with VmaPoolCreateInfo::maxBlockCount value that allows multiple memory blocks.

Double stack

The space reserved by a custom pool with linear algorithm may be used by two stacks:

@@ -122,10 +123,11 @@ Double stack
  • Second, "upper" one, growing down from the end towards lower offsets.
  • To make allocation from upper stack, add flag VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT to VmaAllocationCreateInfo::flags.

    -

    When the two stacks' ends meet so there is not enough space between them for a new allocation, such allocation fails with usual VK_ERROR_OUT_OF_DEVICE_MEMORY error.

    Double stack
    +

    Double stack is available only in pools with one memory block - VmaPoolCreateInfo::maxBlockCount must be 1. Otherwise behavior is undefined.

    +

    When the two stacks' ends meet so there is not enough space between them for a new allocation, such allocation fails with usual VK_ERROR_OUT_OF_DEVICE_MEMORY error.

    Ring buffer

    When you free some allocations from the beginning and there is not enough free space for a new one at the end of a pool, allocator's "cursor" wraps around to the beginning and starts allocation there. Thanks to this, if you always release allocations in the same order as you created them (FIFO - First In First Out), you can achieve behavior of a ring buffer / queue.

    @@ -136,7 +138,8 @@ Ring buffer
    Ring buffer with lost allocations
    - +

    Ring buffer is available only in pools with one memory block - VmaPoolCreateInfo::maxBlockCount must be 1. Otherwise behavior is undefined.

    +