pub struct AllocationInfo {
pub memory_type: u32,
pub device_memory: DeviceMemory,
pub offset: DeviceSize,
pub size: DeviceSize,
pub mapped_data: *mut c_void,
pub user_data: usize,
}
Expand description
Parameters of Allocation
objects, that can be retrieved using Allocator::get_allocation_info
.
Fields§
§memory_type: u32
Memory type index that this allocation was allocated from. It never changes.
device_memory: DeviceMemory
Handle to Vulkan memory object.
Same memory object can be shared by multiple allocations.
It can change after the allocation is moved during \ref defragmentation.
offset: DeviceSize
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 \ref defragmentation.
size: DeviceSize
Size of this allocation, in bytes. It never changes.
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.
mapped_data: *mut c_void
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.
user_data: usize
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§
Source§impl Clone for AllocationInfo
impl Clone for AllocationInfo
Source§fn clone(&self) -> AllocationInfo
fn clone(&self) -> AllocationInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more