Commit Graph

572 Commits

Author SHA1 Message Date
Adam Sawicki
e30b3ab39c Moving Doxyfile to main directory 2021-06-09 16:30:59 +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
3528e2aed3 Minor formatting fix in documentation
Regenerated documentation using new Doxygen.
2020-10-15 15:04:12 +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