Add const qualifier to handles where possible
This mirrors the Vulkan specification where handles are often passed with a const qualifier
diff --git a/src/vk_mem_alloc.h b/src/vk_mem_alloc.h
index 7e70a9e..e7aa487 100644
--- a/src/vk_mem_alloc.h
+++ b/src/vk_mem_alloc.h
@@ -3361,7 +3361,7 @@
It is safe to pass allocations that are in the lost state - they are ignored.
All allocations not present in this array are considered non-moveable during this defragmentation.
*/
- VmaAllocation* pAllocations;
+ const VmaAllocation* pAllocations;
/** \brief Optional, output. Pointer to array that will be filled with information whether the allocation at certain index has been changed during defragmentation.
The array should have `allocationCount` elements.
@@ -3386,7 +3386,7 @@
Using this array is equivalent to specifying all allocations from the pools in `pAllocations`.
It might be more efficient.
*/
- VmaPool* pPools;
+ const VmaPool* pPools;
/** \brief Maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on CPU side, like `memcpy()`, `memmove()`.
`VK_WHOLE_SIZE` means no limit.
@@ -3558,7 +3558,7 @@
*/
VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragment(
VmaAllocator allocator,
- VmaAllocation* pAllocations,
+ const VmaAllocation* pAllocations,
size_t allocationCount,
VkBool32* pAllocationsChanged,
const VmaDefragmentationInfo *pDefragmentationInfo,
@@ -7123,10 +7123,10 @@
VmaDefragmentationStats* pStats);
~VmaDefragmentationContext_T();
- void AddPools(uint32_t poolCount, VmaPool* pPools);
+ void AddPools(uint32_t poolCount, const VmaPool* pPools);
void AddAllocations(
uint32_t allocationCount,
- VmaAllocation* pAllocations,
+ const VmaAllocation* pAllocations,
VkBool32* pAllocationsChanged);
/*
@@ -14225,7 +14225,7 @@
}
}
-void VmaDefragmentationContext_T::AddPools(uint32_t poolCount, VmaPool* pPools)
+void VmaDefragmentationContext_T::AddPools(uint32_t poolCount, const VmaPool* pPools)
{
for(uint32_t poolIndex = 0; poolIndex < poolCount; ++poolIndex)
{
@@ -14262,7 +14262,7 @@
void VmaDefragmentationContext_T::AddAllocations(
uint32_t allocationCount,
- VmaAllocation* pAllocations,
+ const VmaAllocation* pAllocations,
VkBool32* pAllocationsChanged)
{
// Dispatch pAllocations among defragmentators. Create them when necessary.
@@ -17879,7 +17879,7 @@
VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemoryPages(
VmaAllocator allocator,
size_t allocationCount,
- VmaAllocation* pAllocations)
+ const VmaAllocation* pAllocations)
{
if(allocationCount == 0)
{
@@ -18098,7 +18098,7 @@
VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragment(
VmaAllocator allocator,
- VmaAllocation* pAllocations,
+ const VmaAllocation* pAllocations,
size_t allocationCount,
VkBool32* pAllocationsChanged,
const VmaDefragmentationInfo *pDefragmentationInfo,