Commit Graph

663 Commits

Author SHA1 Message Date
Adam Sawicki
c195e40baa More development of buffer suballocation
Introduced dedicated suballocations - always used for now.
Started writing documentation.
2023-02-02 17:57:04 +01:00
Adam Sawicki
441b6f41f6 Added initial implementation and a test
Every suballocation has a separate buffer for now, but otherwise entire API is implemented, except not all creation structure parameters and flags are respected yet.
2023-01-31 17:27:27 +01:00
Juan Ramos
0b7c427971 MSVC cleanup
MSVC compiler can be used with Ninja as well. However, the current
CMake code doesn't account for it.
2022-11-30 10:30:19 -07:00
Attractadore
f000f1b369
Fix windows.h not found when cross compiling on Linux
The header provided by mingw-w64 on Linux is called windows.h.
2022-06-19 20:54:03 +03:00
Pierre Narvor
2bb598acd0 [cmake] Updated installation process to use modern CMake targets 2022-06-14 17:40:18 +02:00
Rémi Verschelde
9eab57ea44 Strip trailing whitespace in code files 2022-06-14 13:41:15 +02:00
Monika0000
bbc3d15390 fix re-defines 2022-06-14 04:13:30 +10:00
Adam Sawicki
a6bfc23725 Releasing version 3.0.1
Some fixes in tests for Nvidia cards.
2022-05-26 11:51:12 +02:00
Adam Sawicki
df7648061c Fixes in GpuMemDumpVis.py regarding image height calculation
Added GpuMemDump.schema.json.
Minor improvement in SaveAllocatorStatsToFile.
2022-04-05 13:32:30 +02:00
Adam Sawicki
2d2a9e3df3 Fixed bug with assert failure when JSON dump is created while a custom pool exist with specified string name 2022-03-29 17:24:48 +02:00
Adam Sawicki
3f9f66740a Fix for compilation on AppleClang 13.1
Fixes #253
2022-03-28 13:21:46 +02:00
Adam Sawicki
3c6470cf45 New JSON dump format
Unified across VMA and D3D12MA.
Updated Python script for visualization - now called GpuMemDumpVis.py.

Also a fix for bug in EXTENSIVE defragmentation algorithm - see #232

Code by @medranSolus
2022-03-24 11:50:34 +01:00
Adam Sawicki
6fbb28e3a8 Improvement in TestAllocationAliasing 2022-03-21 13:07:44 +01:00
Adam Sawicki
58face4cff Changed macro in defragmentation test to more readable lambda.
Code by @medranSolus
2022-03-14 14:21:59 +01:00
Adam Sawicki
31910c8b08 Fix in defragmentation versus mapping
by @medranSolus

Added TestDefragmentationVsMapping.
2022-03-09 13:24:06 +01:00
Adam Sawicki
7d182e2c5a Change in the defragmentation API. Compatibility breaking!
Removed VmaDefragmentationMove::dstMemory, dstOffset, internalData, added dstTmpAllocation.
Code by @medranSolus
2022-03-07 17:00:12 +01:00
Adam Sawicki
f828262f43 Changed vmaEndDefragmentation to return void (somewhat compatibility breaking)
It couldn't fail anyway.
2022-03-04 14:24:29 +01:00
Adam Sawicki
caf27e0428 Made allocation Name and UserData separate. COMPATIBILITY BREAKING!
Added function vmaSetAllocationName. Added member VmaAllocationInfo::pName.
VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT is now deprecated but still works.

Code mostly by @medranSolus
2022-03-03 11:23:14 +01:00
Adam Sawicki
bd39bed5e6 Fixes in defragmentation
Implemented VMA_DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT. Fixed allocation mapping after defragmentation.
Also fixed tests - hopefully fixes #248
Code by @medranSolus
2022-03-02 16:10:41 +01:00
Adam Sawicki
01364c7970 Added documentation chapter "VK_EXT_memory_priority"
Other fixes in documentation
2022-02-28 12:10:18 +01:00
Adam Sawicki
6a63f2cb4e Fixed incorrect accounting of memory budget.
Code by @medranSolus
Fixes #241
2022-02-23 13:44:51 +01:00
Adam Sawicki
88510e9801 New API for defragmentation. COMPATIBILITY BREAKING!
See structure VmaDefragmentationInfo, VmaDefragmentationMove, VmaDefragmentationPassMoveInfo, VmaDefragmentationStats, function vmaBeginDefragmentation, vmaEndDefragmentation, vmaBeginDefragmentationPass, vmaEndDefragmentationPass.

