Commit Graph

491 Commits

Author SHA1 Message Date
Adam Sawicki
da85ec36bf Made VmaDefragmentationAlgorithm an abstract class and specific implementation as new class VmaDefragmentationAlgorithm_Generic, so user can easily plug his own defragmentation algorithms. 2018-11-22 17:32:44 +01:00
Adam Sawicki
fb00cc9ea8 Removed VMA_DEFRAGMENTATION_* flags. VmaDefragmentationInfo2::flags is now reserved for future use and should be 0. Research various options and chosen some parameters as default. 2018-11-22 17:10:07 +01:00
Adam Sawicki
434ac86781 Minor improvement in vmaDefragmentationBegin. 2018-11-22 16:20:49 +01:00
Adam Sawicki
52076ebf26 Added VmaDefragmentationInfo2::poolCount, pPools. Added test for it - TestDefragmentationWholePool. Removed VmaDefragmentationStats::allocationsLost. Optimized defragmentation algorithm. 2018-11-22 16:14:50 +01:00
Adam Sawicki
da5d248506 VmaReplay: Minor fix. 2018-11-20 15:10:16 +01:00
Adam Sawicki
3b392258e2 Documentation: Added mention of VK_AMD_memory_overallocation_behavior extension. 2018-11-20 11:33:07 +01:00
Adam Sawicki
df2404b6a5 VmaReplay: Added support for Windows end of lines. 2018-11-20 11:29:17 +01:00
Adam Sawicki
19875989e3 VmaReplay: Added support for Windows end of lines. 2018-11-19 16:27:51 +01:00
Adam Sawicki
8ec2ab69d6 VmaReplay: Added parameter --DefragmentatationFlags <Flags>. 2018-11-16 17:22:20 +01:00
Adam Sawicki
c6ede15fab Written test for various defragmentation algorithms, in TestDefragmentationGpu. 2018-11-16 17:04:14 +01:00
Adam Sawicki
5249980132 Implemeneted VMA_DEFRAGMENTATION_FAST_ALGORITHM_BIT, VMA_DEFRAGMENTATION_OPTIMAL_ALGORITHM_BIT. Not tested yet.
Added VMA_ALLOCATION_INTERNAL_STRATEGY_MIN_OFFSET.
2018-11-16 16:15:18 +01:00
Adam Sawicki
9948ca0ceb Removed VMA_DEFRAGMENTATION_CAN_MAKE_LOST_BIT. Not going to implement it for now... 2018-11-16 14:46:04 +01:00
Adam Sawicki
48a12aa835 Merge branch 'master' into allocation_defragmentation_strategies
# Conflicts:
#	docs/html/vk__mem__alloc_8h_source.html
#	src/Tests.cpp
#	src/vk_mem_alloc.h
2018-11-16 14:36:57 +01:00
Adam Sawicki
99f2d3543c Minor update in documentation. 2018-11-16 13:48:11 +01:00
Adam Sawicki
7f97202add Updated documentation of memory mapping with known bug in MoltenVK, based on #47. Thanks @DiegoAce ! 2018-11-16 13:43:34 +01:00
Adam Sawicki
b0c363693f Added function vmaResizeAllocation.
Added tests: function TestResize. Bumped CSV recording file format version to 1.4.
2018-11-13 16:17:38 +01:00
Adam Sawicki
1146b45c63 Fixed aligned_alloc for Android API < 16. Issue #49. Thanks @zhaijialong ! 2018-11-09 11:21:03 +01:00
Adam Sawicki
7a6e442b66 Fixes in documentation: "Features not supported". 2018-11-08 18:46:04 +01:00
Adam Sawicki
370ab184f8 Changed functions to validate and return VK_ERROR_VALIDATION_FAILED_EXT when trying to allocate memory of size 0, create buffer with size 0, or image with one of the dimensions 0.
That's because vkCreateBuffer returns VK_SUCCESS for buffer with size = 0, so VMA then proceeded to allocation of size 0, which is a critical error, checked by an assert, but apparently some users don't enable asserts in VMA.

