diff --git a/CHANGELOG.md b/CHANGELOG.md index 68cd499..17ee507 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 2.1.0-beta.1 (2018-08-24) +# 2.1.0-beta.1 (2018-08-27) Major release after many months of development in "development" branch and features branches. Many new features added, some bugs fixed. API stays backward-compatible. @@ -21,14 +21,17 @@ Major changes: - Changed format of JSON dump returned by `vmaBuildStatsString` (not backward compatible!). - Custom pools and memory blocks now have IDs that don't change after sorting. - Added properties: "CreationFrameIndex", "LastUseFrameIndex", "Usage". - - Changed behavior of `vmaGetAllocationInfo` and `vmaTouchAllocation` to update `allocation.lastUseFrameIndex` even if allocation cannot become lost. - Changed VmaDumpVis tool to use these new properties for better coloring. + - Changed behavior of `vmaGetAllocationInfo` and `vmaTouchAllocation` to update `allocation.lastUseFrameIndex` even if allocation cannot become lost. Minor changes: +- 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. +- Changes that improve compatibility with various platforms, including: Visual Studio 2012, 32-bit code, C compilers. - Changed usage of "VK_KHR_dedicated_allocation" extension in the code to be optional, driven by macro `VMA_DEDICATED_ALLOCATION`, for compatibility with Android. - Many additions and fixes in documentation, including description of new features, as well as "Validation layer warnings". - Other bugfixes. diff --git a/README.md b/README.md index dd3df78..7bd6d53 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ See **[Documentation](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAll # Software using this library +- **[Filament](https://github.com/google/filament)** - physically based rendering engine for Android, Windows, Linux and macOS, from Google. Apache License 2.0. - **[Anvil](https://github.com/GPUOpen-LibrariesAndSDKs/Anvil)** - cross-platform framework for Vulkan. License: MIT. - **[vkDOOM3](https://github.com/DustinHLand/vkDOOM3)** - Vulkan port of GPL DOOM 3 BFG Edition. License: GNU GPL. - **[Lightweight Java Game Library (LWJGL)](https://www.lwjgl.org/)** - includes binding of the library for Java. License: BSD. @@ -102,4 +103,5 @@ See **[Documentation](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAll - **[Awesome Vulkan](https://github.com/vinjn/awesome-vulkan)** - a curated list of awesome Vulkan libraries, debuggers and resources. - **[PyVMA](https://github.com/realitix/pyvma)** - Python wrapper for this library. Author: Jean-Sébastien B. (@realitix). License: Apache 2.0. +- **[vma_sample_sdl](https://github.com/rextimmy/vma_sample_sdl)** - SDL port of the sample app of this library (with the goal of running it on multiple platforms, including MacOS). Author: @rextimmy. License: MIT. - **[vulkan-malloc](https://github.com/dylanede/vulkan-malloc)** - Vulkan memory allocation library for Rust. Based on version 1 of this library. Author: Dylan Ede (@dylanede). License: MIT / Apache 2.0. diff --git a/bin/VmaReplay_Release_vs2015.exe b/bin/VmaReplay_Release_vs2015.exe index 6613d41..31f08ee 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..4d40827 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
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.
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.
This mode is also available for pools created with VmaPoolCreateInfo::maxBlockCount value that allows multiple memory blocks.
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.
This mode is also available for pools created with VmaPoolCreateInfo::maxBlockCount value that allows multiple memory blocks.
The space reserved by a custom pool with linear algorithm may be used by two stacks:
@@ -122,10 +123,11 @@ Double stackTo 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 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.
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 bufferRing buffer is available only in pools with one memory block - VmaPoolCreateInfo::maxBlockCount must be 1. Otherwise behavior is undefined.
+Version 2.1.0-beta.1 (2018-08-24)
+Version 2.1.0-beta.1 (2018-08-27)
Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved.
License: MIT
Documentation of all members: vk_mem_alloc.h
diff --git a/docs/html/lost_allocations.html b/docs/html/lost_allocations.html index 72e063d..b001774 100644 --- a/docs/html/lost_allocations.html +++ b/docs/html/lost_allocations.html @@ -77,7 +77,7 @@ $(function() {Q: How do you inform the library when new frame starts?
You need to call function vmaSetCurrentFrameIndex().
Example code:
-When using lost allocations, you may see some Vulkan validation layer warnings about overlapping regions of memory bound to different kinds of buffers and images. This is still valid as long as you implement proper handling of lost allocations (like in the example above) and don't use them.
+When using lost allocations, you may see some Vulkan validation layer warnings about overlapping regions of memory bound to different kinds of buffers and images. This is still valid as long as you implement proper handling of lost allocations (like in the example above) and don't use them.
You can create an allocation that is already in lost state from the beginning using function vmaCreateLostAllocation(). It may be useful if you need a "dummy" allocation that is not null.
You can call function vmaMakePoolAllocationsLost() to set all eligible allocations in a specified custom pool to lost state. Allocations that have been "touched" in current frame or VmaPoolCreateInfo::frameInUseCount frames back cannot become lost.
Q: Can I touch allocation that cannot become lost?
diff --git a/docs/html/quick_start.html b/docs/html/quick_start.html index ae0bc59..517eca2 100644 --- a/docs/html/quick_start.html +++ b/docs/html/quick_start.html @@ -76,6 +76,7 @@ Project setupIt may be a good idea to create dedicated CPP file just for this purpose.
+Please note that this library includes header <vulkan/vulkan.h>
, which in turn includes <windows.h>
on Windows. If you need some specific macros defined before including these headers (like NOMINMAX
, WIN32_LEAN_AND_MEAN
, or WINVER
for Windows, VK_USE_PLATFORM_WIN32_KHR
for Vulkan), you must define them before every #include
of this library.
At program startup:
diff --git a/docs/html/search/all_1.js b/docs/html/search/all_1.js index cff2c47..7ae997e 100644 --- a/docs/html/search/all_1.js +++ b/docs/html/search/all_1.js @@ -1,6 +1,6 @@ var searchData= [ - ['blockcount',['blockCount',['../struct_vma_stat_info.html#abc4bb7cd611900778464c56e50c970a4',1,'VmaStatInfo']]], + ['blockcount',['blockCount',['../struct_vma_stat_info.html#abc4bb7cd611900778464c56e50c970a4',1,'VmaStatInfo::blockCount()'],['../struct_vma_pool_stats.html#aa0b5cb45cef6f18571cefb03b9a230e7',1,'VmaPoolStats::blockCount()']]], ['blocksize',['blockSize',['../struct_vma_pool_create_info.html#aa4265160536cdb9be821b7686c16c676',1,'VmaPoolCreateInfo']]], ['bytesfreed',['bytesFreed',['../struct_vma_defragmentation_stats.html#ab0cb9ac0dbc106c77e384ea676422f28',1,'VmaDefragmentationStats']]], ['bytesmoved',['bytesMoved',['../struct_vma_defragmentation_stats.html#a36f9d5df2a10ba2a36b16e126d60572d',1,'VmaDefragmentationStats']]] diff --git a/docs/html/search/variables_1.js b/docs/html/search/variables_1.js index cff2c47..7ae997e 100644 --- a/docs/html/search/variables_1.js +++ b/docs/html/search/variables_1.js @@ -1,6 +1,6 @@ var searchData= [ - ['blockcount',['blockCount',['../struct_vma_stat_info.html#abc4bb7cd611900778464c56e50c970a4',1,'VmaStatInfo']]], + ['blockcount',['blockCount',['../struct_vma_stat_info.html#abc4bb7cd611900778464c56e50c970a4',1,'VmaStatInfo::blockCount()'],['../struct_vma_pool_stats.html#aa0b5cb45cef6f18571cefb03b9a230e7',1,'VmaPoolStats::blockCount()']]], ['blocksize',['blockSize',['../struct_vma_pool_create_info.html#aa4265160536cdb9be821b7686c16c676',1,'VmaPoolCreateInfo']]], ['bytesfreed',['bytesFreed',['../struct_vma_defragmentation_stats.html#ab0cb9ac0dbc106c77e384ea676422f28',1,'VmaDefragmentationStats']]], ['bytesmoved',['bytesMoved',['../struct_vma_defragmentation_stats.html#a36f9d5df2a10ba2a36b16e126d60572d',1,'VmaDefragmentationStats']]] diff --git a/docs/html/struct_vma_pool_create_info.html b/docs/html/struct_vma_pool_create_info.html index aa5ba2a..d0bbc42 100644 --- a/docs/html/struct_vma_pool_create_info.html +++ b/docs/html/struct_vma_pool_create_info.html @@ -80,7 +80,7 @@ Public AttributesVkDeviceMemory
block to be allocated as part of this pool, in bytes. More...VkDeviceMemory
block to be allocated as part of this pool, in bytes. Optional. More...Size of a single VkDeviceMemory
block to be allocated as part of this pool, in bytes.
Optional. Leave 0 to use default.
+Size of a single VkDeviceMemory
block to be allocated as part of this pool, in bytes. Optional.
Specify nonzero to set explicit, constant size of memory blocks used by this pool.
+Leave 0 to use default and let the library manage block sizes automatically. Sizes of particular blocks may vary.
Maximum number of blocks that can be allocated in this pool. Optional.
-Set to 0 to use default, which is SIZE_MAX
, which means no limit. When VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT is used, default is 1.
Set to 0 to use default, which is SIZE_MAX
, which means no limit.
Set to same value as VmaPoolCreateInfo::minBlockCount to have fixed amount of memory allocated throughout whole lifetime of this pool.
This is the complete list of members for VmaPoolStats, including all inherited members.
VkDeviceMemory
blocks allocated for this pool. More...Describes parameter of existing VmaPool.
@@ -106,6 +109,22 @@ Public AttributesNumber of VmaAllocation objects created from this pool that were not destroyed or lost.
+size_t VmaPoolStats::blockCount | +
Number of VkDeviceMemory
blocks allocated for this pool.
Size of the largest continuous free memory region.
+Size of the largest continuous free memory region available for new allocation.
Making a new allocation of that size is not guaranteed to succeed because of possible additional margin required to respect alignment and buffer/image granularity.