Commit Graph

671 Commits

Author SHA1 Message Date
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
Adam Sawicki
4cd813a8c6 Added flag VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT 2021-12-06 12:14:13 +01:00
Adam Sawicki
4e4e1c085d Added parameters -t --Test and -s -TestSparseBinding to the test app, to execute tests and exit. 2021-12-03 12:13:44 +01:00
Adam Sawicki
d74155933e Improvements in CMakeLists.txt 2021-12-03 11:37:36 +01:00
Adam Sawicki
2854266061 Fix in TestHeapSizeLimit 2021-12-02 16:38:35 +01:00
Adam Sawicki
f529a86ab5 Added VmaVulkanFunctions::vkGetInstanceProcAddr, vkGetDeviceProcAddr
These are now required when using VMA_DYNAMIC_VULKAN_FUNCTIONS. Compatibility breaking!

Closes #211
2021-11-29 17:52:30 +01:00
Adam Sawicki
41296759b9 Refactoring: Added function VmaAddStatInfoAllocation, VmaAddStatInfoUnusedRange
Submitting improved tests.
2021-10-30 12:44:40 +02:00
Adam Sawicki
73ff8e07d1 Preparations for adding support for alternative algorithms in virtual blocks and tests for them 2021-10-28 19:20:12 +02:00
Adam Sawicki
c6432507c5 Implemented vmaBuildVirtualBlockStatsString, vmaFreeVirtualBlockStatsString 2021-10-28 17:00:17 +02:00
Adam Sawicki
cc61fe10d8 Implemented vmaClearVirtualBlock 2021-10-28 16:03:09 +02:00
Adam Sawicki
9a091e8ccb Implemented vmaCalculateVirtualBlockStats 2021-10-28 15:00:24 +02:00
Adam Sawicki
72949fa9d8 Enabled more tests 2021-10-28 14:54:07 +02:00
Adam Sawicki
e1812303d6 More coding and more tests. Basic functionality is working now. 2021-10-28 14:46:45 +02:00
Adam Sawicki
54b7eccc35 More implementation and first tests.
Crashing for now - need more refactoring.
2021-10-28 14:32:34 +02:00
Adam Sawicki
642bbfd793 Fixed TestInvalidAllocations 2021-10-27 16:45:19 +02:00
Lukasz Izdebski
cf6b1a9270 Doxygen added to CMake, shader project dependency added to Sample Project 2021-10-06 13:30:04 +02:00
Adam Sawicki
1b0bd18053 Standardized line endings to LF
See also #195
2021-09-30 12:03:35 +02:00
Sergey Kosarevsky
73f3aed74d Fixed issue #192 with hardcoded VK_USE_PLATFORM_WIN32_KHR 2021-09-20 15:11:21 +03:00
Adam Sawicki
82731feeb9 Fixes. Left only new member VmaPoolCreateInfo::pMemoryAllocateNext. 2021-06-21 14:47:37 +02:00
Adam Sawicki
d780fe0263 Merge branch 'master' into PoolCustomPnext
# Conflicts:
#	include/vk_mem_alloc.h
2021-06-21 14:08:45 +02:00
Adam Sawicki
11dce16f00 Added VmaPoolCreateInfo::minAllocationAlignment 2021-06-18 15:25:57 +02:00
Adam Sawicki
8d4a9e9174 Renamed macro VMA_DEBUG_ALIGNMENT to VMA_MIN_ALIGNMENT as there are valid use cases for it other than debugging purposes. 2021-06-14 17:01:33 +02:00
Adam Sawicki
2f4bc1bb20
Merge pull request #171 from IAmNotHanni/master
Add CMake support
2021-06-09 16:48:06 +02:00
Adam Sawicki
e30b3ab39c Moving Doxyfile to main directory 2021-06-09 16:30:59 +02:00
Johannes Schneider
c9777daabb
Remove macros which can be configured through CMake from VmaUsage.h 2021-06-02 23:18:54 +02:00
Johannes Schneider
948be70048
Enable compiling with multiple processes for VmaReplay 2021-06-02 12:18:42 +02:00
Johannes Schneider
191c64c8ee
Link VulkanMemoryAllocator to Vulkan only if static linking is enabled 2021-06-02 00:23:57 +02:00
Johannes Schneider
8111c12b36
Expose important VMA settings macros as CMake options 2021-06-02 00:22:18 +02:00
Johannes Schneider
e65c1469d9
Improve consistency in naming of targets and options 2021-05-31 23:53:21 +02:00
Johannes Schneider
696ecd674d
Replace add_definitions with add_compile_definitions 2021-05-31 23:53:21 +02:00
Johannes Schneider
a3078999ea
Move add_subdirectory for shaders and VmaReplay to the end of the file 2021-05-31 23:53:21 +02:00
Johannes Schneider
61a2844a4f
Only set VMA_EXAMPLE_SOURCE_FILES when building sample app 2021-05-31 23:53:20 +02:00
Johannes Schneider
1a25921427
Make target_include_directories a one line instruction 2021-05-31 23:53:20 +02:00
Johannes Schneider
853f713db1
Remove source_group instructions 2021-05-31 23:53:19 +02:00
Johannes Schneider
8f62aa27c2
Rename replay app target and shaders target 2021-05-28 20:03:27 +02:00
Johannes Schneider
a7f6b7e1f1
Fix VmaReplay build 2021-05-28 20:03:26 +02:00
Johannes Schneider
3f2238ac9d
Fix VMA_BUILD_EXAMPLE_APP_SHADERS being ignored on Linux 2021-05-28 12:45:58 +02:00
Johannes Schneider
6b733a5ba2
Fix missing Vulkan dependency of VmaExample 2021-05-28 11:56:59 +02:00
Johannes Schneider
e32721df9e
Make building shaders, VMA example application and VMA replay app optional 2021-05-28 02:04:15 +02:00
Johannes
69747a2bdb
Add CMake support 2021-05-27 22:10:12 +02:00
Adam Sawicki
59ec0809a7 Moved main file vk_mem_alloc.h to subdirectory include/
WARNING! This can break external code that depends on directory structure of this repository!