Switched to TLSF as the default algorithm - in default pools, custom pools, virtual blocks. Removed generic and buddy algorithm. Removed flags: VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT, VMA_POOL_CREATE_TLSF_ALGORITHM_BIT, VMA_VIRTUAL_BLOCK_CREATE_BUDDY_ALGORITHM_BIT, VMA_VIRTUAL_BLOCK_CREATE_TLSF_ALGORITHM_BIT.

Updated and regenerated documentation.
2022-02-22 23:38:19 +01:00
Adam Sawicki
226bd5a6ad New API for statistics. COMPATIBILITY BREAKING!
New structure VmaStatistics, VmaDetailedStatistics, VmaTotalStatistics. Modified structure VmaBudget.
New function vmaCalculateStatistics, vmaGetPoolStatistics, vmaCalculatePoolStatistics, vmaGetVirtualBlockStatistics, vmaCalculateVirtualBlockStatistics. vmaGetHeapBudgets function unchanged.

Updated and rebuilt the docs.
2022-02-22 15:19:35 +01:00
Adam Sawicki
d00699f26d Another fix in TestLinearAllocator
Closes #239
2022-02-18 11:46:15 +01:00
Adam Sawicki
e0fcd7344e Fixed VulkanUsage::Init for Vulkan SDK not supporting new Vulkan 1.3, to fix CI builds 2022-02-17 14:48:54 +01:00
Adam Sawicki
aee61b1d25 Added new API for selecting preferred memory type: VMA_MEMORY_USAGE_AUTO, VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE, VMA_MEMORY_USAGE_AUTO_PREFER_HOST, VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT, VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT, VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT
Old values like VMA_MEMORY_USAGE_GPU_ONLY still work as before, for backward compatibility.
Updated documentation accordingly.

Introduced a concept of mappable and non-mappable allocations - with VMA_MEMORY_USAGE_AUTO* an intent to map has to be specified using VMA_ALLOCATION_CREATE_HOST_ACCESS*.

Added mapping hysteresis logic (internal class VmaMappingHysteresis, config macro VMA_MAPPING_HYSTERESIS_ENABLED) that prevents too many calls vkMapMemory/vkUnmapMemory back and forth.

Internal improvement in VmaBlockVector::AllocatePage to try to keep mappable and non-mappable allocations separate.
2022-02-17 14:44:06 +01:00
Adam Sawicki
c6a338ba88 Fix in TestLinearAllocator for Intel(R) HD Graphics 630
See #239
2022-02-17 11:02:45 +01:00
Adam Sawicki
fd82bc7b6d Fixed few bugs in tests
Fixes #234 - thanks @mkx171217
2022-02-11 11:42:17 +01:00
Adam Sawicki
37c2d74b05 Fixes in test TestVirtualBlocksAlgorithmsBenchmark 2022-02-08 15:38:13 +01:00
Adam Sawicki
15206baf40 Added some new tests: TestAllocationAlgorithmsCorrectness 2022-02-08 15:04:08 +01:00
Adam Sawicki
bb29254253 Fix for VmaBitScan functions in GCC and Clang. Fixed debug margin for generic algorithm.
Hopefully helps for #231.
Code by @medranSolus
2022-02-08 10:50:10 +01:00
Adam Sawicki
fd4ee1d5aa Fixed vmaVirtualFree legal to call with allocation == VK_NULL_HANDLE
Hopefully fixes #230
Fixes in internal validation.
Rebuilt the docs.
2022-02-04 14:32:45 +01:00
Adam Sawicki
22485a05f9 Improved behavior of vmaVirtualAllocate on failed allocation. Fixed VmaVirtualAllocation to distinguish VK_NULL_HANDLE from successful allocation.
Improved tests.
Rebult the docs.
2022-02-04 11:39:56 +01:00
Adam Sawicki
ab16036dd5 Updated tests and documentation for VMA_DEBUG_MARGIN
Fixed type of VmaVirtualBlockCreateInfo::flags.
Rebuilt the docs.
2022-02-01 17:57:17 +01:00
Adam Sawicki
48d3cc46a0 Minor fixes after merging #226 2022-01-31 17:20:29 +01:00
Adam Sawicki
08759cbec5 Changed value of VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT / VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT.
Added support for VMA_DEBUG_MARGIN in TLSF algorithm.
Changed behavior of VMA_DEBUG_MARGIN to be included only after not before every allocation.
Bug fixes and improvements in TLSF algorithm.
Added benchmark for virtual allocator.

