[][src]Struct vk_mem::AllocationCreateFlags

pub struct AllocationCreateFlags { /* fields omitted */ }

Flags for configuring Allocation construction.

Methods

impl AllocationCreateFlags[src]

pub const NONE: AllocationCreateFlags[src]

Default configuration for allocation.

pub const DEDICATED_MEMORY: AllocationCreateFlags[src]

Set this flag if the allocation should have its own memory block.

Use it for special, big resources, like fullscreen images used as attachments.

You should not use this flag if AllocationCreateInfo::pool is not None.

pub const NEVER_ALLOCATE: AllocationCreateFlags[src]

Set this flag to only try to allocate from existing ash::vk::DeviceMemory blocks and never create new such block.

If new allocation cannot be placed in any of the existing blocks, allocation fails with ash::vk::Result::ERROR_OUT_OF_DEVICE_MEMORY error.

You should not use AllocationCreateFlags::DEDICATED_MEMORY and AllocationCreateFlags::NEVER_ALLOCATE at the same time. It makes no sense.

If AllocationCreateInfo::pool is not None, this flag is implied and ignored.

pub const MAPPED: AllocationCreateFlags[src]

Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.

Pointer to mapped memory will be returned through Allocation::get_mapped_data().

Is it valid to use this flag for allocation made from memory type that is not ash::vk::MemoryPropertyFlags::HOST_VISIBLE. This flag is then ignored and memory is not mapped. This is useful if you need an allocation that is efficient to use on GPU (ash::vk::MemoryPropertyFlags::DEVICE_LOCAL) and still want to map it directly if possible on platforms that support it (e.g. Intel GPU).

You should not use this flag together with AllocationCreateFlags::CAN_BECOME_LOST.

pub const CAN_BECOME_LOST: AllocationCreateFlags[src]

Allocation created with this flag can become lost as a result of another allocation with AllocationCreateFlags::CAN_MAKE_OTHER_LOST flag, so you must check it before use.

To check if allocation is not lost, call Allocator::get_allocation_info and check if AllocationInfo::device_memory is not null.

You should not use this flag together with AllocationCreateFlags::MAPPED.

pub const CAN_MAKE_OTHER_LOST: AllocationCreateFlags[src]

While creating allocation using this flag, other allocations that were created with flag AllocationCreateFlags::CAN_BECOME_LOST can become lost.

pub const USER_DATA_COPY_STRING: AllocationCreateFlags[src]

Set this flag to treat AllocationCreateInfo::user_data as pointer to a null-terminated string. Instead of copying pointer value, a local copy of the string is made and stored in allocation's user data. The string is automatically freed together with the allocation. It is also used in Allocator::build_stats_string.

pub const UPPER_ADDRESS: AllocationCreateFlags[src]

Allocation will be created from upper stack in a double stack pool.

This flag is only allowed for custom pools created with AllocatorPoolCreateFlags::LINEAR_ALGORITHM flag.

pub const CREATE_DONT_BIND: AllocationCreateFlags[src]

Create both buffer/image and allocation, but don't bind them together. It is useful when you want to bind yourself to do some more advanced binding, e.g. using some extensions. The flag is meaningful only with functions that bind by default, such as Allocator::create_buffer or Allocator::create_image. Otherwise it is ignored.

pub const STRATEGY_BEST_FIT: AllocationCreateFlags[src]

Allocation strategy that chooses smallest possible free range for the allocation.

pub const STRATEGY_WORST_FIT: AllocationCreateFlags[src]

Allocation strategy that chooses biggest possible free range for the allocation.

pub const STRATEGY_FIRST_FIT: AllocationCreateFlags[src]

Allocation strategy that chooses first suitable free range for the allocation.

"First" doesn't necessarily means the one with smallest offset in memory, but rather the one that is easiest and fastest to find.

pub const STRATEGY_MIN_MEMORY: AllocationCreateFlags[src]

Allocation strategy that tries to minimize memory usage.

pub const STRATEGY_MIN_TIME: AllocationCreateFlags[src]

Allocation strategy that tries to minimize allocation time.

pub const STRATEGY_MIN_FRAGMENTATION: AllocationCreateFlags[src]

Allocation strategy that tries to minimize memory fragmentation.

pub const STRATEGY_MASK: AllocationCreateFlags[src]

A bit mask to extract only *_STRATEGY bits from entire set of flags.

pub const fn empty() -> AllocationCreateFlags[src]

Returns an empty set of flags

pub const fn all() -> AllocationCreateFlags[src]

Returns the set containing all flags.