Closes #165
2021-04-19 13:46:49 +02:00
Adam Sawicki
a75a61bfd7 Added parsing of command line parameters and GPU selection
Command line syntax:
-h, --Help   Print this information
-l, --List   Print list of GPUs
-g S, --GPU S   Select GPU with name containing S
-i N, --GPUIndex N   Select GPU index N

Also improved error handling.
2021-03-11 15:15:38 +01:00
Adam Sawicki
48e3d88114 Improved macros TEST, ERR_GUARD_VULKAN 2021-03-11 14:31:00 +01:00
Adam Sawicki
4b047fde54 Optimization: custom pools are on an intrusive double linked list not sorted vector
Added struct VmaPoolListItemTraits.
2021-03-03 16:55:04 +01:00
Adam Sawicki
7b9f7b61a1 Fix for compilation on Linux 2021-03-03 15:36:18 +01:00
Adam Sawicki
47c1cec3d1 Optimization: dedicated allocations are on an intrusive double linked list not sorted vector
Added class VmaIntrusiveLinkedList, struct VmaDedicatedAllocationListItemTraits.
2021-03-03 15:31:44 +01:00
Adam Sawicki
0a3c6b57ec Fixed usage of VK_KHR_buffer_device_address extension
It was confused with VK_EXT_buffer_device_address which is not officially supported by VMA and has different VK_STRUCTURE_TYPE...
Also a fix in PrintMemoryConclusions.
2021-03-02 16:48:32 +01:00
Adam Sawicki
41b411124e Fixed synchronization issue in TestPool_Benchmark
Variable res was incorrectly shared between threads.
2021-03-02 15:11:18 +01:00
Adam Sawicki
e74dc79903 Fix VmaReplay after removing vmaResizeAllocation function 2021-02-26 12:16:07 +01:00
Adam Sawicki
6859ef214f Removed deprecated function vmaResizeAllocation
Also fixed compatibility with Vulkan 1.0.

See #164
2021-02-26 12:09:34 +01:00
Adam Sawicki
afd50562cb Sample app: Added printing information about available memory heaps nad types 2021-02-26 11:59:58 +01:00
Adam Sawicki
a420c3d752 Fixed budget management in VmaBlockVector::Allocate for cases when some of multi-page allocations fail 2021-02-23 18:21:42 +01:00
Adam Sawicki
7e56c486fa Fix in tests for AMD APU with DEVICE_LOCAL heap of only 256 MB 2021-02-23 15:27:24 +01:00
Adam Sawicki
4dfa169ffc Fix for build on Linux 2021-02-22 14:18:34 +01:00
Adam Sawicki
ae0b011e7a Internal improvement: Added counting total number of VkDeviceMemory blocks.
Fixed case of spamming dedicated allocations instead of bigger blocks and thus and exceeding maxMemoryAllocationCount when heap size/budget is reached or exceeded.

