Joe Hermaszewski
c6f8c86085
Add annotations for nullability and length
...
These are only present on the declarations in the C API.
New macros
- `VMA_NULLABLE`
- `VMA_NOT_NULL`
- `VMA_NULLABLE_NON_DISPATCHABLE`
- `VMA_NOT_NULL_NON_DISPATCHABLE`
- `VMA_LEN_IF_NOT_NULL`
On clang `VMA_NOT_NULL` and `VMA_NULLABLE` are defined as `_Nonnull` and
`_Nullable`. Clang will use these annotations to generate diagnostics
when these functions or structs are incorrectly used.
`VMA_NULLABLE_NON_DISPATCHABLE` and `VMA_NOT_NULL_NON_DISPATCHABLE` are
not defined on platforms where Vulkan's non-dispatchable handles are not
pointers; on platforms where they are, these macros are defined to be
`VMA_NULLABLE` and `VMA_NOT_NULL` respectively.
`LEN_IF_NOT_NULL` is not defined for any compiler. It is included to
mirror the `len` attribute in the Vulkan XML spec in order to aid in
development of other language bindings for this library.
It was tempting to use C's array syntax (`foo(int len, int arr[len])`)to
specify lengths, however this is not possible to use with optional
pointers, nor is it possible to use inside structs. For the sake of
consistency only `VMA_LEN_IF_NOT_NULL` is used (additionally neither
clang not gcc generate warnings for function misuse when the array
length specifier is anything but an integer literal).
- Also correct a couple of typos
- Also add assert on ppName in vmaGetPoolName
Closes #114
2020-04-07 20:20:47 +08:00
Adam Sawicki
f575c5070b
Further changes in importing pointers to Vulkan functions
...
Reverted change removing configuration macro VMA_STATIC_VULKAN_FUNCTIONS.
Added configuration macro VMA_DYNAMIC_VULKAN_FUNCTIONS.
Fixes for Android.
Closes #111 , also refers to #56 .
2020-03-31 19:11:41 +02:00
Sidney Just
bb7bdb99ec
Fixed a race condition with incremental defragmentation. The issue here is that VmaBlockVector::DefragmentationEnd() relied on the mutex being previously locked to safely mutate its data, but with incremental defrag this isn't guaranteed to be the case anymore.
2020-03-27 09:58:25 -07:00
Adam Sawicki
3d1ce4ebb8
Support VK_KHR_buffer_device_address but not VK_EXT_buffer_device_address
...
To avoid mess in the code. They are not identical! "EXT" version lacks flag VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT* flag.
Refers to #56
2020-03-25 10:34:05 +01:00
Adam Sawicki
204a810449
Fix documentation to state that VmaAllocatorCreateInfo::instance is now required
...
Compatibility breaking!
Closes #107
2020-03-24 15:58:45 +01:00
Adam Sawicki
297639774c
Remove outdated comment
2020-03-24 12:40:54 +01:00
Adam Sawicki
451bf601d8
Bump version number to 3.0.0-development as we broken backward compatibility
...
Also rebuilt the docs.
2020-03-23 18:24:02 +01:00
Adam Sawicki
b58de2be50
Merge pull request #105 from Didgy74/master
...
Add pUserData to VmaDeviceMemoryCallbacks
2020-03-23 18:21:16 +01:00
Adam Sawicki
2952959820
Fix a comment broken accidentally
2020-03-23 18:19:35 +01:00
Adam Sawicki
954631ac2a
Improve internal fetching pointers to Vulkan functions to always use vkGetInstanceProcAddr/vkGetDeviceProcAddr
...
No longer refers to statically linked Vulkan functions.
Removed configuration macro VMA_STATIC_VULKAN_FUNCTIONS.
Hopefully will help for #56 .
2020-03-23 18:13:36 +01:00
Adam Sawicki
77b55b38f4
Fix VmaAllocator_T::AllocateDedicatedMemory to make it compiling with Vulkan SDK 1.1.130.0 (linux)
...
Closes #104
2020-03-23 15:42:55 +01:00
Adam Sawicki
e73e988daf
Add support for buffer device address, together with documentation and tests
...
Added VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT.
2020-03-20 18:05:42 +01:00
Nils Petter Skålerud
d00c9b6ff8
Fixed bug where pUserData was not being assigned during initialization.
...
Signed-off-by: Nils Petter Skålerud <np_skalerud@hotmail.com>
2020-03-19 19:38:52 +01:00
Nils Petter Skålerud
eebf47cd1c
Added a member void* pUserData to VmaDeviceMemoryCallbacks
...
Updated PFN_vmaAllocateDeviceMemoryFunction to use new pUserData member
Updated PFN_vmaFreeDeviceMemoryFunction to use new pUserData member
Signed-off-by: Nils Petter Skålerud <np_skalerud@hotmail.com>
2020-03-19 19:20:19 +01:00
Adam Sawicki
39aeff7a43
Remove incorrect asserts from vmaCreateBuffer
...
Closes #102
2020-03-16 15:39:44 +01:00
Adam Sawicki
1b8bdb216e
Remove unused variable in VmaBlockVector::AllocatePage
...
Fixes #101
2020-03-11 17:08:42 +01:00
Adam Sawicki
6a93b8aa5f
Protection against incorrect (0 or very large) memory budget returned by some bugged drivers
...
2 other minor fixes.
2020-03-09 16:58:18 +01:00
Frank Richter
c534e61379
Typo fix
2020-03-08 13:24:06 +01:00
Adam Sawicki
003451e52d
Fixes in VmaAllocator_T::ImportVulkanFunctions
...
Hopefully fix Android #56
2020-03-02 15:52:24 +01:00
Adam Sawicki
8ef0d201ef
Merge branch 'Vulkan1_2'
2020-03-02 15:43:47 +01:00
Adam Sawicki
74ef41e66b
Bump version number and date
2020-03-02 15:34:32 +01:00
Adam Sawicki
a1d992f5d1
Add function vmaGetAllocatorInfo, structure VmaAllocatorInfo
...
Closes #99
Also rebuilt Doxygen documentation.
2020-03-02 15:32:10 +01:00
Adam Sawicki
76004205fd
Add documentation chapter about VK_AMD_device_coherent_memory extension usage
...
Regenerated Doxygen documentation.
2020-02-07 17:18:35 +01:00
Adam Sawicki
508825012c
Add support for VK_AMD_device_coherent_memory extension
...
- Added VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT.
- Fixed bug generating validation layers error when the extension is not enabled.
- Updated date in copyright header comments to year 2020.
2020-02-07 16:51:31 +01:00
Adam Sawicki
82ec4439c7
Minor fix: Use std::forward with parameter pack
2020-01-31 11:32:51 +01:00
Adam Sawicki
aaba2109f9
Refactoring: Use constructor and destructor in VmaAllocation_T
...
VmaPoolAllocator supports that. Needed to only use parameter pack to pass arguments to constructor.
2020-01-31 11:19:32 +01:00
Adam Sawicki
cdd30bb46d
Prepare to support Vulkan 1.2
...
No way to test for now because no Vulkan SDK available.
2020-01-20 17:19:41 +01:00
Sidney Just
f91dd04a1e
Fixed incorrect for loop in ProcessDefragmetnations() that would lead to partial defragmentation passes being broken
2020-01-12 15:51:33 -08:00
Lava Block
361fcfcae4
Fix C++17 shared_mutex compile error
...
In C++17 the method is called: https://en.cppreference.com/w/cpp/thread/shared_mutex/try_lock_shared
2019-12-29 17:12:36 +01:00
Adam Sawicki
c467e28f2f
Renames in the library and fixes in tests for the new defragmentation
2019-12-23 16:38:31 +01:00
Adam Sawicki
a52012de37
Prototype of a defragmentation interface that supports tiling optimal images
...
Merged #90 thanks @JustSid !
2019-12-23 15:28:51 +01:00
Adam Sawicki
c8eec757fd
Minor addition to the documentation regarding allocation string names
2019-12-18 13:37:38 +01:00
Adam Sawicki
7f708dbd44
Use NDEBUG instead of _DEBUG macro to detect debug build
...
Closes #92 thanks @daemyung !
2019-12-18 10:54:28 +01:00
Adam Sawicki
e9bfb539d8
Publish version 2.3.0 final
...
Updated version number. Regenerated Release binaries and Doxygen documentation.
2019-12-04 14:26:59 +01:00
Adam Sawicki
7d6544dc73
Merge branch 'master' of https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
2019-12-02 13:42:35 +01:00
Adam Sawicki
cd7bc20429
Clarify documentation in regards to cache flush/invalidate in few places
...
See #91 , thanks @ROTARTSI82 !
2019-12-02 13:42:25 +01:00
Adam Sawicki
5f94eae63d
Fix bug in VmaAllocator_T::AllocateVulkanMemory for case when HeapSizeLimit is used
...
Closes #89 - thanks @JustSid !
2019-11-28 11:52:30 +01:00
Adam Sawicki
023976ad24
Minor fix: Add missing mutex lock to VmaBlockVector::IsEmpty
2019-11-26 11:48:06 +01:00
Adam Sawicki
4670506a22
Announce version 2.3.0-alpha.1
2019-11-25 12:46:57 +01:00
Adam Sawicki
1296e2db4d
VmaReplay: Switch to Vulkan 1.1
...
Recording file format version bumped to 1.8 to support "VulkanApiVersion".
VmaReplay now uses Vulkan 1.1 by default and so it removes parameter --VK_KHR_dedicated_allocation.
2019-11-25 11:13:53 +01:00
Adam Sawicki
10f68cb139
Vulkan 1.1 suport - prototype
2019-11-22 17:41:59 +01:00
Adam Sawicki
7ba02ec56e
Minor improvement
2019-11-22 15:28:06 +01:00
Adam Sawicki
ddcbf8cdba
Fix management of m_HasEmptyBlock by adding VmaBlockVector::UpdateHasEmptyBlock().
...
Also added TestPool_MinBlockCount().
2019-11-22 15:22:42 +01:00
Adam Sawicki
69185555f4
Add VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED
...
Closes #84
2019-11-18 17:03:34 +01:00
Adam Sawicki
efa88c4de0
Add VMA_MEMORY_USAGE_CPU_COPY for memory that is preferably not DEVICE_LOCAL but not guaranteed to be HOST_VISIBLE
...
Also added test for memory types and usages.
2019-11-18 16:33:56 +01:00
Adam Sawicki
4ac8ff89c2
Multiple fixes in budget management
...
Including correct handling of lost allocation.
2019-11-18 14:47:33 +01:00
Adam Sawicki
a63e37c656
Add support for memory budget to record&replay system
2019-11-18 13:40:03 +01:00
Adam Sawicki
b68b368c67
Merge branch 'master' into MemoryBudget
2019-11-18 13:15:18 +01:00
Adam Sawicki
ba2bdea58e
Remove redundant variable VmaBlockVector::m_IsCustomPool
2019-11-18 12:42:32 +01:00
Adam Sawicki
aeb9836f4c
Finish implementation of vmaSetPoolName, vmaGetPoolName
...
vmaSetPoolName was added to recording format. Recording format version was bumped to 1.7. #82
2019-11-18 12:34:54 +01:00