Skip to main content

AllocationInfo

Struct AllocationInfo 

Source
pub struct AllocationInfo {
    pub device_memory: DeviceMemory,
    pub offset: u64,
    pub size: u64,
    pub reserved_size: u64,
    pub memory_type_index: u32,
    pub heap_index: u32,
    pub memory_properties: MemoryPropertyFlags,
    pub mapped_pointer: Option<*mut c_void>,
    pub map_count: u32,
    pub native_size: u64,
    pub is_separate: bool,
    pub user_data: usize,
}
Expand description

Checked binding and mapping snapshot of one live allocation.

Offsets and sizes are native bytes. size is the queried memory requirement, not necessarily the logical buffer size or a linear image’s pixel extent. Copying a snapshot does not retain its allocation, mapping or native objects. Query again after mapping changes; never use a saved pointer after unmap/free.

Fields§

§device_memory: DeviceMemory§offset: u64§size: u64§reserved_size: u64

Includes non-coherent atom padding reserved to a pooled region.

§memory_type_index: u32§heap_index: u32§memory_properties: MemoryPropertyFlags

Actual selected memory properties, rather than requested preferences.

§mapped_pointer: Option<*mut c_void>

Allocation-relative pointer, present only for this region’s mapping hold. Observing this pointer does not acquire a hold or authorize dereferencing it.

§map_count: u32

Explicit mapping holds; persistent mapping is independent.

§native_size: u64

Size of the backing native memory object, including other pooled regions.

§is_separate: bool

Separate native storage rather than a pooled placement (not proof of native dedication).

§user_data: usize

Opaque consumer metadata. No dereference or ownership is inferred.

Implementations§

Source§

impl AllocationInfo

Source

pub fn set_device_memory(self, value: DeviceMemory) -> Self

Set device_memory and return the updated record.

Source

pub fn set_offset(self, value: u64) -> Self

Set offset and return the updated record.

Source

pub fn set_size(self, value: u64) -> Self

Set size and return the updated record.

Source

pub fn set_reserved_size(self, value: u64) -> Self

Set reserved_size and return the updated record.

Source

pub fn set_memory_type_index(self, value: u32) -> Self

Set memory_type_index and return the updated record.

Source

pub fn set_heap_index(self, value: u32) -> Self

Set heap_index and return the updated record.

Source

pub fn set_memory_properties(self, value: MemoryPropertyFlags) -> Self

Set memory_properties and return the updated record.

Source

pub fn set_mapped_pointer(self, value: Option<*mut c_void>) -> Self

Set mapped_pointer and return the updated record.

Source

pub fn set_map_count(self, value: u32) -> Self

Set map_count and return the updated record.

Source

pub fn set_native_size(self, value: u64) -> Self

Set native_size and return the updated record.

Source

pub fn set_is_separate(self, value: bool) -> Self

Set is_separate and return the updated record.

Source

pub fn set_user_data(self, value: usize) -> Self

Set user_data and return the updated record.

Trait Implementations§

Source§

impl Clone for AllocationInfo

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for AllocationInfo

Source§

impl Debug for AllocationInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for AllocationInfo

Source§

impl PartialEq for AllocationInfo

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AllocationInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.