Vulkan Memory Allocator: VmaAllocationInfo Struct Reference

Vulkan Memory Allocator

Loading...
Searching...
No Matches
Public Attributes | List of all members
VmaAllocationInfo Struct Reference
Memory allocation

`#include <vk_mem_alloc.h>`

## Public Attributes
uint32_t | memoryType
| Memory type index that this allocation was allocated from.
VkDeviceMemory | deviceMemory
| Handle to Vulkan memory object.
VkDeviceSize | offset
| Offset in `VkDeviceMemory` object to the beginning of this allocation, in bytes. `(deviceMemory, offset)` pair is unique to this allocation.
VkDeviceSize | size
| Size of this allocation, in bytes.
void * | pMappedData
| Pointer to the beginning of this allocation as mapped data.
void * | pUserData
| Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vmaSetAllocationUserData().
const char * | pName
| Custom allocation name that was set with vmaSetAllocationName().

## Detailed Description

Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().

There is also an extended version of this structure that carries additional parameters: VmaAllocationInfo2.

## Member Data Documentation

## ◆ deviceMemory

VkDeviceMemory VmaAllocationInfo::deviceMemory

Handle to Vulkan memory object.

Same memory object can be shared by multiple allocations.

It can change after the allocation is moved during Defragmentation.

## ◆ memoryType

uint32_t VmaAllocationInfo::memoryType

Memory type index that this allocation was allocated from.

It never changes.

## ◆ offset

VkDeviceSize VmaAllocationInfo::offset

Offset in `VkDeviceMemory` object to the beginning of this allocation, in bytes. `(deviceMemory, offset)` pair is unique to this allocation.

You usually don't need to use this offset. If you create a buffer or an image together with the allocation using e.g. function vmaCreateBuffer(), vmaCreateImage(), functions that operate on these resources refer to the beginning of the buffer or image, not entire device memory block. Functions like vmaMapMemory(), vmaBindBufferMemory() also refer to the beginning of the allocation and apply this offset automatically.

It can change after the allocation is moved during Defragmentation.

## ◆ pMappedData

void* VmaAllocationInfo::pMappedData

Pointer to the beginning of this allocation as mapped data.

If the allocation hasn't been mapped using vmaMapMemory() and hasn't been created with VMA_ALLOCATION_CREATE_MAPPED_BIT flag, this value is null.

It can change after call to vmaMapMemory(), vmaUnmapMemory(). It can also change after the allocation is moved during Defragmentation.

## ◆ pName

const char* VmaAllocationInfo::pName

Custom allocation name that was set with vmaSetAllocationName().

It can change after call to vmaSetAllocationName() for this allocation.

Another way to set custom name is to pass it in VmaAllocationCreateInfo::pUserData with additional flag VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT set [DEPRECATED].

## ◆ pUserData

void* VmaAllocationInfo::pUserData

Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vmaSetAllocationUserData().

It can change after call to vmaSetAllocationUserData() for this allocation.

## ◆ size

VkDeviceSize VmaAllocationInfo::size

Size of this allocation, in bytes.

It never changes.

Note
  Allocation size returned in this variable may be greater than the size requested for the resource e.g. as `VkBufferCreateInfo::size`. Whole size of the allocation is accessible for operations on memory e.g. using a pointer after mapping with vmaMapMemory(), but operations on the resource e.g. using `vkCmdCopyBuffer` must be limited to the size of the resource.

The documentation for this struct was generated from the following file:

- D:/PROJECTS/Vulkan Memory Allocator/REPO/include/vk_mem_alloc.h