Struct vk_mem_erupt::ffi::VmaAllocationInfo[][src]

#[repr(C)]
pub struct VmaAllocationInfo { pub memoryType: u32, pub deviceMemory: VkDeviceMemory, pub offset: VkDeviceSize, pub size: VkDeviceSize, pub pMappedData: *mut c_void, pub pUserData: *mut c_void, }
Expand description

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

Fields

memoryType: u32

\brief Memory type index that this allocation was allocated from.

It never changes.

deviceMemory: VkDeviceMemory

\brief Handle to Vulkan memory object.

Same memory object can be shared by multiple allocations.

It can change after call to vmaDefragment() if this allocation is passed to the function, or if allocation is lost.

If the allocation is lost, it is equal to VK_NULL_HANDLE.

offset: VkDeviceSize

\brief 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 call to vmaDefragment() if this allocation is passed to the function, or if allocation is lost.

size: VkDeviceSize

\brief Size of this allocation, in bytes.

It never changes, unless allocation is lost.

\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.

pMappedData: *mut c_void

\brief 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 call to vmaDefragment() if this allocation is passed to the function.

pUserData: *mut c_void

\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.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.