pub trait AllocationTrait {
unsafe fn memory(&self) -> DeviceMemory;
fn offset(&self) -> u64;
fn size(&self) -> u64;
fn mapped_ptr(&self) -> Option<NonNull<c_void>>;
}
Required Methods§
sourceunsafe fn memory(&self) -> DeviceMemory
unsafe fn memory(&self) -> DeviceMemory
Returns the vk::DeviceMemory object that is backing this allocation.
sourcefn offset(&self) -> u64
fn offset(&self) -> u64
Returns the offset of the allocation on the vk::DeviceMemory. When binding the memory to a buffer or image, this offset needs to be supplied as well.
sourcefn mapped_ptr(&self) -> Option<NonNull<c_void>>
fn mapped_ptr(&self) -> Option<NonNull<c_void>>
Returns a valid mapped pointer if the memory is host visible, otherwise it will return None. The pointer already points to the exact memory region of the suballocation, so no offset needs to be applied.