pub struct Semantics { /* private fields */ }Expand description
Memory semantics to determine how some operations should function - used when calling such configurable operations.
Implementations§
Source§impl Semantics
impl Semantics
Sourcepub const ACQUIRE: Semantics
pub const ACQUIRE: Semantics
On an atomic instruction, orders memory operations provided in program order after this atomic instruction against this atomic instruction. On a barrier, orders memory operations provided in program order after this barrier against atomic instructions before this barrier.
Sourcepub const RELEASE: Semantics
pub const RELEASE: Semantics
On an atomic instruction, orders memory operations provided in program order before this atomic instruction against this atomic instruction. On a barrier, orders memory operations provided in program order before this barrier against atomic instructions after this barrier.
Sourcepub const ACQUIRE_RELEASE: Semantics
pub const ACQUIRE_RELEASE: Semantics
Has the properties of both Self::ACQUIRE and Self::RELEASE semantics. It
is used for read-modify-write operations.
Sourcepub const SEQUENTIALLY_CONST: Semantics
pub const SEQUENTIALLY_CONST: Semantics
All observers see this memory access in the same order with respect to
other sequentially-consistent memory accesses from this invocation.
If the declared memory model is vulkan, SEQUENTIALLY_CONST must
not be used.
Sourcepub const UNIFORM_MEMORY: Semantics
pub const UNIFORM_MEMORY: Semantics
Apply the memory-ordering constraints to
[crate::storage_class::StorageBuffer],
[crate::storage_class::PhysicalStorageBuffer], or
[crate::storage_class::Uniform] Storage Class memory.
Sourcepub const SUBGROUP_MEMORY: Semantics
pub const SUBGROUP_MEMORY: Semantics
Apply the memory-ordering constraints to subgroup memory.
Sourcepub const WORKGROUP_MEMORY: Semantics
pub const WORKGROUP_MEMORY: Semantics
Apply the memory-ordering constraints to
[crate::storage_class::Workgroup] Storage Class memory.
Sourcepub const CROSS_WORKGROUP_MEMORY: Semantics
pub const CROSS_WORKGROUP_MEMORY: Semantics
Apply the memory-ordering constraints to
[crate::storage_class::CrossWorkgroup] Storage Class memory.
Sourcepub const ATOMIC_COUNTER_MEMORY: Semantics
pub const ATOMIC_COUNTER_MEMORY: Semantics
Apply the memory-ordering constraints to
[crate::storage_class::AtomicCounter] Storage Class memory.
Sourcepub const IMAGE_MEMORY: Semantics
pub const IMAGE_MEMORY: Semantics
Apply the memory-ordering constraints to image contents (types declared
by OpTypeImage), or to accesses done through pointers to the
[crate::storage_class::Image] Storage Class.
Sourcepub const OUTPUT_MEMORY: Semantics
pub const OUTPUT_MEMORY: Semantics
Apply the memory-ordering constraints to the
[crate::storage_class::Output] Storage Class memory.
Sourcepub const MAKE_AVAILABLE: Semantics
pub const MAKE_AVAILABLE: Semantics
Perform an availability operation on all references in the selected storage classes.
Sourcepub const MAKE_VISIBLE: Semantics
pub const MAKE_VISIBLE: Semantics
Perform a visibility operation on all references in the selected storage classes.
Sourcepub const VOLATILE: Semantics
pub const VOLATILE: Semantics
This access cannot be eliminated, duplicated, or combined with other accesses.
Sourcepub const fn from_bits(bits: u32) -> Option<Semantics>
pub const fn from_bits(bits: u32) -> Option<Semantics>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Sourcepub const fn from_bits_truncate(bits: u32) -> Semantics
pub const fn from_bits_truncate(bits: u32) -> Semantics
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> Semantics
pub const unsafe fn from_bits_unchecked(bits: u32) -> Semantics
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
§Safety
The caller of the bitflags! macro can chose to allow or
disallow extra bits for their bitflags type.
The caller of from_bits_unchecked() has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
Sourcepub const fn intersects(&self, other: Semantics) -> bool
pub const fn intersects(&self, other: Semantics) -> bool
Returns true if there are flags common to both self and other.
Sourcepub const fn contains(&self, other: Semantics) -> bool
pub const fn contains(&self, other: Semantics) -> bool
Returns true if all of the flags in other are contained within self.
Sourcepub fn set(&mut self, other: Semantics, value: bool)
pub fn set(&mut self, other: Semantics, value: bool)
Inserts or removes the specified flags depending on the passed value.
Sourcepub const fn intersection(self, other: Semantics) -> Semantics
pub const fn intersection(self, other: Semantics) -> Semantics
Returns the intersection between the flags in self and
other.
Specifically, the returned set contains only the flags which are
present in both self and other.
This is equivalent to using the & operator (e.g.
ops::BitAnd), as in flags & other.
Sourcepub const fn union(self, other: Semantics) -> Semantics
pub const fn union(self, other: Semantics) -> Semantics
Returns the union of between the flags in self and other.
Specifically, the returned set contains all flags which are
present in either self or other, including any which are
present in both (see Self::symmetric_difference if that
is undesirable).
This is equivalent to using the | operator (e.g.
ops::BitOr), as in flags | other.
Sourcepub const fn difference(self, other: Semantics) -> Semantics
pub const fn difference(self, other: Semantics) -> Semantics
Returns the difference between the flags in self and other.
Specifically, the returned set contains all flags present in
self, except for the ones present in other.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other (and this syntax is also supported).
This is equivalent to using the - operator (e.g.
ops::Sub), as in flags - other.
Sourcepub const fn symmetric_difference(self, other: Semantics) -> Semantics
pub const fn symmetric_difference(self, other: Semantics) -> Semantics
Returns the symmetric difference between the flags
in self and other.
Specifically, the returned set contains the flags present which
are present in self or other, but that are not present in
both. Equivalently, it contains the flags present in exactly
one of the sets self and other.
This is equivalent to using the ^ operator (e.g.
ops::BitXor), as in flags ^ other.
Sourcepub const fn complement(self) -> Semantics
pub const fn complement(self) -> Semantics
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all() and self (e.g. Self::all() - self)
This is equivalent to using the ! operator (e.g.
ops::Not), as in !flags.
Trait Implementations§
Source§impl BitAndAssign for Semantics
impl BitAndAssign for Semantics
Source§fn bitand_assign(&mut self, other: Semantics)
fn bitand_assign(&mut self, other: Semantics)
Disables all flags disabled in the set.
Source§impl BitOrAssign for Semantics
impl BitOrAssign for Semantics
Source§fn bitor_assign(&mut self, other: Semantics)
fn bitor_assign(&mut self, other: Semantics)
Adds the set of flags.
Source§impl BitXorAssign for Semantics
impl BitXorAssign for Semantics
Source§fn bitxor_assign(&mut self, other: Semantics)
fn bitxor_assign(&mut self, other: Semantics)
Toggles the set of flags.
Source§impl Extend<Semantics> for Semantics
impl Extend<Semantics> for Semantics
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = Semantics>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = Semantics>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl FromIterator<Semantics> for Semantics
impl FromIterator<Semantics> for Semantics
Source§impl Ord for Semantics
impl Ord for Semantics
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Semantics
impl PartialOrd for Semantics
Source§impl SubAssign for Semantics
impl SubAssign for Semantics
Source§fn sub_assign(&mut self, other: Semantics)
fn sub_assign(&mut self, other: Semantics)
Disables all flags enabled in the set.
impl Copy for Semantics
impl Eq for Semantics
impl StructuralPartialEq for Semantics
Auto Trait Implementations§
impl Freeze for Semantics
impl RefUnwindSafe for Semantics
impl Send for Semantics
impl Sync for Semantics
impl Unpin for Semantics
impl UnsafeUnpin for Semantics
impl UnwindSafe for Semantics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.