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: Self
pub const ACQUIRE: Self
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: Self
pub const RELEASE: Self
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: Self
pub const ACQUIRE_RELEASE: Self
Has the properties of both Self::ACQUIRE
and Self::RELEASE
semantics. It
is used for read-modify-write operations.
Sourcepub const SEQUENTIALLY_CONST: Self
pub const SEQUENTIALLY_CONST: Self
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: Self
pub const UNIFORM_MEMORY: Self
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: Self
pub const SUBGROUP_MEMORY: Self
Apply the memory-ordering constraints to subgroup memory.
Sourcepub const WORKGROUP_MEMORY: Self
pub const WORKGROUP_MEMORY: Self
Apply the memory-ordering constraints to
[crate::storage_class::Workgroup
] Storage Class memory.
Sourcepub const CROSS_WORKGROUP_MEMORY: Self
pub const CROSS_WORKGROUP_MEMORY: Self
Apply the memory-ordering constraints to
[crate::storage_class::CrossWorkgroup
] Storage Class memory.
Sourcepub const ATOMIC_COUNTER_MEMORY: Self
pub const ATOMIC_COUNTER_MEMORY: Self
Apply the memory-ordering constraints to
[crate::storage_class::AtomicCounter
] Storage Class memory.
Sourcepub const IMAGE_MEMORY: Self
pub const IMAGE_MEMORY: Self
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: Self
pub const OUTPUT_MEMORY: Self
Apply the memory-ordering constraints to the
[crate::storage_class::Output
] Storage Class memory.
Sourcepub const MAKE_AVAILABLE: Self
pub const MAKE_AVAILABLE: Self
Perform an availability operation on all references in the selected storage classes.
Sourcepub const MAKE_VISIBLE: Self
pub const MAKE_VISIBLE: Self
Perform a visibility operation on all references in the selected storage classes.
Sourcepub const VOLATILE: Self
pub const VOLATILE: Self
This access cannot be eliminated, duplicated, or combined with other accesses.
Sourcepub const fn from_bits(bits: u32) -> Option<Self>
pub const fn from_bits(bits: u32) -> Option<Self>
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) -> Self
pub const fn from_bits_truncate(bits: u32) -> Self
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> Self
pub const unsafe fn from_bits_unchecked(bits: u32) -> Self
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: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Returns true
if there are flags common to both self
and other
.
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Returns true
if all of the flags in other
are contained within self
.
Sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Inserts or removes the specified flags depending on the passed value.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
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: Self) -> Self
pub const fn union(self, other: Self) -> Self
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: Self) -> Self
pub const fn difference(self, other: Self) -> Self
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: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
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) -> Self
pub const fn complement(self) -> Self
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: Self)
fn bitand_assign(&mut self, other: Self)
Disables all flags disabled in the set.
Source§impl BitOrAssign for Semantics
impl BitOrAssign for Semantics
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Adds the set of flags.
Source§impl BitXorAssign for Semantics
impl BitXorAssign for Semantics
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Toggles the set of flags.
Source§impl Extend<Semantics> for Semantics
impl Extend<Semantics> for Semantics
Source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
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§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
Source§impl Ord for Semantics
impl Ord for Semantics
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: Self)
fn sub_assign(&mut self, other: Self)
Disables all flags enabled in the set.