Added debug macro VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT.
2021-02-19 18:00:05 +01:00
Adam Sawicki
26eaa3b2ed A fix in TestPool_Benchmark for GPUs with only 256 MB of DEVICE_LOCAL memory 2021-02-18 15:53:18 +01:00
Adam Sawicki
aa18374368 Updated copyright header to year 2021.
Rebuilt binaries, regenerated documentation.
2021-02-16 17:28:49 +01:00
Adam Sawicki
0d4f5234fd Updated README.md - added RPCS3 to the list of known usages.
Also changed sample app to use Vulkan 1.2 by default.
2021-02-16 16:54:27 +01:00
kd-11
e8c483ddb1 mem_alloc: Optimize allocation conflict checking
- When bufferImageGranularity == allocaAlignment the worst case is actually already evaluated
- When result offset and allocation size are already aligned, it is not possible for the 'page' to be shared

In both scenarios, a lot of work can be saved by simply not scanning suballocations. When dealing with many tiny allocations, this adds up a lot!
2021-02-15 22:15:35 +03:00
Adam Sawicki
f2012055cc Added support for VK_EXT_memory_priority
Added VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT, VmaAllocationCreateInfo::priority, VmaPoolCreateInfo::priority.

See #160
2021-01-11 18:04:42 +01:00
Ashkan Aliabadi
8f4e09affd Refer to std string and stream with their fully qualified names. 2020-12-02 16:23:11 -08:00
Adam Sawicki
8cd86b6dd4 Merge branch 'master' of https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator into master 2020-11-03 17:24:26 +01:00
Adam Sawicki
18b0407f32 Further improvements in documentation. 2020-11-03 17:20:59 +01:00
Adam Sawicki
97880507ac Improvements in documentation. 2020-11-03 17:02:54 +01:00
Adam Sawicki
acecd26121 Fixes and clarifications in documentation 2020-11-03 15:01:56 +01:00
Adam Sawicki
ebc1f75a6d
Merge pull request #154 from r-barnes/richard/whitespace
Drop trailing whitespace
2020-10-29 12:15:18 +01:00
Richard Barnes
270b24295d Drop trailing whitespace.
The only change this commit makes is to drop trailing whitespace.
This makes contributions easier for folks whose editors are set up
to automatically remove such whitespace on save.
2020-10-28 12:33:53 -06:00
Richard Barnes
139741813a Make binary search overflow safe.
Our internal static analysis flags potentially unsafe midpoint
calculations. The proposed fix ensures the binary search doesn't
overflow at the cost of a single additional operation.
2020-10-28 12:32:51 -06:00
Adam Sawicki
76411c95c0 Added VmaAllocatorCreateInfo::pTypeExternalMemoryHandleTypes 2020-10-23 16:10:49 +02:00
Adam Sawicki
3dadc82bce Merge branch 'master' into PoolCustomPnext 2020-10-23 15:20:54 +02:00
Adam Sawicki
3528e2aed3 Minor formatting fix in documentation
Regenerated documentation using new Doxygen.
2020-10-15 15:04:12 +02:00
Adam Sawicki
4075d9ef40 Add VmaPoolCreateInfo::pMemoryAllocateNext 2020-10-05 19:04:02 +02:00
Adam Sawicki
0e2b4b2045 Fix std::min in VmaBlockVector::ProcessDefragmentations
Fixes #151 - thanks @rextimmy
2020-09-30 16:07:51 +02:00
Adam Sawicki
1420873213
Merge pull request #148 from res2k/vma_aligned_alloc-tweaks
Some tweaks to vma_aligned_alloc()
2020-08-31 12:41:41 +02:00
Adam Sawicki
6074de0c4a
Merge pull request #147 from res2k/move-some-preproc-defn
Move some preprocessor directives that may influence user code into "implementation" block
2020-08-31 12:38:43 +02:00
Frank Richter
4157367212 Let VMA_SYSTEM_ALIGNED_FREE fall back to VMA_SYSTEM_FREE, if defined 2020-08-24 00:40:19 +02:00
Frank Richter
59131844fe Add vma_aligned_free() for symmetry 2020-08-24 00:05:50 +02:00
Frank Richter
2dc44c1d9d Make vma_aligned_alloc() functions static 2020-08-24 00:02:35 +02:00
Frank Richter
449971111d Move preprocessor directives that may influence user code into implementation block 2020-08-23 21:14:46 +02:00
Ashkan Aliabadi
bead9eadfa Fix misspellings. 2020-08-21 11:51:19 -07:00
Adam Sawicki
21936114ff Merge branch 'master' of https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator 2020-08-18 16:43:58 +02:00
Adam Sawicki
0620c8e5e1 Add test and documentation for resource aliasing (overlap). 2020-08-18 16:43:44 +02:00
Adam Sawicki
b9ad5e79db
Merge pull request #145 from stricmp/master
Fix VMA_DYNAMIC_VULKAN_FUNCTIONS compilation errors when VK_NO_PROTOTYPES is defined
2020-08-18 14:44:55 +02:00
Adam Sawicki
0ef61c2fd5 Fix in documentation chapter "Finding out if memory is mappable"
Fixes #143
2020-08-18 14:20:37 +02:00
Tri S
416996cbff Fix VMA_DYNAMIC_VULKAN_FUNCTIONS compilation errors when VK_NO_PROTOTYPES is defined 2020-08-10 19:13:28 +07:00
Doğukan Korkmaztürk
67bf13cd08 Fix a typo in the explanation of VMA_ALLOCATION_CREATE_MAPPED_BIT 2020-07-27 23:55:03 -04:00
Adam Sawicki
db4c1639bf Fix compilation errors 2020-07-16 16:41:53 +02:00
Adam Sawicki
d594faafee Replace usage of old VK_LAYER_LUNARG_standard_validation and extension VK_EXT_debug_report with new VK_LAYER_KHRONOS_validation and extension VK_EXT_debug_utils also in VmaReplay 2020-07-15 17:12:28 +02:00
Adam Sawicki
8caf0bd1c0 Replace usage of old layer VK_LAYER_LUNARG_standard_validation and extension VK_EXT_debug_report with new layer VK_LAYER_KHRONOS_validation and extension VK_EXT_debug_utils 2020-07-15 16:56:30 +02:00
Nico Weber
08bce5328b mac: Only call system aligned_alloc() with the 11.0+ SDK.
The 10.15 SDK only declares it for C++17 and C11.  In Chromium, we only
call this from .cc files, and these are C++14 still for now.

