mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2024-11-10 10:41:52 +00:00
Merge pull request #115 from expipiplus1/joe-annotations
Add annotations for nullability and length
This commit is contained in:
commit
fb3a33777d
@ -2188,7 +2188,7 @@ INCLUDE_FILE_PATTERNS =
|
|||||||
# recursively expanded use the := operator instead of the = operator.
|
# recursively expanded use the := operator instead of the = operator.
|
||||||
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
||||||
|
|
||||||
PREDEFINED = VMA_CALL_PRE= VMA_CALL_POST=
|
PREDEFINED = VMA_CALL_PRE= VMA_CALL_POST= VMA_NOT_NULL= VMA_NULLABLE= VMA_LEN_IF_NOT_NULL(len)= VMA_NOT_NULL_NON_DISPATCHABLE= VMA_NULLABLE_NON_DISPATCHABLE=
|
||||||
|
|
||||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
|
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
|
||||||
# tag can be used to specify a list of macro names that should be expanded. The
|
# tag can be used to specify a list of macro names that should be expanded. The
|
||||||
|
@ -1997,6 +1997,59 @@ available through VmaAllocatorCreateInfo::pRecordSettings.
|
|||||||
#define VMA_CALL_POST
|
#define VMA_CALL_POST
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Define this macro to decorate pointers with an attribute specifying the
|
||||||
|
// length of the array they point to if they are not null.
|
||||||
|
//
|
||||||
|
// The length may be one of
|
||||||
|
// - The name of another parameter in the argument list where the pointer is declared
|
||||||
|
// - The name of another member in the struct where the pointer is declared
|
||||||
|
// - The name of a member of a struct type, meaning the value of that member in
|
||||||
|
// the context of the call. For example
|
||||||
|
// VMA_LEN_IF_NOT_NULL("VkPhysicalDeviceMemoryProperties::memoryHeapCount"),
|
||||||
|
// this means the number of memory heaps available in the device associated
|
||||||
|
// with the VmaAllocator being dealt with.
|
||||||
|
#ifndef VMA_LEN_IF_NOT_NULL
|
||||||
|
#define VMA_LEN_IF_NOT_NULL(len)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// The VMA_NULLABLE macro is defined to be _Nullable when compiling with Clang.
|
||||||
|
// see: https://clang.llvm.org/docs/AttributeReference.html#nullable
|
||||||
|
#ifndef VMA_NULLABLE
|
||||||
|
#ifdef __clang__
|
||||||
|
#define VMA_NULLABLE _Nullable
|
||||||
|
#else
|
||||||
|
#define VMA_NULLABLE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// The VMA_NOT_NULL macro is defined to be _Nonnull when compiling with Clang.
|
||||||
|
// see: https://clang.llvm.org/docs/AttributeReference.html#nonnull
|
||||||
|
#ifndef VMA_NOT_NULL
|
||||||
|
#ifdef __clang__
|
||||||
|
#define VMA_NOT_NULL _Nonnull
|
||||||
|
#else
|
||||||
|
#define VMA_NOT_NULL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// If non-dispatchable handles are represented as pointers then we can give
|
||||||
|
// then nullability annotations
|
||||||
|
#ifndef VMA_NOT_NULL_NON_DISPATCHABLE
|
||||||
|
#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
|
||||||
|
#define VMA_NOT_NULL_NON_DISPATCHABLE VMA_NOT_NULL
|
||||||
|
#else
|
||||||
|
#define VMA_NOT_NULL_NON_DISPATCHABLE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef VMA_NULLABLE_NON_DISPATCHABLE
|
||||||
|
#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
|
||||||
|
#define VMA_NULLABLE_NON_DISPATCHABLE VMA_NULLABLE
|
||||||
|
#else
|
||||||
|
#define VMA_NULLABLE_NON_DISPATCHABLE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/** \struct VmaAllocator
|
/** \struct VmaAllocator
|
||||||
\brief Represents main object of this library initialized.
|
\brief Represents main object of this library initialized.
|
||||||
|
|
||||||
@ -2010,18 +2063,18 @@ VK_DEFINE_HANDLE(VmaAllocator)
|
|||||||
|
|
||||||
/// Callback function called after successful vkAllocateMemory.
|
/// Callback function called after successful vkAllocateMemory.
|
||||||
typedef void (VKAPI_PTR *PFN_vmaAllocateDeviceMemoryFunction)(
|
typedef void (VKAPI_PTR *PFN_vmaAllocateDeviceMemoryFunction)(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
uint32_t memoryType,
|
uint32_t memoryType,
|
||||||
VkDeviceMemory memory,
|
VkDeviceMemory VMA_NOT_NULL_NON_DISPATCHABLE memory,
|
||||||
VkDeviceSize size,
|
VkDeviceSize size,
|
||||||
void* pUserData);
|
void* VMA_NULLABLE pUserData);
|
||||||
/// Callback function called before vkFreeMemory.
|
/// Callback function called before vkFreeMemory.
|
||||||
typedef void (VKAPI_PTR *PFN_vmaFreeDeviceMemoryFunction)(
|
typedef void (VKAPI_PTR *PFN_vmaFreeDeviceMemoryFunction)(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
uint32_t memoryType,
|
uint32_t memoryType,
|
||||||
VkDeviceMemory memory,
|
VkDeviceMemory VMA_NOT_NULL_NON_DISPATCHABLE memory,
|
||||||
VkDeviceSize size,
|
VkDeviceSize size,
|
||||||
void* pUserData);
|
void* VMA_NULLABLE pUserData);
|
||||||
|
|
||||||
/** \brief Set of callbacks that the library will call for `vkAllocateMemory` and `vkFreeMemory`.
|
/** \brief Set of callbacks that the library will call for `vkAllocateMemory` and `vkFreeMemory`.
|
||||||
|
|
||||||
@ -2032,11 +2085,11 @@ Used in VmaAllocatorCreateInfo::pDeviceMemoryCallbacks.
|
|||||||
*/
|
*/
|
||||||
typedef struct VmaDeviceMemoryCallbacks {
|
typedef struct VmaDeviceMemoryCallbacks {
|
||||||
/// Optional, can be null.
|
/// Optional, can be null.
|
||||||
PFN_vmaAllocateDeviceMemoryFunction pfnAllocate;
|
PFN_vmaAllocateDeviceMemoryFunction VMA_NULLABLE pfnAllocate;
|
||||||
/// Optional, can be null.
|
/// Optional, can be null.
|
||||||
PFN_vmaFreeDeviceMemoryFunction pfnFree;
|
PFN_vmaFreeDeviceMemoryFunction VMA_NULLABLE pfnFree;
|
||||||
/// Optional, can be null.
|
/// Optional, can be null.
|
||||||
void* pUserData;
|
void* VMA_NULLABLE pUserData;
|
||||||
} VmaDeviceMemoryCallbacks;
|
} VmaDeviceMemoryCallbacks;
|
||||||
|
|
||||||
/// Flags for created #VmaAllocator.
|
/// Flags for created #VmaAllocator.
|
||||||
@ -2144,33 +2197,33 @@ typedef VkFlags VmaAllocatorCreateFlags;
|
|||||||
Used in VmaAllocatorCreateInfo::pVulkanFunctions.
|
Used in VmaAllocatorCreateInfo::pVulkanFunctions.
|
||||||
*/
|
*/
|
||||||
typedef struct VmaVulkanFunctions {
|
typedef struct VmaVulkanFunctions {
|
||||||
PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties;
|
PFN_vkGetPhysicalDeviceProperties VMA_NOT_NULL vkGetPhysicalDeviceProperties;
|
||||||
PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties;
|
PFN_vkGetPhysicalDeviceMemoryProperties VMA_NOT_NULL vkGetPhysicalDeviceMemoryProperties;
|
||||||
PFN_vkAllocateMemory vkAllocateMemory;
|
PFN_vkAllocateMemory VMA_NOT_NULL vkAllocateMemory;
|
||||||
PFN_vkFreeMemory vkFreeMemory;
|
PFN_vkFreeMemory VMA_NOT_NULL vkFreeMemory;
|
||||||
PFN_vkMapMemory vkMapMemory;
|
PFN_vkMapMemory VMA_NOT_NULL vkMapMemory;
|
||||||
PFN_vkUnmapMemory vkUnmapMemory;
|
PFN_vkUnmapMemory VMA_NOT_NULL vkUnmapMemory;
|
||||||
PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges;
|
PFN_vkFlushMappedMemoryRanges VMA_NOT_NULL vkFlushMappedMemoryRanges;
|
||||||
PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges;
|
PFN_vkInvalidateMappedMemoryRanges VMA_NOT_NULL vkInvalidateMappedMemoryRanges;
|
||||||
PFN_vkBindBufferMemory vkBindBufferMemory;
|
PFN_vkBindBufferMemory VMA_NOT_NULL vkBindBufferMemory;
|
||||||
PFN_vkBindImageMemory vkBindImageMemory;
|
PFN_vkBindImageMemory VMA_NOT_NULL vkBindImageMemory;
|
||||||
PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements;
|
PFN_vkGetBufferMemoryRequirements VMA_NOT_NULL vkGetBufferMemoryRequirements;
|
||||||
PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements;
|
PFN_vkGetImageMemoryRequirements VMA_NOT_NULL vkGetImageMemoryRequirements;
|
||||||
PFN_vkCreateBuffer vkCreateBuffer;
|
PFN_vkCreateBuffer VMA_NOT_NULL vkCreateBuffer;
|
||||||
PFN_vkDestroyBuffer vkDestroyBuffer;
|
PFN_vkDestroyBuffer VMA_NOT_NULL vkDestroyBuffer;
|
||||||
PFN_vkCreateImage vkCreateImage;
|
PFN_vkCreateImage VMA_NOT_NULL vkCreateImage;
|
||||||
PFN_vkDestroyImage vkDestroyImage;
|
PFN_vkDestroyImage VMA_NOT_NULL vkDestroyImage;
|
||||||
PFN_vkCmdCopyBuffer vkCmdCopyBuffer;
|
PFN_vkCmdCopyBuffer VMA_NOT_NULL vkCmdCopyBuffer;
|
||||||
#if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
|
#if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
|
||||||
PFN_vkGetBufferMemoryRequirements2KHR vkGetBufferMemoryRequirements2KHR;
|
PFN_vkGetBufferMemoryRequirements2KHR VMA_NOT_NULL vkGetBufferMemoryRequirements2KHR;
|
||||||
PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2KHR;
|
PFN_vkGetImageMemoryRequirements2KHR VMA_NOT_NULL vkGetImageMemoryRequirements2KHR;
|
||||||
#endif
|
#endif
|
||||||
#if VMA_BIND_MEMORY2 || VMA_VULKAN_VERSION >= 1001000
|
#if VMA_BIND_MEMORY2 || VMA_VULKAN_VERSION >= 1001000
|
||||||
PFN_vkBindBufferMemory2KHR vkBindBufferMemory2KHR;
|
PFN_vkBindBufferMemory2KHR VMA_NOT_NULL vkBindBufferMemory2KHR;
|
||||||
PFN_vkBindImageMemory2KHR vkBindImageMemory2KHR;
|
PFN_vkBindImageMemory2KHR VMA_NOT_NULL vkBindImageMemory2KHR;
|
||||||
#endif
|
#endif
|
||||||
#if VMA_MEMORY_BUDGET || VMA_VULKAN_VERSION >= 1001000
|
#if VMA_MEMORY_BUDGET || VMA_VULKAN_VERSION >= 1001000
|
||||||
PFN_vkGetPhysicalDeviceMemoryProperties2KHR vkGetPhysicalDeviceMemoryProperties2KHR;
|
PFN_vkGetPhysicalDeviceMemoryProperties2KHR VMA_NOT_NULL vkGetPhysicalDeviceMemoryProperties2KHR;
|
||||||
#endif
|
#endif
|
||||||
} VmaVulkanFunctions;
|
} VmaVulkanFunctions;
|
||||||
|
|
||||||
@ -2199,7 +2252,7 @@ typedef struct VmaRecordSettings
|
|||||||
It will be opened for the whole time #VmaAllocator object is alive.
|
It will be opened for the whole time #VmaAllocator object is alive.
|
||||||
If opening this file fails, creation of the whole allocator object fails.
|
If opening this file fails, creation of the whole allocator object fails.
|
||||||
*/
|
*/
|
||||||
const char* pFilePath;
|
const char* VMA_NOT_NULL pFilePath;
|
||||||
} VmaRecordSettings;
|
} VmaRecordSettings;
|
||||||
|
|
||||||
/// Description of a Allocator to be created.
|
/// Description of a Allocator to be created.
|
||||||
@ -2209,19 +2262,19 @@ typedef struct VmaAllocatorCreateInfo
|
|||||||
VmaAllocatorCreateFlags flags;
|
VmaAllocatorCreateFlags flags;
|
||||||
/// Vulkan physical device.
|
/// Vulkan physical device.
|
||||||
/** It must be valid throughout whole lifetime of created allocator. */
|
/** It must be valid throughout whole lifetime of created allocator. */
|
||||||
VkPhysicalDevice physicalDevice;
|
VkPhysicalDevice VMA_NOT_NULL physicalDevice;
|
||||||
/// Vulkan device.
|
/// Vulkan device.
|
||||||
/** It must be valid throughout whole lifetime of created allocator. */
|
/** It must be valid throughout whole lifetime of created allocator. */
|
||||||
VkDevice device;
|
VkDevice VMA_NOT_NULL device;
|
||||||
/// Preferred size of a single `VkDeviceMemory` block to be allocated from large heaps > 1 GiB. Optional.
|
/// Preferred size of a single `VkDeviceMemory` block to be allocated from large heaps > 1 GiB. Optional.
|
||||||
/** Set to 0 to use default, which is currently 256 MiB. */
|
/** Set to 0 to use default, which is currently 256 MiB. */
|
||||||
VkDeviceSize preferredLargeHeapBlockSize;
|
VkDeviceSize preferredLargeHeapBlockSize;
|
||||||
/// Custom CPU memory allocation callbacks. Optional.
|
/// Custom CPU memory allocation callbacks. Optional.
|
||||||
/** Optional, can be null. When specified, will also be used for all CPU-side memory allocations. */
|
/** Optional, can be null. When specified, will also be used for all CPU-side memory allocations. */
|
||||||
const VkAllocationCallbacks* pAllocationCallbacks;
|
const VkAllocationCallbacks* VMA_NULLABLE pAllocationCallbacks;
|
||||||
/// Informative callbacks for `vkAllocateMemory`, `vkFreeMemory`. Optional.
|
/// Informative callbacks for `vkAllocateMemory`, `vkFreeMemory`. Optional.
|
||||||
/** Optional, can be null. */
|
/** Optional, can be null. */
|
||||||
const VmaDeviceMemoryCallbacks* pDeviceMemoryCallbacks;
|
const VmaDeviceMemoryCallbacks* VMA_NULLABLE pDeviceMemoryCallbacks;
|
||||||
/** \brief Maximum number of additional frames that are in use at the same time as current frame.
|
/** \brief Maximum number of additional frames that are in use at the same time as current frame.
|
||||||
|
|
||||||
This value is used only when you make allocations with
|
This value is used only when you make allocations with
|
||||||
@ -2260,24 +2313,25 @@ typedef struct VmaAllocatorCreateInfo
|
|||||||
blocks to system RAM. This driver behavior can also be controlled using
|
blocks to system RAM. This driver behavior can also be controlled using
|
||||||
VK_AMD_memory_overallocation_behavior extension.
|
VK_AMD_memory_overallocation_behavior extension.
|
||||||
*/
|
*/
|
||||||
const VkDeviceSize* pHeapSizeLimit;
|
const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL("VkPhysicalDeviceMemoryProperties::memoryHeapCount") pHeapSizeLimit;
|
||||||
|
|
||||||
/** \brief Pointers to Vulkan functions. Can be null.
|
/** \brief Pointers to Vulkan functions. Can be null.
|
||||||
|
|
||||||
For details see [Pointers to Vulkan functions](@ref config_Vulkan_functions).
|
For details see [Pointers to Vulkan functions](@ref config_Vulkan_functions).
|
||||||
*/
|
*/
|
||||||
const VmaVulkanFunctions* pVulkanFunctions;
|
const VmaVulkanFunctions* VMA_NULLABLE pVulkanFunctions;
|
||||||
/** \brief Parameters for recording of VMA calls. Can be null.
|
/** \brief Parameters for recording of VMA calls. Can be null.
|
||||||
|
|
||||||
If not null, it enables recording of calls to VMA functions to a file.
|
If not null, it enables recording of calls to VMA functions to a file.
|
||||||
If support for recording is not enabled using `VMA_RECORDING_ENABLED` macro,
|
If support for recording is not enabled using `VMA_RECORDING_ENABLED` macro,
|
||||||
creation of the allocator object fails with `VK_ERROR_FEATURE_NOT_PRESENT`.
|
creation of the allocator object fails with `VK_ERROR_FEATURE_NOT_PRESENT`.
|
||||||
*/
|
*/
|
||||||
const VmaRecordSettings* pRecordSettings;
|
const VmaRecordSettings* VMA_NULLABLE pRecordSettings;
|
||||||
/** \brief Handle to Vulkan instance object.
|
/** \brief Handle to Vulkan instance object.
|
||||||
|
|
||||||
Starting from version 3.0.0 this member is no longer optional, it must be set!
|
Starting from version 3.0.0 this member is no longer optional, it must be set!
|
||||||
*/
|
*/
|
||||||
VkInstance instance;
|
VkInstance VMA_NOT_NULL instance;
|
||||||
/** \brief Optional. The highest version of Vulkan that the application is designed to use.
|
/** \brief Optional. The highest version of Vulkan that the application is designed to use.
|
||||||
|
|
||||||
It must be a value in the format as created by macro `VK_MAKE_VERSION` or a constant like: `VK_API_VERSION_1_1`, `VK_API_VERSION_1_0`.
|
It must be a value in the format as created by macro `VK_MAKE_VERSION` or a constant like: `VK_API_VERSION_1_1`, `VK_API_VERSION_1_0`.
|
||||||
@ -2291,12 +2345,12 @@ typedef struct VmaAllocatorCreateInfo
|
|||||||
|
|
||||||
/// Creates Allocator object.
|
/// Creates Allocator object.
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAllocator(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAllocator(
|
||||||
const VmaAllocatorCreateInfo* pCreateInfo,
|
const VmaAllocatorCreateInfo* VMA_NOT_NULL pCreateInfo,
|
||||||
VmaAllocator* pAllocator);
|
VmaAllocator VMA_NULLABLE * VMA_NOT_NULL pAllocator);
|
||||||
|
|
||||||
/// Destroys allocator object.
|
/// Destroys allocator object.
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaDestroyAllocator(
|
VMA_CALL_PRE void VMA_CALL_POST vmaDestroyAllocator(
|
||||||
VmaAllocator allocator);
|
VmaAllocator VMA_NULLABLE allocator);
|
||||||
|
|
||||||
/** \brief Information about existing #VmaAllocator object.
|
/** \brief Information about existing #VmaAllocator object.
|
||||||
*/
|
*/
|
||||||
@ -2306,17 +2360,17 @@ typedef struct VmaAllocatorInfo
|
|||||||
|
|
||||||
This is the same value as has been passed through VmaAllocatorCreateInfo::instance.
|
This is the same value as has been passed through VmaAllocatorCreateInfo::instance.
|
||||||
*/
|
*/
|
||||||
VkInstance instance;
|
VkInstance VMA_NOT_NULL instance;
|
||||||
/** \brief Handle to Vulkan physical device object.
|
/** \brief Handle to Vulkan physical device object.
|
||||||
|
|
||||||
This is the same value as has been passed through VmaAllocatorCreateInfo::physicalDevice.
|
This is the same value as has been passed through VmaAllocatorCreateInfo::physicalDevice.
|
||||||
*/
|
*/
|
||||||
VkPhysicalDevice physicalDevice;
|
VkPhysicalDevice VMA_NOT_NULL physicalDevice;
|
||||||
/** \brief Handle to Vulkan device object.
|
/** \brief Handle to Vulkan device object.
|
||||||
|
|
||||||
This is the same value as has been passed through VmaAllocatorCreateInfo::device.
|
This is the same value as has been passed through VmaAllocatorCreateInfo::device.
|
||||||
*/
|
*/
|
||||||
VkDevice device;
|
VkDevice VMA_NOT_NULL device;
|
||||||
} VmaAllocatorInfo;
|
} VmaAllocatorInfo;
|
||||||
|
|
||||||
/** \brief Returns information about existing #VmaAllocator object - handle to Vulkan device etc.
|
/** \brief Returns information about existing #VmaAllocator object - handle to Vulkan device etc.
|
||||||
@ -2324,23 +2378,23 @@ typedef struct VmaAllocatorInfo
|
|||||||
It might be useful if you want to keep just the #VmaAllocator handle and fetch other required handles to
|
It might be useful if you want to keep just the #VmaAllocator handle and fetch other required handles to
|
||||||
`VkPhysicalDevice`, `VkDevice` etc. every time using this function.
|
`VkPhysicalDevice`, `VkDevice` etc. every time using this function.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocatorInfo(VmaAllocator allocator, VmaAllocatorInfo* pAllocatorInfo);
|
VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocatorInfo(VmaAllocator VMA_NOT_NULL allocator, VmaAllocatorInfo* VMA_NOT_NULL pAllocatorInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
PhysicalDeviceProperties are fetched from physicalDevice by the allocator.
|
PhysicalDeviceProperties are fetched from physicalDevice by the allocator.
|
||||||
You can access it here, without fetching it again on your own.
|
You can access it here, without fetching it again on your own.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaGetPhysicalDeviceProperties(
|
VMA_CALL_PRE void VMA_CALL_POST vmaGetPhysicalDeviceProperties(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
const VkPhysicalDeviceProperties** ppPhysicalDeviceProperties);
|
const VkPhysicalDeviceProperties* VMA_NULLABLE * VMA_NOT_NULL ppPhysicalDeviceProperties);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
PhysicalDeviceMemoryProperties are fetched from physicalDevice by the allocator.
|
PhysicalDeviceMemoryProperties are fetched from physicalDevice by the allocator.
|
||||||
You can access it here, without fetching it again on your own.
|
You can access it here, without fetching it again on your own.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryProperties(
|
VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryProperties(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
const VkPhysicalDeviceMemoryProperties** ppPhysicalDeviceMemoryProperties);
|
const VkPhysicalDeviceMemoryProperties* VMA_NULLABLE * VMA_NOT_NULL ppPhysicalDeviceMemoryProperties);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Given Memory Type Index, returns Property Flags of this memory type.
|
\brief Given Memory Type Index, returns Property Flags of this memory type.
|
||||||
@ -2349,9 +2403,9 @@ This is just a convenience function. Same information can be obtained using
|
|||||||
vmaGetMemoryProperties().
|
vmaGetMemoryProperties().
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryTypeProperties(
|
VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryTypeProperties(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
uint32_t memoryTypeIndex,
|
uint32_t memoryTypeIndex,
|
||||||
VkMemoryPropertyFlags* pFlags);
|
VkMemoryPropertyFlags* VMA_NOT_NULL pFlags);
|
||||||
|
|
||||||
/** \brief Sets index of the current frame.
|
/** \brief Sets index of the current frame.
|
||||||
|
|
||||||
@ -2362,7 +2416,7 @@ when a new frame begins. Allocations queried using vmaGetAllocationInfo() cannot
|
|||||||
become lost in the current frame.
|
become lost in the current frame.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaSetCurrentFrameIndex(
|
VMA_CALL_PRE void VMA_CALL_POST vmaSetCurrentFrameIndex(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
uint32_t frameIndex);
|
uint32_t frameIndex);
|
||||||
|
|
||||||
/** \brief Calculated statistics of memory usage in entire allocator.
|
/** \brief Calculated statistics of memory usage in entire allocator.
|
||||||
@ -2401,8 +2455,8 @@ Note that when using allocator from multiple threads, returned information may i
|
|||||||
become outdated.
|
become outdated.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStats(
|
VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStats(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaStats* pStats);
|
VmaStats* VMA_NOT_NULL pStats);
|
||||||
|
|
||||||
/** \brief Statistics of current memory usage and available budget, in bytes, for specific memory heap.
|
/** \brief Statistics of current memory usage and available budget, in bytes, for specific memory heap.
|
||||||
*/
|
*/
|
||||||
@ -2456,8 +2510,8 @@ Note that when using allocator from multiple threads, returned information may i
|
|||||||
become outdated.
|
become outdated.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaGetBudget(
|
VMA_CALL_PRE void VMA_CALL_POST vmaGetBudget(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaBudget* pBudget);
|
VmaBudget* VMA_NOT_NULL pBudget);
|
||||||
|
|
||||||
#ifndef VMA_STATS_STRING_ENABLED
|
#ifndef VMA_STATS_STRING_ENABLED
|
||||||
#define VMA_STATS_STRING_ENABLED 1
|
#define VMA_STATS_STRING_ENABLED 1
|
||||||
@ -2469,13 +2523,13 @@ VMA_CALL_PRE void VMA_CALL_POST vmaGetBudget(
|
|||||||
/** @param[out] ppStatsString Must be freed using vmaFreeStatsString() function.
|
/** @param[out] ppStatsString Must be freed using vmaFreeStatsString() function.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaBuildStatsString(
|
VMA_CALL_PRE void VMA_CALL_POST vmaBuildStatsString(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
char** ppStatsString,
|
char* VMA_NULLABLE * VMA_NOT_NULL ppStatsString,
|
||||||
VkBool32 detailedMap);
|
VkBool32 detailedMap);
|
||||||
|
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString(
|
VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
char* pStatsString);
|
char* VMA_NULLABLE pStatsString);
|
||||||
|
|
||||||
#endif // #if VMA_STATS_STRING_ENABLED
|
#endif // #if VMA_STATS_STRING_ENABLED
|
||||||
|
|
||||||
@ -2701,14 +2755,14 @@ typedef struct VmaAllocationCreateInfo
|
|||||||
Leave `VK_NULL_HANDLE` to allocate from default pool. If not null, members:
|
Leave `VK_NULL_HANDLE` to allocate from default pool. If not null, members:
|
||||||
`usage`, `requiredFlags`, `preferredFlags`, `memoryTypeBits` are ignored.
|
`usage`, `requiredFlags`, `preferredFlags`, `memoryTypeBits` are ignored.
|
||||||
*/
|
*/
|
||||||
VmaPool pool;
|
VmaPool VMA_NULLABLE pool;
|
||||||
/** \brief Custom general-purpose pointer that will be stored in #VmaAllocation, can be read as VmaAllocationInfo::pUserData and changed using vmaSetAllocationUserData().
|
/** \brief Custom general-purpose pointer that will be stored in #VmaAllocation, can be read as VmaAllocationInfo::pUserData and changed using vmaSetAllocationUserData().
|
||||||
|
|
||||||
If #VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT is used, it must be either
|
If #VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT is used, it must be either
|
||||||
null or pointer to a null-terminated string. The string will be then copied to
|
null or pointer to a null-terminated string. The string will be then copied to
|
||||||
internal buffer, so it doesn't need to be valid after allocation call.
|
internal buffer, so it doesn't need to be valid after allocation call.
|
||||||
*/
|
*/
|
||||||
void* pUserData;
|
void* VMA_NULLABLE pUserData;
|
||||||
} VmaAllocationCreateInfo;
|
} VmaAllocationCreateInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2728,10 +2782,10 @@ type of resource you want to use it for. Please check parameters of your
|
|||||||
resource, like image layout (OPTIMAL versus LINEAR) or mip level count.
|
resource, like image layout (OPTIMAL versus LINEAR) or mip level count.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndex(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndex(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
uint32_t memoryTypeBits,
|
uint32_t memoryTypeBits,
|
||||||
const VmaAllocationCreateInfo* pAllocationCreateInfo,
|
const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
|
||||||
uint32_t* pMemoryTypeIndex);
|
uint32_t* VMA_NOT_NULL pMemoryTypeIndex);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
|
\brief Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
|
||||||
@ -2746,10 +2800,10 @@ It is just a convenience function, equivalent to calling:
|
|||||||
- `vkDestroyBuffer`
|
- `vkDestroyBuffer`
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForBufferInfo(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForBufferInfo(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
const VkBufferCreateInfo* pBufferCreateInfo,
|
const VkBufferCreateInfo* VMA_NOT_NULL pBufferCreateInfo,
|
||||||
const VmaAllocationCreateInfo* pAllocationCreateInfo,
|
const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
|
||||||
uint32_t* pMemoryTypeIndex);
|
uint32_t* VMA_NOT_NULL pMemoryTypeIndex);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo.
|
\brief Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo.
|
||||||
@ -2764,10 +2818,10 @@ It is just a convenience function, equivalent to calling:
|
|||||||
- `vkDestroyImage`
|
- `vkDestroyImage`
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForImageInfo(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForImageInfo(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
const VkImageCreateInfo* pImageCreateInfo,
|
const VkImageCreateInfo* VMA_NOT_NULL pImageCreateInfo,
|
||||||
const VmaAllocationCreateInfo* pAllocationCreateInfo,
|
const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
|
||||||
uint32_t* pMemoryTypeIndex);
|
uint32_t* VMA_NOT_NULL pMemoryTypeIndex);
|
||||||
|
|
||||||
/// Flags to be passed as VmaPoolCreateInfo::flags.
|
/// Flags to be passed as VmaPoolCreateInfo::flags.
|
||||||
typedef enum VmaPoolCreateFlagBits {
|
typedef enum VmaPoolCreateFlagBits {
|
||||||
@ -2909,15 +2963,15 @@ typedef struct VmaPoolStats {
|
|||||||
@param[out] pPool Handle to created pool.
|
@param[out] pPool Handle to created pool.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreatePool(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreatePool(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
const VmaPoolCreateInfo* pCreateInfo,
|
const VmaPoolCreateInfo* VMA_NOT_NULL pCreateInfo,
|
||||||
VmaPool* pPool);
|
VmaPool VMA_NULLABLE * VMA_NOT_NULL pPool);
|
||||||
|
|
||||||
/** \brief Destroys #VmaPool object and frees Vulkan device memory.
|
/** \brief Destroys #VmaPool object and frees Vulkan device memory.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaDestroyPool(
|
VMA_CALL_PRE void VMA_CALL_POST vmaDestroyPool(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaPool pool);
|
VmaPool VMA_NULLABLE pool);
|
||||||
|
|
||||||
/** \brief Retrieves statistics of existing #VmaPool object.
|
/** \brief Retrieves statistics of existing #VmaPool object.
|
||||||
|
|
||||||
@ -2926,9 +2980,9 @@ VMA_CALL_PRE void VMA_CALL_POST vmaDestroyPool(
|
|||||||
@param[out] pPoolStats Statistics of specified pool.
|
@param[out] pPoolStats Statistics of specified pool.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolStats(
|
VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolStats(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaPool pool,
|
VmaPool VMA_NOT_NULL pool,
|
||||||
VmaPoolStats* pPoolStats);
|
VmaPoolStats* VMA_NOT_NULL pPoolStats);
|
||||||
|
|
||||||
/** \brief Marks all allocations in given pool as lost if they are not used in current frame or VmaPoolCreateInfo::frameInUseCount back from now.
|
/** \brief Marks all allocations in given pool as lost if they are not used in current frame or VmaPoolCreateInfo::frameInUseCount back from now.
|
||||||
|
|
||||||
@ -2937,9 +2991,9 @@ VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolStats(
|
|||||||
@param[out] pLostAllocationCount Number of allocations marked as lost. Optional - pass null if you don't need this information.
|
@param[out] pLostAllocationCount Number of allocations marked as lost. Optional - pass null if you don't need this information.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaMakePoolAllocationsLost(
|
VMA_CALL_PRE void VMA_CALL_POST vmaMakePoolAllocationsLost(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaPool pool,
|
VmaPool VMA_NOT_NULL pool,
|
||||||
size_t* pLostAllocationCount);
|
size_t* VMA_NULLABLE pLostAllocationCount);
|
||||||
|
|
||||||
/** \brief Checks magic number in margins around all allocations in given memory pool in search for corruptions.
|
/** \brief Checks magic number in margins around all allocations in given memory pool in search for corruptions.
|
||||||
|
|
||||||
@ -2955,7 +3009,7 @@ Possible return values:
|
|||||||
`VMA_ASSERT` is also fired in that case.
|
`VMA_ASSERT` is also fired in that case.
|
||||||
- Other value: Error returned by Vulkan, e.g. memory mapping failure.
|
- Other value: Error returned by Vulkan, e.g. memory mapping failure.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckPoolCorruption(VmaAllocator allocator, VmaPool pool);
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckPoolCorruption(VmaAllocator VMA_NOT_NULL allocator, VmaPool VMA_NOT_NULL pool);
|
||||||
|
|
||||||
/** \brief Retrieves name of a custom pool.
|
/** \brief Retrieves name of a custom pool.
|
||||||
|
|
||||||
@ -2964,9 +3018,9 @@ containing name of the pool that was previously set. The pointer becomes invalid
|
|||||||
destroyed or its name is changed using vmaSetPoolName().
|
destroyed or its name is changed using vmaSetPoolName().
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolName(
|
VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolName(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaPool pool,
|
VmaPool VMA_NOT_NULL pool,
|
||||||
const char** ppName);
|
const char* VMA_NULLABLE * VMA_NOT_NULL ppName);
|
||||||
|
|
||||||
/** \brief Sets name of a custom pool.
|
/** \brief Sets name of a custom pool.
|
||||||
|
|
||||||
@ -2974,9 +3028,9 @@ VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolName(
|
|||||||
Function makes internal copy of the string, so it can be changed or freed immediately after this call.
|
Function makes internal copy of the string, so it can be changed or freed immediately after this call.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaSetPoolName(
|
VMA_CALL_PRE void VMA_CALL_POST vmaSetPoolName(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaPool pool,
|
VmaPool VMA_NOT_NULL pool,
|
||||||
const char* pName);
|
const char* VMA_NULLABLE pName);
|
||||||
|
|
||||||
/** \struct VmaAllocation
|
/** \struct VmaAllocation
|
||||||
\brief Represents single memory allocation.
|
\brief Represents single memory allocation.
|
||||||
@ -3020,7 +3074,7 @@ typedef struct VmaAllocationInfo {
|
|||||||
|
|
||||||
If the allocation is lost, it is equal to `VK_NULL_HANDLE`.
|
If the allocation is lost, it is equal to `VK_NULL_HANDLE`.
|
||||||
*/
|
*/
|
||||||
VkDeviceMemory deviceMemory;
|
VkDeviceMemory VMA_NULLABLE_NON_DISPATCHABLE deviceMemory;
|
||||||
/** \brief Offset into deviceMemory object to the beginning of this allocation, in bytes. (deviceMemory, offset) pair is unique to this allocation.
|
/** \brief Offset into deviceMemory object to the beginning of this allocation, in bytes. (deviceMemory, offset) pair is unique to this allocation.
|
||||||
|
|
||||||
It can change after call to vmaDefragment() if this allocation is passed to the function, or if allocation is lost.
|
It can change after call to vmaDefragment() if this allocation is passed to the function, or if allocation is lost.
|
||||||
@ -3034,17 +3088,17 @@ typedef struct VmaAllocationInfo {
|
|||||||
/** \brief Pointer to the beginning of this allocation as mapped data.
|
/** \brief Pointer to the beginning of this allocation as mapped data.
|
||||||
|
|
||||||
If the allocation hasn't been mapped using vmaMapMemory() and hasn't been
|
If the allocation hasn't been mapped using vmaMapMemory() and hasn't been
|
||||||
created with #VMA_ALLOCATION_CREATE_MAPPED_BIT flag, this value null.
|
created with #VMA_ALLOCATION_CREATE_MAPPED_BIT flag, this value is null.
|
||||||
|
|
||||||
It can change after call to vmaMapMemory(), vmaUnmapMemory().
|
It can change after call to vmaMapMemory(), vmaUnmapMemory().
|
||||||
It can also change after call to vmaDefragment() if this allocation is passed to the function.
|
It can also change after call to vmaDefragment() if this allocation is passed to the function.
|
||||||
*/
|
*/
|
||||||
void* pMappedData;
|
void* VMA_NULLABLE pMappedData;
|
||||||
/** \brief Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vmaSetAllocationUserData().
|
/** \brief Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vmaSetAllocationUserData().
|
||||||
|
|
||||||
It can change after call to vmaSetAllocationUserData() for this allocation.
|
It can change after call to vmaSetAllocationUserData() for this allocation.
|
||||||
*/
|
*/
|
||||||
void* pUserData;
|
void* VMA_NULLABLE pUserData;
|
||||||
} VmaAllocationInfo;
|
} VmaAllocationInfo;
|
||||||
|
|
||||||
/** \brief General purpose memory allocation.
|
/** \brief General purpose memory allocation.
|
||||||
@ -3058,11 +3112,11 @@ It is recommended to use vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage
|
|||||||
vmaCreateBuffer(), vmaCreateImage() instead whenever possible.
|
vmaCreateBuffer(), vmaCreateImage() instead whenever possible.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
const VkMemoryRequirements* pVkMemoryRequirements,
|
const VkMemoryRequirements* VMA_NOT_NULL pVkMemoryRequirements,
|
||||||
const VmaAllocationCreateInfo* pCreateInfo,
|
const VmaAllocationCreateInfo* VMA_NOT_NULL pCreateInfo,
|
||||||
VmaAllocation* pAllocation,
|
VmaAllocation VMA_NULLABLE * VMA_NOT_NULL pAllocation,
|
||||||
VmaAllocationInfo* pAllocationInfo);
|
VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
|
||||||
|
|
||||||
/** \brief General purpose memory allocation for multiple allocation objects at once.
|
/** \brief General purpose memory allocation for multiple allocation objects at once.
|
||||||
|
|
||||||
@ -3084,12 +3138,12 @@ If any allocation fails, all allocations already made within this function call
|
|||||||
returned result is not `VK_SUCCESS`, `pAllocation` array is always entirely filled with `VK_NULL_HANDLE`.
|
returned result is not `VK_SUCCESS`, `pAllocation` array is always entirely filled with `VK_NULL_HANDLE`.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryPages(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryPages(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
const VkMemoryRequirements* pVkMemoryRequirements,
|
const VkMemoryRequirements* VMA_NOT_NULL pVkMemoryRequirements,
|
||||||
const VmaAllocationCreateInfo* pCreateInfo,
|
const VmaAllocationCreateInfo* VMA_NOT_NULL pCreateInfo,
|
||||||
size_t allocationCount,
|
size_t allocationCount,
|
||||||
VmaAllocation* pAllocations,
|
VmaAllocation VMA_NULLABLE * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations,
|
||||||
VmaAllocationInfo* pAllocationInfo);
|
VmaAllocationInfo* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocationInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@param[out] pAllocation Handle to allocated memory.
|
@param[out] pAllocation Handle to allocated memory.
|
||||||
@ -3098,27 +3152,27 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryPages(
|
|||||||
You should free the memory using vmaFreeMemory().
|
You should free the memory using vmaFreeMemory().
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForBuffer(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForBuffer(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VkBuffer buffer,
|
VkBuffer VMA_NOT_NULL_NON_DISPATCHABLE buffer,
|
||||||
const VmaAllocationCreateInfo* pCreateInfo,
|
const VmaAllocationCreateInfo* VMA_NOT_NULL pCreateInfo,
|
||||||
VmaAllocation* pAllocation,
|
VmaAllocation VMA_NULLABLE * VMA_NOT_NULL pAllocation,
|
||||||
VmaAllocationInfo* pAllocationInfo);
|
VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
|
||||||
|
|
||||||
/// Function similar to vmaAllocateMemoryForBuffer().
|
/// Function similar to vmaAllocateMemoryForBuffer().
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForImage(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForImage(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VkImage image,
|
VkImage VMA_NOT_NULL_NON_DISPATCHABLE image,
|
||||||
const VmaAllocationCreateInfo* pCreateInfo,
|
const VmaAllocationCreateInfo* VMA_NOT_NULL pCreateInfo,
|
||||||
VmaAllocation* pAllocation,
|
VmaAllocation VMA_NULLABLE * VMA_NOT_NULL pAllocation,
|
||||||
VmaAllocationInfo* pAllocationInfo);
|
VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
|
||||||
|
|
||||||
/** \brief Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(), or vmaAllocateMemoryForImage().
|
/** \brief Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(), or vmaAllocateMemoryForImage().
|
||||||
|
|
||||||
Passing `VK_NULL_HANDLE` as `allocation` is valid. Such function call is just skipped.
|
Passing `VK_NULL_HANDLE` as `allocation` is valid. Such function call is just skipped.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemory(
|
VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemory(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaAllocation allocation);
|
const VmaAllocation VMA_NULLABLE allocation);
|
||||||
|
|
||||||
/** \brief Frees memory and destroys multiple allocations.
|
/** \brief Frees memory and destroys multiple allocations.
|
||||||
|
|
||||||
@ -3131,9 +3185,9 @@ Allocations in `pAllocations` array can come from any memory pools and types.
|
|||||||
Passing `VK_NULL_HANDLE` as elements of `pAllocations` array is valid. Such entries are just skipped.
|
Passing `VK_NULL_HANDLE` as elements of `pAllocations` array is valid. Such entries are just skipped.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemoryPages(
|
VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemoryPages(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
size_t allocationCount,
|
size_t allocationCount,
|
||||||
VmaAllocation* pAllocations);
|
const VmaAllocation VMA_NULLABLE * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations);
|
||||||
|
|
||||||
/** \brief Deprecated.
|
/** \brief Deprecated.
|
||||||
|
|
||||||
@ -3143,8 +3197,8 @@ In current version it returns `VK_SUCCESS` only if `newSize` equals current allo
|
|||||||
Otherwise returns `VK_ERROR_OUT_OF_POOL_MEMORY`, indicating that allocation's size could not be changed.
|
Otherwise returns `VK_ERROR_OUT_OF_POOL_MEMORY`, indicating that allocation's size could not be changed.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaResizeAllocation(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaResizeAllocation(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaAllocation allocation,
|
VmaAllocation VMA_NOT_NULL allocation,
|
||||||
VkDeviceSize newSize);
|
VkDeviceSize newSize);
|
||||||
|
|
||||||
/** \brief Returns current information about specified allocation and atomically marks it as used in current frame.
|
/** \brief Returns current information about specified allocation and atomically marks it as used in current frame.
|
||||||
@ -3164,9 +3218,9 @@ you can avoid calling it too often.
|
|||||||
- If you just want to check if allocation is not lost, vmaTouchAllocation() will work faster.
|
- If you just want to check if allocation is not lost, vmaTouchAllocation() will work faster.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocationInfo(
|
VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocationInfo(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaAllocation allocation,
|
VmaAllocation VMA_NOT_NULL allocation,
|
||||||
VmaAllocationInfo* pAllocationInfo);
|
VmaAllocationInfo* VMA_NOT_NULL pAllocationInfo);
|
||||||
|
|
||||||
/** \brief Returns `VK_TRUE` if allocation is not lost and atomically marks it as used in current frame.
|
/** \brief Returns `VK_TRUE` if allocation is not lost and atomically marks it as used in current frame.
|
||||||
|
|
||||||
@ -3183,8 +3237,8 @@ If the allocation has been created without #VMA_ALLOCATION_CREATE_CAN_BECOME_LOS
|
|||||||
this function always returns `VK_TRUE`.
|
this function always returns `VK_TRUE`.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkBool32 VMA_CALL_POST vmaTouchAllocation(
|
VMA_CALL_PRE VkBool32 VMA_CALL_POST vmaTouchAllocation(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaAllocation allocation);
|
VmaAllocation VMA_NOT_NULL allocation);
|
||||||
|
|
||||||
/** \brief Sets pUserData in given allocation to new value.
|
/** \brief Sets pUserData in given allocation to new value.
|
||||||
|
|
||||||
@ -3200,9 +3254,9 @@ allocation's `pUserData`. It is opaque, so you can use it however you want - e.g
|
|||||||
as a pointer, ordinal number or some handle to you own data.
|
as a pointer, ordinal number or some handle to you own data.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaSetAllocationUserData(
|
VMA_CALL_PRE void VMA_CALL_POST vmaSetAllocationUserData(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaAllocation allocation,
|
VmaAllocation VMA_NOT_NULL allocation,
|
||||||
void* pUserData);
|
void* VMA_NULLABLE pUserData);
|
||||||
|
|
||||||
/** \brief Creates new allocation that is in lost state from the beginning.
|
/** \brief Creates new allocation that is in lost state from the beginning.
|
||||||
|
|
||||||
@ -3215,8 +3269,8 @@ not bound to any image or buffer. It has size = 0. It cannot be turned into
|
|||||||
a real, non-empty allocation.
|
a real, non-empty allocation.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaCreateLostAllocation(
|
VMA_CALL_PRE void VMA_CALL_POST vmaCreateLostAllocation(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaAllocation* pAllocation);
|
VmaAllocation VMA_NULLABLE * VMA_NOT_NULL pAllocation);
|
||||||
|
|
||||||
/** \brief Maps memory represented by given allocation and returns pointer to it.
|
/** \brief Maps memory represented by given allocation and returns pointer to it.
|
||||||
|
|
||||||
@ -3257,9 +3311,9 @@ If the allocation is made from a memory types that is not `HOST_COHERENT`,
|
|||||||
you also need to use vmaInvalidateAllocation() / vmaFlushAllocation(), as required by Vulkan specification.
|
you also need to use vmaInvalidateAllocation() / vmaFlushAllocation(), as required by Vulkan specification.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaMapMemory(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaMapMemory(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaAllocation allocation,
|
VmaAllocation VMA_NOT_NULL allocation,
|
||||||
void** ppData);
|
void* VMA_NULLABLE * VMA_NOT_NULL ppData);
|
||||||
|
|
||||||
/** \brief Unmaps memory represented by given allocation, mapped previously using vmaMapMemory().
|
/** \brief Unmaps memory represented by given allocation, mapped previously using vmaMapMemory().
|
||||||
|
|
||||||
@ -3270,8 +3324,8 @@ If the allocation is made from a memory types that is not `HOST_COHERENT`,
|
|||||||
you also need to use vmaInvalidateAllocation() / vmaFlushAllocation(), as required by Vulkan specification.
|
you also need to use vmaInvalidateAllocation() / vmaFlushAllocation(), as required by Vulkan specification.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaUnmapMemory(
|
VMA_CALL_PRE void VMA_CALL_POST vmaUnmapMemory(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaAllocation allocation);
|
VmaAllocation VMA_NOT_NULL allocation);
|
||||||
|
|
||||||
/** \brief Flushes memory of given allocation.
|
/** \brief Flushes memory of given allocation.
|
||||||
|
|
||||||
@ -3291,7 +3345,11 @@ Warning! `offset` and `size` are relative to the contents of given `allocation`.
|
|||||||
If you mean whole allocation, you can pass 0 and `VK_WHOLE_SIZE`, respectively.
|
If you mean whole allocation, you can pass 0 and `VK_WHOLE_SIZE`, respectively.
|
||||||
Do not pass allocation's offset as `offset`!!!
|
Do not pass allocation's offset as `offset`!!!
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaFlushAllocation(VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size);
|
VMA_CALL_PRE void VMA_CALL_POST vmaFlushAllocation(
|
||||||
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
|
VmaAllocation VMA_NOT_NULL allocation,
|
||||||
|
VkDeviceSize offset,
|
||||||
|
VkDeviceSize size);
|
||||||
|
|
||||||
/** \brief Invalidates memory of given allocation.
|
/** \brief Invalidates memory of given allocation.
|
||||||
|
|
||||||
@ -3311,7 +3369,11 @@ Warning! `offset` and `size` are relative to the contents of given `allocation`.
|
|||||||
If you mean whole allocation, you can pass 0 and `VK_WHOLE_SIZE`, respectively.
|
If you mean whole allocation, you can pass 0 and `VK_WHOLE_SIZE`, respectively.
|
||||||
Do not pass allocation's offset as `offset`!!!
|
Do not pass allocation's offset as `offset`!!!
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaInvalidateAllocation(VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size);
|
VMA_CALL_PRE void VMA_CALL_POST vmaInvalidateAllocation(
|
||||||
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
|
VmaAllocation VMA_NOT_NULL allocation,
|
||||||
|
VkDeviceSize offset,
|
||||||
|
VkDeviceSize size);
|
||||||
|
|
||||||
/** \brief Checks magic number in margins around all allocations in given memory types (in both default and custom pools) in search for corruptions.
|
/** \brief Checks magic number in margins around all allocations in given memory types (in both default and custom pools) in search for corruptions.
|
||||||
|
|
||||||
@ -3329,7 +3391,7 @@ Possible return values:
|
|||||||
`VMA_ASSERT` is also fired in that case.
|
`VMA_ASSERT` is also fired in that case.
|
||||||
- Other value: Error returned by Vulkan, e.g. memory mapping failure.
|
- Other value: Error returned by Vulkan, e.g. memory mapping failure.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckCorruption(VmaAllocator allocator, uint32_t memoryTypeBits);
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckCorruption(VmaAllocator VMA_NOT_NULL allocator, uint32_t memoryTypeBits);
|
||||||
|
|
||||||
/** \struct VmaDefragmentationContext
|
/** \struct VmaDefragmentationContext
|
||||||
\brief Represents Opaque object that represents started defragmentation process.
|
\brief Represents Opaque object that represents started defragmentation process.
|
||||||
@ -3365,13 +3427,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* pAllocations;
|
const 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* pAllocationsChanged;
|
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;
|
||||||
@ -3390,7 +3452,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* pPools;
|
const 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.
|
||||||
@ -3419,12 +3481,12 @@ typedef struct VmaDefragmentationInfo2 {
|
|||||||
|
|
||||||
Passing null means that only CPU defragmentation will be performed.
|
Passing null means that only CPU defragmentation will be performed.
|
||||||
*/
|
*/
|
||||||
VkCommandBuffer commandBuffer;
|
VkCommandBuffer VMA_NULLABLE commandBuffer;
|
||||||
} VmaDefragmentationInfo2;
|
} VmaDefragmentationInfo2;
|
||||||
|
|
||||||
typedef struct VmaDefragmentationPassMoveInfo {
|
typedef struct VmaDefragmentationPassMoveInfo {
|
||||||
VmaAllocation allocation;
|
VmaAllocation VMA_NOT_NULL allocation;
|
||||||
VkDeviceMemory memory;
|
VkDeviceMemory VMA_NOT_NULL_NON_DISPATCHABLE memory;
|
||||||
VkDeviceSize offset;
|
VkDeviceSize offset;
|
||||||
} VmaDefragmentationPassMoveInfo;
|
} VmaDefragmentationPassMoveInfo;
|
||||||
|
|
||||||
@ -3434,7 +3496,7 @@ To be used with function vmaBeginDefragmentationPass().
|
|||||||
*/
|
*/
|
||||||
typedef struct VmaDefragmentationPassInfo {
|
typedef struct VmaDefragmentationPassInfo {
|
||||||
uint32_t moveCount;
|
uint32_t moveCount;
|
||||||
VmaDefragmentationPassMoveInfo* pMoves;
|
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().
|
||||||
@ -3496,10 +3558,10 @@ For more information and important limitations regarding defragmentation, see do
|
|||||||
[Defragmentation](@ref defragmentation).
|
[Defragmentation](@ref defragmentation).
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragmentationBegin(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragmentationBegin(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
const VmaDefragmentationInfo2* pInfo,
|
const VmaDefragmentationInfo2* VMA_NOT_NULL pInfo,
|
||||||
VmaDefragmentationStats* pStats,
|
VmaDefragmentationStats* VMA_NULLABLE pStats,
|
||||||
VmaDefragmentationContext *pContext);
|
VmaDefragmentationContext VMA_NULLABLE * VMA_NOT_NULL pContext);
|
||||||
|
|
||||||
/** \brief Ends defragmentation process.
|
/** \brief Ends defragmentation process.
|
||||||
|
|
||||||
@ -3507,17 +3569,17 @@ Use this function to finish defragmentation started by vmaDefragmentationBegin()
|
|||||||
It is safe to pass `context == null`. The function then does nothing.
|
It is safe to pass `context == null`. The function then does nothing.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragmentationEnd(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragmentationEnd(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaDefragmentationContext context);
|
VmaDefragmentationContext VMA_NULLABLE context);
|
||||||
|
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaBeginDefragmentationPass(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaBeginDefragmentationPass(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaDefragmentationContext context,
|
VmaDefragmentationContext VMA_NULLABLE context,
|
||||||
VmaDefragmentationPassInfo* pInfo
|
VmaDefragmentationPassInfo* VMA_NOT_NULL pInfo
|
||||||
);
|
);
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaEndDefragmentationPass(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaEndDefragmentationPass(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaDefragmentationContext context
|
VmaDefragmentationContext VMA_NULLABLE context
|
||||||
);
|
);
|
||||||
|
|
||||||
/** \brief Deprecated. Compacts memory by moving allocations.
|
/** \brief Deprecated. Compacts memory by moving allocations.
|
||||||
@ -3561,12 +3623,12 @@ you should measure that on your platform.
|
|||||||
For more information, see [Defragmentation](@ref defragmentation) chapter.
|
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 allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaAllocation* pAllocations,
|
const VmaAllocation VMA_NOT_NULL * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations,
|
||||||
size_t allocationCount,
|
size_t allocationCount,
|
||||||
VkBool32* pAllocationsChanged,
|
VkBool32* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocationsChanged,
|
||||||
const VmaDefragmentationInfo *pDefragmentationInfo,
|
const VmaDefragmentationInfo* VMA_NULLABLE pDefragmentationInfo,
|
||||||
VmaDefragmentationStats* pDefragmentationStats);
|
VmaDefragmentationStats* VMA_NULLABLE pDefragmentationStats);
|
||||||
|
|
||||||
/** \brief Binds buffer to allocation.
|
/** \brief Binds buffer to allocation.
|
||||||
|
|
||||||
@ -3581,9 +3643,9 @@ allocations, calls to `vkBind*Memory()` or `vkMapMemory()` won't happen from mul
|
|||||||
It is recommended to use function vmaCreateBuffer() instead of this one.
|
It is recommended to use function vmaCreateBuffer() instead of this one.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindBufferMemory(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindBufferMemory(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaAllocation allocation,
|
VmaAllocation VMA_NOT_NULL allocation,
|
||||||
VkBuffer buffer);
|
VkBuffer VMA_NOT_NULL_NON_DISPATCHABLE buffer);
|
||||||
|
|
||||||
/** \brief Binds buffer to allocation with additional parameters.
|
/** \brief Binds buffer to allocation with additional parameters.
|
||||||
|
|
||||||
@ -3596,11 +3658,11 @@ If `pNext` is not null, #VmaAllocator object must have been created with #VMA_AL
|
|||||||
or with VmaAllocatorCreateInfo::vulkanApiVersion `== VK_API_VERSION_1_1`. Otherwise the call fails.
|
or with VmaAllocatorCreateInfo::vulkanApiVersion `== VK_API_VERSION_1_1`. Otherwise the call fails.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindBufferMemory2(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindBufferMemory2(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaAllocation allocation,
|
VmaAllocation VMA_NOT_NULL allocation,
|
||||||
VkDeviceSize allocationLocalOffset,
|
VkDeviceSize allocationLocalOffset,
|
||||||
VkBuffer buffer,
|
VkBuffer VMA_NOT_NULL_NON_DISPATCHABLE buffer,
|
||||||
const void* pNext);
|
const void* VMA_NULLABLE pNext);
|
||||||
|
|
||||||
/** \brief Binds image to allocation.
|
/** \brief Binds image to allocation.
|
||||||
|
|
||||||
@ -3615,9 +3677,9 @@ allocations, calls to `vkBind*Memory()` or `vkMapMemory()` won't happen from mul
|
|||||||
It is recommended to use function vmaCreateImage() instead of this one.
|
It is recommended to use function vmaCreateImage() instead of this one.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaAllocation allocation,
|
VmaAllocation VMA_NOT_NULL allocation,
|
||||||
VkImage image);
|
VkImage VMA_NOT_NULL_NON_DISPATCHABLE image);
|
||||||
|
|
||||||
/** \brief Binds image to allocation with additional parameters.
|
/** \brief Binds image to allocation with additional parameters.
|
||||||
|
|
||||||
@ -3630,11 +3692,11 @@ If `pNext` is not null, #VmaAllocator object must have been created with #VMA_AL
|
|||||||
or with VmaAllocatorCreateInfo::vulkanApiVersion `== VK_API_VERSION_1_1`. Otherwise the call fails.
|
or with VmaAllocatorCreateInfo::vulkanApiVersion `== VK_API_VERSION_1_1`. Otherwise the call fails.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory2(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory2(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VmaAllocation allocation,
|
VmaAllocation VMA_NOT_NULL allocation,
|
||||||
VkDeviceSize allocationLocalOffset,
|
VkDeviceSize allocationLocalOffset,
|
||||||
VkImage image,
|
VkImage VMA_NOT_NULL_NON_DISPATCHABLE image,
|
||||||
const void* pNext);
|
const void* VMA_NULLABLE pNext);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@param[out] pBuffer Buffer that was created.
|
@param[out] pBuffer Buffer that was created.
|
||||||
@ -3663,12 +3725,12 @@ allocation for this buffer, just like when using
|
|||||||
VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
|
VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBuffer(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBuffer(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
const VkBufferCreateInfo* pBufferCreateInfo,
|
const VkBufferCreateInfo* VMA_NOT_NULL pBufferCreateInfo,
|
||||||
const VmaAllocationCreateInfo* pAllocationCreateInfo,
|
const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
|
||||||
VkBuffer* pBuffer,
|
VkBuffer VMA_NULLABLE_NON_DISPATCHABLE * VMA_NOT_NULL pBuffer,
|
||||||
VmaAllocation* pAllocation,
|
VmaAllocation VMA_NULLABLE * VMA_NOT_NULL pAllocation,
|
||||||
VmaAllocationInfo* pAllocationInfo);
|
VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
|
||||||
|
|
||||||
/** \brief Destroys Vulkan buffer and frees allocated memory.
|
/** \brief Destroys Vulkan buffer and frees allocated memory.
|
||||||
|
|
||||||
@ -3682,18 +3744,18 @@ vmaFreeMemory(allocator, allocation);
|
|||||||
It it safe to pass null as buffer and/or allocation.
|
It it safe to pass null as buffer and/or allocation.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaDestroyBuffer(
|
VMA_CALL_PRE void VMA_CALL_POST vmaDestroyBuffer(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VkBuffer buffer,
|
VkBuffer VMA_NULLABLE_NON_DISPATCHABLE buffer,
|
||||||
VmaAllocation allocation);
|
VmaAllocation VMA_NULLABLE allocation);
|
||||||
|
|
||||||
/// Function similar to vmaCreateBuffer().
|
/// Function similar to vmaCreateBuffer().
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateImage(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateImage(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
const VkImageCreateInfo* pImageCreateInfo,
|
const VkImageCreateInfo* VMA_NOT_NULL pImageCreateInfo,
|
||||||
const VmaAllocationCreateInfo* pAllocationCreateInfo,
|
const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
|
||||||
VkImage* pImage,
|
VkImage VMA_NULLABLE_NON_DISPATCHABLE * VMA_NOT_NULL pImage,
|
||||||
VmaAllocation* pAllocation,
|
VmaAllocation VMA_NULLABLE * VMA_NOT_NULL pAllocation,
|
||||||
VmaAllocationInfo* pAllocationInfo);
|
VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
|
||||||
|
|
||||||
/** \brief Destroys Vulkan image and frees allocated memory.
|
/** \brief Destroys Vulkan image and frees allocated memory.
|
||||||
|
|
||||||
@ -3707,9 +3769,9 @@ vmaFreeMemory(allocator, allocation);
|
|||||||
It it safe to pass null as image and/or allocation.
|
It it safe to pass null as image and/or allocation.
|
||||||
*/
|
*/
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaDestroyImage(
|
VMA_CALL_PRE void VMA_CALL_POST vmaDestroyImage(
|
||||||
VmaAllocator allocator,
|
VmaAllocator VMA_NOT_NULL allocator,
|
||||||
VkImage image,
|
VkImage VMA_NULLABLE_NON_DISPATCHABLE image,
|
||||||
VmaAllocation allocation);
|
VmaAllocation VMA_NULLABLE allocation);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
@ -3725,6 +3787,12 @@ VMA_CALL_PRE void VMA_CALL_POST vmaDestroyImage(
|
|||||||
#ifdef VMA_IMPLEMENTATION
|
#ifdef VMA_IMPLEMENTATION
|
||||||
#undef VMA_IMPLEMENTATION
|
#undef VMA_IMPLEMENTATION
|
||||||
|
|
||||||
|
// Only the public API has nullability annotations, not the implementation
|
||||||
|
#ifdef __clang__
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wnullability-completeness"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@ -7127,10 +7195,10 @@ public:
|
|||||||
VmaDefragmentationStats* pStats);
|
VmaDefragmentationStats* pStats);
|
||||||
~VmaDefragmentationContext_T();
|
~VmaDefragmentationContext_T();
|
||||||
|
|
||||||
void AddPools(uint32_t poolCount, VmaPool* pPools);
|
void AddPools(uint32_t poolCount, const VmaPool* pPools);
|
||||||
void AddAllocations(
|
void AddAllocations(
|
||||||
uint32_t allocationCount,
|
uint32_t allocationCount,
|
||||||
VmaAllocation* pAllocations,
|
const VmaAllocation* pAllocations,
|
||||||
VkBool32* pAllocationsChanged);
|
VkBool32* pAllocationsChanged);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -14237,7 +14305,7 @@ VmaDefragmentationContext_T::~VmaDefragmentationContext_T()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
for(uint32_t poolIndex = 0; poolIndex < poolCount; ++poolIndex)
|
||||||
{
|
{
|
||||||
@ -14274,7 +14342,7 @@ void VmaDefragmentationContext_T::AddPools(uint32_t poolCount, VmaPool* pPools)
|
|||||||
|
|
||||||
void VmaDefragmentationContext_T::AddAllocations(
|
void VmaDefragmentationContext_T::AddAllocations(
|
||||||
uint32_t allocationCount,
|
uint32_t allocationCount,
|
||||||
VmaAllocation* pAllocations,
|
const VmaAllocation* pAllocations,
|
||||||
VkBool32* pAllocationsChanged)
|
VkBool32* pAllocationsChanged)
|
||||||
{
|
{
|
||||||
// Dispatch pAllocations among defragmentators. Create them when necessary.
|
// Dispatch pAllocations among defragmentators. Create them when necessary.
|
||||||
@ -17630,7 +17698,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolName(
|
|||||||
VmaPool pool,
|
VmaPool pool,
|
||||||
const char** ppName)
|
const char** ppName)
|
||||||
{
|
{
|
||||||
VMA_ASSERT(allocator && pool);
|
VMA_ASSERT(allocator && pool && ppName);
|
||||||
|
|
||||||
VMA_DEBUG_LOG("vmaGetPoolName");
|
VMA_DEBUG_LOG("vmaGetPoolName");
|
||||||
|
|
||||||
@ -17895,7 +17963,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemory(
|
|||||||
VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemoryPages(
|
VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemoryPages(
|
||||||
VmaAllocator allocator,
|
VmaAllocator allocator,
|
||||||
size_t allocationCount,
|
size_t allocationCount,
|
||||||
VmaAllocation* pAllocations)
|
const VmaAllocation* pAllocations)
|
||||||
{
|
{
|
||||||
if(allocationCount == 0)
|
if(allocationCount == 0)
|
||||||
{
|
{
|
||||||
@ -18114,7 +18182,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckCorruption(VmaAllocator allocator, u
|
|||||||
|
|
||||||
VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragment(
|
VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragment(
|
||||||
VmaAllocator allocator,
|
VmaAllocator allocator,
|
||||||
VmaAllocation* pAllocations,
|
const VmaAllocation* pAllocations,
|
||||||
size_t allocationCount,
|
size_t allocationCount,
|
||||||
VkBool32* pAllocationsChanged,
|
VkBool32* pAllocationsChanged,
|
||||||
const VmaDefragmentationInfo *pDefragmentationInfo,
|
const VmaDefragmentationInfo *pDefragmentationInfo,
|
||||||
@ -18588,4 +18656,9 @@ VMA_CALL_PRE void VMA_CALL_POST vmaDestroyImage(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
// -Wnullability-completeness
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // #ifdef VMA_IMPLEMENTATION
|
#endif // #ifdef VMA_IMPLEMENTATION
|
||||||
|
Loading…
Reference in New Issue
Block a user