Added tests: function TestInvalidAllocations.
2018-11-08 16:31:00 +01:00
Adam Sawicki
057040085c Tests 2018-11-08 16:07:29 +01:00
Adam Sawicki
87e466bad6 VmaReplay: Finished support for --DefragmentAfterLine parameter. Better statistics printed, now supporting defragmentation of GPU memory. Creating VkQueue, VkCommandPool, VkCommandBuffer. 2018-11-06 17:23:16 +01:00
Adam Sawicki
e97495dd73 VmaReplay: Added parameter --DefragmentAfterLine. 2018-11-06 16:42:23 +01:00
Adam Sawicki
dec65ac4eb Small addition to documentation. 2018-11-06 12:06:06 +01:00
Adam Sawicki
3a7249f313 VmaDumpVis.py: Small fix. Bumped tool version number, which I forgot to do before. 2018-10-19 11:17:30 +02:00
Adam Sawicki
fa251ad7c8 Locked right mutexes during defragmentation. GPU memory defragmentation is now finished! 2018-10-18 15:22:40 +02:00
Adam Sawicki
440307e6bc Fixed TestDefragmentationGpu() - it was test that was buggy. Defragmentation of GPU memory is working!!! - a major milestone :D 2018-10-18 15:05:19 +02:00
Adam Sawicki
ff0f7b8254 Added TestDefragmentationGpu. Not passing - apparently there is some bug... 2018-10-18 14:44:05 +02:00
Adam Sawicki
76c5bcabfd Further refactoring of defragmentation, preparing for defragmentation of GPU memory. 2018-10-18 14:14:28 +02:00
Adam Sawicki
29b04041f7 Further refactoring of defragmentation classes. 2018-10-18 13:11:00 +02:00
Adam Sawicki
fc9db8dda7 Minor addition to documentation. #46 2018-10-18 12:03:50 +02:00
Adam Sawicki
2dcfcf8b63 More refactoring in preparation for GPU memory defragmentation. Created classes: VmaBlockDefragmentationContext, VmaBlockVectorDefragmentationContext. Class VmaDefragmentationContext_T is no longer empty. 2018-10-17 17:26:39 +02:00
Adam Sawicki
a9f030d7ba Further refactoring of defragmentation. 2018-10-17 15:20:36 +02:00
Adam Sawicki
b03d51e693 Updates to README.md, including new library usages. 2018-10-17 10:15:29 +02:00
Adam Sawicki
a114419b23 Refactored defragmentation code. Removed class VmaDefragmentator. Renamed struct to VmaDefragmentationMove.
Minor fixes in documentation and comments.
2018-10-16 15:30:55 +02:00
Adam Sawicki
ef6cc40b59 Defragmentation: added support for memory that is HOST_VISIBLE but not HOST_COHERENT - calling Invalidate and Flush internally.
Fixed a bug in VmaDefragmentator::Defragment.
2018-10-16 14:20:47 +02:00
Adam Sawicki
f2975346ef Testing environment: Added class StagingBufferCollection, functions UploadGpuData, ValidateGpuData, TestGpuData, in preparation for testing defragmentation of GPU memory. 2018-10-16 13:49:02 +02:00
Adam Sawicki
fa87ae34a6 Small addition to documentation. 2018-10-15 18:15:11 +02:00
Adam Sawicki
6826f2d768 Small refactoring: Removed function VmaBlockVector::DestroyDefragmentator. 2018-10-10 16:49:36 +02:00
Adam Sawicki
f863a1dbd0 Used VMA_RW_MUTEX in 2 other places for optimization. 2018-10-10 16:43:44 +02:00
Adam Sawicki
de9181b2ba Added configuration macro VMA_USE_STL_SHARED_MUTEX.
Added internal class VmaRWMutex, macro VMA_RW_MUTEX, classes VmaMutexLockRead, VmaMutexLockWrite. Used it in VmaAllocator_T::m_PoolsMutex.
2018-10-10 16:26:26 +02:00
Adam Sawicki
b0d4afbeed Refactored defragmentation. Added class VmaDefragmentationAlgorithm, extracted from VmaDefragmentator. 2018-10-09 15:35:46 +02:00
Adam Sawicki
2aad902a66 Minor update in VmaDefragmentationInfo2. 2018-10-09 13:43:34 +02:00
Adam Sawicki
ad0989bfb4 Fixed bug in VmaAllocator_T::Defragment. 2018-10-09 13:26:33 +02:00
Adam Sawicki
012a4ac697 Designed and documented new interface for defragmentation.
Added: VmaDefragmentationContext, VmaDefragmentationFlagBits, VmaDefragmentationFlags, VmaDefragmentationInfo2, vmaDefragmentationBegin(), vmaDefragmentationEnd(). Extended VmaDefragmentationStats by allocationsLost. Deprecated VmaDefragmentationInfo2, vmaDefragment().
2018-10-09 13:25:01 +02:00
Adam Sawicki
b8d34d5e6a Replaced assert() with new macro TEST() in all tests, to check conditions also in Release configuration.
# Conflicts:
#	src/SparseBindingTest.cpp
#	src/Tests.cpp
#	src/VulkanSample.cpp
2018-10-03 17:41:20 +02:00
Adam Sawicki
1f7f8afdd7 Fixed tests for NVIDIA, where it asserted with OUT_OF_MEMORY, probably due to higher alignment requirements. 2018-10-03 17:37:55 +02:00
Adam Sawicki
a7d7769959 Replaced assert() with new macro TEST() in all tests, to check conditions also in Release configuration. 2018-10-03 16:15:27 +02:00
Adam Sawicki
4868c1f523 Fixed tests for NVIDIA, where it asserted with OUT_OF_MEMORY, probably due to higher alignment requirements. 2018-10-03 15:57:11 +02:00
Adam Sawicki
2e4d3eff98 Added BasicTestAllocatePages() - test for vmaAllocateMemoryPages, vmaFreeMemoryPages. 2018-10-03 15:48:17 +02:00
Adam Sawicki
d062b784d3 Added functions: vmaAllocateMemoryPages, vmaFreeMemoryPages to create and destroy multiple allocations at once. 2018-10-03 15:26:22 +02:00