pub const fn bits(&self) -> u32[src]

Returns the raw value of the flags currently stored.

pub fn from_bits(bits: u32) -> Option<AllocationCreateFlags>[src]

Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.

pub const fn from_bits_truncate(bits: u32) -> AllocationCreateFlags[src]

Convert from underlying bit representation, dropping any bits that do not correspond to flags.

pub const unsafe fn from_bits_unchecked(bits: u32) -> AllocationCreateFlags[src]

Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).

pub const fn is_empty(&self) -> bool[src]

Returns true if no flags are currently stored.

pub const fn is_all(&self) -> bool[src]

Returns true if all flags are currently set.

pub const fn intersects(&self, other: AllocationCreateFlags) -> bool[src]

Returns true if there are flags common to both self and other.

pub const fn contains(&self, other: AllocationCreateFlags) -> bool[src]

Returns true all of the flags in other are contained within self.

pub fn insert(&mut self, other: AllocationCreateFlags)[src]

Inserts the specified flags in-place.

pub fn remove(&mut self, other: AllocationCreateFlags)[src]

Removes the specified flags in-place.

pub fn toggle(&mut self, other: AllocationCreateFlags)[src]

Toggles the specified flags in-place.

pub fn set(&mut self, other: AllocationCreateFlags, value: bool)[src]

Inserts or removes the specified flags depending on the passed value.

Trait Implementations

impl Binary for AllocationCreateFlags[src]

impl BitAnd<AllocationCreateFlags> for AllocationCreateFlags[src]

type Output = AllocationCreateFlags

The resulting type after applying the & operator.

fn bitand(self, other: AllocationCreateFlags) -> AllocationCreateFlags[src]

Returns the intersection between the two sets of flags.

impl BitAndAssign<AllocationCreateFlags> for AllocationCreateFlags[src]

fn bitand_assign(&mut self, other: AllocationCreateFlags)[src]

Disables all flags disabled in the set.

impl BitOr<AllocationCreateFlags> for AllocationCreateFlags[src]

type Output = AllocationCreateFlags

The resulting type after applying the | operator.

fn bitor(self, other: AllocationCreateFlags) -> AllocationCreateFlags[src]

Returns the union of the two sets of flags.

impl BitOrAssign<AllocationCreateFlags> for AllocationCreateFlags[src]

fn bitor_assign(&mut self, other: AllocationCreateFlags)[src]

Adds the set of flags.

impl BitXor<AllocationCreateFlags> for AllocationCreateFlags[src]

type Output = AllocationCreateFlags

The resulting type after applying the ^ operator.

fn bitxor(self, other: AllocationCreateFlags) -> AllocationCreateFlags[src]

Returns the left flags, but with all the right flags toggled.

impl BitXorAssign<AllocationCreateFlags> for AllocationCreateFlags[src]

fn bitxor_assign(&mut self, other: AllocationCreateFlags)[src]

Toggles the set of flags.

impl Clone for AllocationCreateFlags[src]

impl Copy for AllocationCreateFlags[src]

impl Debug for AllocationCreateFlags[src]

impl Eq for AllocationCreateFlags[src]

impl Extend<AllocationCreateFlags> for AllocationCreateFlags[src]

impl FromIterator<AllocationCreateFlags> for AllocationCreateFlags[src]

impl Hash for AllocationCreateFlags[src]

impl LowerHex for AllocationCreateFlags[src]

impl Not for AllocationCreateFlags[src]

type Output = AllocationCreateFlags

The resulting type after applying the ! operator.

fn not(self) -> AllocationCreateFlags[src]

Returns the complement of this set of flags.

impl Octal for AllocationCreateFlags[src]

impl Ord for AllocationCreateFlags[src]

impl PartialEq<AllocationCreateFlags> for AllocationCreateFlags[src]

impl PartialOrd<AllocationCreateFlags> for AllocationCreateFlags[src]

impl StructuralEq for AllocationCreateFlags[src]

impl StructuralPartialEq for AllocationCreateFlags[src]

impl Sub<AllocationCreateFlags> for AllocationCreateFlags[src]

type Output = AllocationCreateFlags

The resulting type after applying the - operator.

fn sub(self, other: AllocationCreateFlags) -> AllocationCreateFlags[src]

Returns the set difference of the two sets of flags.

impl SubAssign<AllocationCreateFlags> for AllocationCreateFlags[src]

fn sub_assign(&mut self, other: AllocationCreateFlags)[src]

Disables all flags enabled in the set.

impl UpperHex for AllocationCreateFlags[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.