[−][src]Struct vk_mem::AllocationCreateFlags
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]
fn clone(&self) -> AllocationCreateFlags
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for AllocationCreateFlags
[src]
impl Debug for AllocationCreateFlags
[src]
impl Eq for AllocationCreateFlags
[src]
impl Extend<AllocationCreateFlags> for AllocationCreateFlags
[src]
fn extend<T: IntoIterator<Item = AllocationCreateFlags>>(&mut self, iterator: T)
[src]
impl FromIterator<AllocationCreateFlags> for AllocationCreateFlags
[src]
fn from_iter<T: IntoIterator<Item = AllocationCreateFlags>>(
iterator: T
) -> AllocationCreateFlags
[src]
iterator: T
) -> AllocationCreateFlags
impl Hash for AllocationCreateFlags
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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]
fn cmp(&self, other: &AllocationCreateFlags) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<AllocationCreateFlags> for AllocationCreateFlags
[src]
fn eq(&self, other: &AllocationCreateFlags) -> bool
[src]
fn ne(&self, other: &AllocationCreateFlags) -> bool
[src]
impl PartialOrd<AllocationCreateFlags> for AllocationCreateFlags
[src]
fn partial_cmp(&self, other: &AllocationCreateFlags) -> Option<Ordering>
[src]
fn lt(&self, other: &AllocationCreateFlags) -> bool
[src]
fn le(&self, other: &AllocationCreateFlags) -> bool
[src]
fn gt(&self, other: &AllocationCreateFlags) -> bool
[src]
fn ge(&self, other: &AllocationCreateFlags) -> bool
[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
impl RefUnwindSafe for AllocationCreateFlags
impl Send for AllocationCreateFlags
impl Sync for AllocationCreateFlags
impl Unpin for AllocationCreateFlags
impl UnwindSafe for AllocationCreateFlags
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,