Annotate types with lengths instead of parameters/members

This commit is contained in:
Joe Hermaszewski 2020-04-06 19:38:02 +08:00
parent 3a756282ab
commit b9725fc203

View File

@ -3133,8 +3133,8 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryPages(
const VkMemoryRequirements* VMA_NOT_NULL pVkMemoryRequirements, const VkMemoryRequirements* VMA_NOT_NULL pVkMemoryRequirements,
const VmaAllocationCreateInfo* VMA_NOT_NULL pCreateInfo, const VmaAllocationCreateInfo* VMA_NOT_NULL pCreateInfo,
size_t allocationCount, size_t allocationCount,
VmaAllocation VMA_NULLABLE * VMA_NOT_NULL pAllocations VMA_LEN_IF_NOT_NULL(allocationCount), VmaAllocation VMA_NULLABLE * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations,
VmaAllocationInfo* VMA_NULLABLE pAllocationInfo VMA_LEN_IF_NOT_NULL(allocationCount)); VmaAllocationInfo* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocationInfo);
/** /**
@param[out] pAllocation Handle to allocated memory. @param[out] pAllocation Handle to allocated memory.
@ -3178,7 +3178,7 @@ Passing `VK_NULL_HANDLE` as elements of `pAllocations` array is valid. Such entr
VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemoryPages( VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemoryPages(
VmaAllocator VMA_NOT_NULL allocator, VmaAllocator VMA_NOT_NULL allocator,
size_t allocationCount, size_t allocationCount,
const VmaAllocation VMA_NULLABLE * VMA_NOT_NULL pAllocations VMA_LEN_IF_NOT_NULL(allocationCount)); const VmaAllocation VMA_NULLABLE * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations);
/** \brief Deprecated. /** \brief Deprecated.
@ -3418,13 +3418,13 @@ typedef struct VmaDefragmentationInfo2 {
It is safe to pass allocations that are in the lost state - they are ignored. 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. All allocations not present in this array are considered non-moveable during this defragmentation.
*/ */
VmaAllocation VMA_NOT_NULL * VMA_NOT_NULL pAllocations VMA_LEN_IF_NOT_NULL(allocationCount); VmaAllocation VMA_NOT_NULL * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations;
/** \brief Optional, output. Pointer to array that will be filled with information whether the allocation at certain index has been changed during defragmentation. /** \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. The array should have `allocationCount` elements.
You can pass null if you are not interested in this information. You can pass null if you are not interested in this information.
*/ */
VkBool32* VMA_NULLABLE pAllocationsChanged VMA_LEN_IF_NOT_NULL(allocationCount); VkBool32* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocationsChanged;
/** \brief Numer of pools in `pPools` array. /** \brief Numer of pools in `pPools` array.
*/ */
uint32_t poolCount; uint32_t poolCount;
@ -3443,7 +3443,7 @@ typedef struct VmaDefragmentationInfo2 {
Using this array is equivalent to specifying all allocations from the pools in `pAllocations`. Using this array is equivalent to specifying all allocations from the pools in `pAllocations`.
It might be more efficient. It might be more efficient.
*/ */
VmaPool VMA_NOT_NULL * VMA_NULLABLE pPools VMA_LEN_IF_NOT_NULL(poolCount); VmaPool VMA_NOT_NULL * VMA_NULLABLE VMA_LEN_IF_NOT_NULL(poolCount) 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()`. /** \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. `VK_WHOLE_SIZE` means no limit.
@ -3487,7 +3487,7 @@ To be used with function vmaBeginDefragmentationPass().
*/ */
typedef struct VmaDefragmentationPassInfo { typedef struct VmaDefragmentationPassInfo {
uint32_t moveCount; uint32_t moveCount;
VmaDefragmentationPassMoveInfo* VMA_NOT_NULL pMoves VMA_LEN_IF_NOT_NULL(moveCount); VmaDefragmentationPassMoveInfo* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(moveCount) pMoves;
} VmaDefragmentationPassInfo; } VmaDefragmentationPassInfo;
/** \brief Deprecated. Optional configuration parameters to be passed to function vmaDefragment(). /** \brief Deprecated. Optional configuration parameters to be passed to function vmaDefragment().
@ -3615,9 +3615,9 @@ For more information, see [Defragmentation](@ref defragmentation) chapter.
*/ */
VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragment( VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragment(
VmaAllocator VMA_NOT_NULL allocator, VmaAllocator VMA_NOT_NULL allocator,
VmaAllocation VMA_NOT_NULL * VMA_NOT_NULL pAllocations VMA_LEN_IF_NOT_NULL(allocationCount), VmaAllocation VMA_NOT_NULL * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations,
size_t allocationCount, size_t allocationCount,
VkBool32* VMA_NULLABLE pAllocationsChanged VMA_LEN_IF_NOT_NULL(allocationCount), VkBool32* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocationsChanged,
const VmaDefragmentationInfo* VMA_NULLABLE pDefragmentationInfo, const VmaDefragmentationInfo* VMA_NULLABLE pDefragmentationInfo,
VmaDefragmentationStats* VMA_NULLABLE pDefragmentationStats); VmaDefragmentationStats* VMA_NULLABLE pDefragmentationStats);