Code by @medranSolus
2022-01-28 13:07:58 +01:00
Adam Sawicki
ed83ac24d2 Changes in ALLOCATION_CREATE_STRATEGY flags. COMPATIBILITY BREAKING!
Removed flags: VMA_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT, VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT, VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT.
Regenerated documentation.
2022-01-26 17:47:11 +01:00
Adam Sawicki
6c1c16f05c Misc minor fixes 2022-01-26 17:46:38 +01:00
Adam Sawicki
f451b94158 Fixed vmaBuildVirtualBlockStatsString, vmaFreeVirtualBlockStatsString to also be inside #if VMA_STATS_STRING_ENABLED
Updated copyright headers for to year 2022.

Change by @medranSolus
2022-01-21 12:56:18 +01:00
Adam Sawicki
d3a85f0dc3 Refactored virtual allocator. (COMPATIBILITY BREAKING!) Added TLSF algoritym.
Refactored virtual allocator: Added type VmaVirtualAllocation, member VmaVirtualAllocationInfo::offset, changed parameters of vmaVirtualAllocate, vmaVirtualFree, vmaSetVirtualAllocationUserData, vmaGetVirtualAllocationInfo.

Added TLSF algorithm: Added VMA_POOL_CREATE_TLSF_ALGORITHM_BIT, VMA_VIRTUAL_BLOCK_CREATE_TLSF_ALGORITHM_BIT.

Some internal refactoring.

Improved documentation: Grouped API elements into Doxygen modules.

Code mostly by @medranSolus.
2022-01-20 17:00:33 +01:00
Adam Sawicki
a8581fc96c Deleted the whole Record&Replay feature. COMPATIBILITY BREAKING!
Removed from the API: VmaAllocatorCreateInfo::pRecordSettings, VmaRecordSettings, VmaRecordFlagBits, VmaRecordFlags.
Regenerated documentation. Updated README.
2022-01-10 18:11:09 +01:00
Adam Sawicki
1e97603ab8 Deleted the whole feature of lost allocations. COMPATIBILITY BREAKING!
Removed from the interface: VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT, VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT, vmaCreateLostAllocation, vmaMakePoolAllocationsLost, vmaTouchAllocation, VmaAllocatorCreateInfo::frameInUseCount, VmaPoolCreateInfo::frameInUseCount.

Also fixed a bug with synchronization in VmaDedicatedAllocationList.
2022-01-10 17:57:11 +01:00
Adam Sawicki
5453c4b5eb Fixed compilation of tests. 2022-01-07 14:27:36 +01:00
Adam Sawicki
c61770a162 Fixed CMakeLists.txt regarding VMA_DYNAMIC_VULKAN_FUNCTIONS, VMA_STATIC_VULKAN_FUNCTIONS
Closes #218
2022-01-05 18:41:51 +01:00
Adam Sawicki
7c48285034 Removed VMA_USE_STL_CONTAINERS 2021-12-22 14:57:18 +01:00
Adam Sawicki
cbad11e039 Fixed vmaGetPoolStats for dedicated allocations
Added new tests: TestPoolsAndAllocationParameters.
2021-12-22 14:50:49 +01:00
Adam Sawicki
4586be47d8 Fixed usage of VMA_STATIC_VULKAN_FUNCTIONS, VMA_DYNAMIC_VULKAN_FUNCTIONS in CmakeLists.txt
Fixes #215
2021-12-17 12:11:06 +01:00
Adam Sawicki
5c8b3ba955 Fixes in CMakeLists.txt files
Added header files, added NATVIS file, added missing project dependencies.
2021-12-07 16:48:59 +01:00
Adam Sawicki
d3067c3620 Improved NATVIS file - added support for VmaIntrusiveLinkedList usage 2021-12-07 16:48:07 +01:00
Adam Sawicki
35eeb340a3 Renamed function vmaGetBudget to vmaGetHeapBudgets. COMPATIBILITY BREAKING!
Rebuilt the docs.
Closes #213
2021-12-06 17:36:18 +01:00