Realm

vk::mem · Structs · M1

3 public declarations with native signatures and source-owned contracts.

StRustExperimental

Stvk::mem::MemoryPriority

Contract

Finite native memory priority in the inclusive range 0..=1.

Methods and associated items

new

Method
pub fn new(value: f32) -> Result<Self, AllocError>

Validate a native allocation priority.

Errors

Returns InvalidRequest for NaN, infinities or values outside 0..=1.

get

Method
pub fn get(self) -> f32
No public source comment is attached to this declaration.

fmt

Method
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the value using the given formatter. Read more

eq

Method
fn eq(&self, other: &MemoryPriority) -> bool
Tests for self and other values to be equal, and is used by ==.

Stvk::mem::MemoryStatistics

pub struct MemoryStatistics { pub total: DetailedStatistics, pub memory_types: [DetailedStatistics; 32], pub heaps: [DetailedStatistics; 16], }
Explicit diagnostic snapshot, indexed by native memory type and heap.

Contract

Explicit diagnostic snapshot, indexed by native memory type and heap.

Fields

total

Field
total: DetailedStatistics
No public source comment is attached to this declaration.

memory_types

Field
memory_types: [DetailedStatistics; 32]
No public source comment is attached to this declaration.

heaps

Field
heaps: [DetailedStatistics; 16]
No public source comment is attached to this declaration.

Methods and associated items

new

Method
pub fn new() -> Self

Construct the record with its default state.

set_total

Method
pub fn set_total(self, value: DetailedStatistics) -> Self

Set total and return the updated record.

set_memory_types

Method
pub fn set_memory_types(self, value: [DetailedStatistics; 32]) -> Self

Set memory_types and return the updated record.

set_heaps

Method
pub fn set_heaps(self, value: [DetailedStatistics; 16]) -> Self

Set heaps and return the updated record.

fmt

Method
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the value using the given formatter. Read more

default

Method
fn default() -> MemoryStatistics
Returns the “default value” for a type. Read more

eq

Method
fn eq(&self, other: &MemoryStatistics) -> bool
Tests for self and other values to be equal, and is used by ==.

Stvk::mem::MemoryTypeSelector

Contract

Validated device memory properties and non-coherent atom size.

Methods and associated items

new

Method
pub fn new( properties: PhysicalDeviceMemoryProperties, atom: u64, ) -> Result<Self, AllocError>
No public source comment is attached to this declaration.

find_memory_type

Method
pub fn find_memory_type( &self, request: &AllocRequest, ) -> Result<u32, AllocError>

Select a compatible type; preferred-bit ties retain the lower index.

Donor: VMA VmaAllocator_T::FindMemoryTypeIndex, required-bit test and missing-preferred-bit cost. Adaptation: checked metadata, no hidden usage policy.

find_memory_type_with_preferences

Method
pub fn find_memory_type_with_preferences( &self, request: &AllocRequest, avoided: MemoryPropertyFlags, ) -> Result<u32, AllocError>

Required flags are mandatory; cost counts missing preferred and present avoided bits.