The 11.0 SDK declares it independent of language version (as long as
__DARWIN_C_LEVEL >= __DARWIN_C_FULL, which it is by default, at least
on macOS).

So this calls the system version in fewer scenarios than possible,
but it keeps the preprocessor checks fairly small.

Bug: chromium:1098741
Change-Id: I1e30f88bb040876bca2b59adee0a1cff33b9ff03
2020-07-06 13:31:56 -04:00
Nico Weber
c331971b30 Only use system aligned_alloc on mac/ios if the SDK has them.
Bug: chromium:1098741
Change-Id: I4df73f581c2a6895c7f136ff974db0371c48cc5e
2020-07-06 13:31:48 -04:00
Nico Weber
5ef3d923d5 Fix argument order for aligned_alloc on mac.
I pasted this from the _aligned_malloc() branch, and _aligned_malloc()
apparently has the argments swapped compared to aligned_alloc() :/

Bug: chromium:1098741
Change-Id: Iddd92a7beb9e75ddc63b96f757457ec4258fd1ca
2020-07-06 13:31:41 -04:00
Nico Weber
1268da7b97 Make vulkan_memory_allocator build with the MacOSX11.0 SDK.
The 11.0 SDK adds a declaration of aligned_malloc() that's available
on macOS 10.15 and later. vulkan_memory_allocator also defines a
symbol with the same name, which causes problems.

As fix, rename the vulkan_memory_allocator version to
vma_aligned_malloc(). Use this opportunity to use the same mechanism on
Windows (a no-op), and, while here, call the system aligned_malloc()
on macOS 10.15 from there too.

Bug: chromium:1098741
Change-Id: If738a1451a08c0813532fc4b778d9118a23210b7
2020-07-06 13:31:32 -04:00