[−]Struct vk_mem::AllocationCreateFlags
Flags for configuring Allocation
construction.
Methods
impl AllocationCreateFlags
pub const NONE: AllocationCreateFlags
Default configuration for allocation.
pub const DEDICATED_MEMORY: AllocationCreateFlags
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
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
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
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
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
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
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
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
Allocation strategy that chooses smallest possible free range for the allocation.
pub const STRATEGY_WORST_FIT: AllocationCreateFlags
Allocation strategy that chooses biggest possible free range for the allocation.
pub const STRATEGY_FIRST_FIT: AllocationCreateFlags
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
Allocation strategy that tries to minimize memory usage.
pub const STRATEGY_MIN_TIME: AllocationCreateFlags
Allocation strategy that tries to minimize allocation time.
pub const STRATEGY_MIN_FRAGMENTATION: AllocationCreateFlags
Allocation strategy that tries to minimize memory fragmentation.
pub const STRATEGY_MASK: AllocationCreateFlags
A bit mask to extract only *_STRATEGY
bits from entire set of flags.
pub const fn empty() -> AllocationCreateFlags
Returns an empty set of flags
pub const fn all() -> AllocationCreateFlags
Returns the set containing all flags.
pub const fn bits(&self) -> u32
Returns the raw value of the flags currently stored.
pub fn from_bits(bits: u32) -> Option<AllocationCreateFlags>
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
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub const fn is_empty(&self) -> bool
Returns true
if no flags are currently stored.
pub const fn is_all(&self) -> bool
Returns true
if all flags are currently set.
pub const fn intersects(&self, other: AllocationCreateFlags) -> bool
Returns true
if there are flags common to both self
and other
.
pub const fn contains(&self, other: AllocationCreateFlags) -> bool
Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: AllocationCreateFlags)
Inserts the specified flags in-place.
pub fn remove(&mut self, other: AllocationCreateFlags)
Removes the specified flags in-place.
pub fn toggle(&mut self, other: AllocationCreateFlags)
Toggles the specified flags in-place.
pub fn set(&mut self, other: AllocationCreateFlags, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations
impl PartialEq<AllocationCreateFlags> for AllocationCreateFlags
fn eq(&self, other: &AllocationCreateFlags) -> bool
fn ne(&self, other: &AllocationCreateFlags) -> bool
impl Clone for AllocationCreateFlags
fn clone(&self) -> AllocationCreateFlags
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Extend<AllocationCreateFlags> for AllocationCreateFlags
fn extend<T: IntoIterator<Item = AllocationCreateFlags>>(&mut self, iterator: T)
impl PartialOrd<AllocationCreateFlags> for AllocationCreateFlags
fn partial_cmp(&self, other: &AllocationCreateFlags) -> Option<Ordering>
fn lt(&self, other: &AllocationCreateFlags) -> bool
fn le(&self, other: &AllocationCreateFlags) -> bool
fn gt(&self, other: &AllocationCreateFlags) -> bool
fn ge(&self, other: &AllocationCreateFlags) -> bool
impl Eq for AllocationCreateFlags
impl Ord for AllocationCreateFlags
fn cmp(&self, other: &AllocationCreateFlags) -> Ordering
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl Copy for AllocationCreateFlags
impl Debug for AllocationCreateFlags
impl Sub<AllocationCreateFlags> for AllocationCreateFlags
type Output = AllocationCreateFlags
The resulting type after applying the -
operator.
fn sub(self, other: AllocationCreateFlags) -> AllocationCreateFlags
Returns the set difference of the two sets of flags.
impl SubAssign<AllocationCreateFlags> for AllocationCreateFlags
fn sub_assign(&mut self, other: AllocationCreateFlags)
Disables all flags enabled in the set.
impl Not for AllocationCreateFlags
type Output = AllocationCreateFlags
The resulting type after applying the !
operator.
fn not(self) -> AllocationCreateFlags
Returns the complement of this set of flags.
impl BitAnd<AllocationCreateFlags> for AllocationCreateFlags
type Output = AllocationCreateFlags
The resulting type after applying the &
operator.
fn bitand(self, other: AllocationCreateFlags) -> AllocationCreateFlags
Returns the intersection between the two sets of flags.
impl BitOr<AllocationCreateFlags> for AllocationCreateFlags
type Output = AllocationCreateFlags
The resulting type after applying the |
operator.
fn bitor(self, other: AllocationCreateFlags) -> AllocationCreateFlags
Returns the union of the two sets of flags.
impl BitXor<AllocationCreateFlags> for AllocationCreateFlags
type Output = AllocationCreateFlags
The resulting type after applying the ^
operator.
fn bitxor(self, other: AllocationCreateFlags) -> AllocationCreateFlags
Returns the left flags, but with all the right flags toggled.
impl BitAndAssign<AllocationCreateFlags> for AllocationCreateFlags
fn bitand_assign(&mut self, other: AllocationCreateFlags)
Disables all flags disabled in the set.
impl BitOrAssign<AllocationCreateFlags> for AllocationCreateFlags
fn bitor_assign(&mut self, other: AllocationCreateFlags)
Adds the set of flags.
impl BitXorAssign<AllocationCreateFlags> for AllocationCreateFlags
fn bitxor_assign(&mut self, other: AllocationCreateFlags)
Toggles the set of flags.
impl Hash for AllocationCreateFlags
fn hash<__H: Hasher>(&self, state: &mut __H)
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl FromIterator<AllocationCreateFlags> for AllocationCreateFlags
fn from_iter<T: IntoIterator<Item = AllocationCreateFlags>>(
iterator: T
) -> AllocationCreateFlags
iterator: T
) -> AllocationCreateFlags
impl Octal for AllocationCreateFlags
impl Binary for AllocationCreateFlags
impl LowerHex for AllocationCreateFlags
impl UpperHex for AllocationCreateFlags
Auto Trait Implementations
impl Unpin for AllocationCreateFlags
impl Sync for AllocationCreateFlags
impl Send for AllocationCreateFlags
impl RefUnwindSafe for AllocationCreateFlags
impl UnwindSafe for AllocationCreateFlags
Blanket Implementations
impl<T> From<T> for T
[src]
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,