Struct nannou_wgpu::ShaderStages [−]
#[repr(transparent)]pub struct ShaderStages { /* fields omitted */ }
Expand description
Describes the shader stages that a binding will be visible from.
These can be combined so something that is visible from both vertex and fragment shaders can be defined as:
ShaderStages::VERTEX | ShaderStages::FRAGMENT
Implementations
impl ShaderStages
impl ShaderStages
pub const NONE: ShaderStages
pub const NONE: ShaderStages
Binding is not visible from any shader stage.
pub const VERTEX: ShaderStages
pub const VERTEX: ShaderStages
Binding is visible from the vertex shader of a render pipeline.
pub const FRAGMENT: ShaderStages
pub const FRAGMENT: ShaderStages
Binding is visible from the fragment shader of a render pipeline.
pub const COMPUTE: ShaderStages
pub const COMPUTE: ShaderStages
Binding is visible from the compute shader of a compute pipeline.
pub const VERTEX_FRAGMENT: ShaderStages
pub const VERTEX_FRAGMENT: ShaderStages
Binding is visible from the vertex and fragment shaders of a render pipeline.
pub const fn empty() -> ShaderStages
pub const fn empty() -> ShaderStages
Returns an empty set of flags.
pub const fn all() -> ShaderStages
pub const fn all() -> ShaderStages
Returns the set containing all flags.
pub const fn from_bits(bits: u32) -> Option<ShaderStages>
pub const fn from_bits(bits: u32) -> Option<ShaderStages>
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) -> ShaderStages
pub const fn from_bits_truncate(bits: u32) -> ShaderStages
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub const unsafe fn from_bits_unchecked(bits: u32) -> ShaderStages
pub const unsafe fn from_bits_unchecked(bits: u32) -> ShaderStages
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.
pub const fn intersects(&self, other: ShaderStages) -> bool
pub const fn intersects(&self, other: ShaderStages) -> bool
Returns true
if there are flags common to both self
and other
.
pub const fn contains(&self, other: ShaderStages) -> bool
pub const fn contains(&self, other: ShaderStages) -> bool
Returns true
if all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: ShaderStages)
pub fn insert(&mut self, other: ShaderStages)
Inserts the specified flags in-place.
pub fn remove(&mut self, other: ShaderStages)
pub fn remove(&mut self, other: ShaderStages)
Removes the specified flags in-place.
pub fn toggle(&mut self, other: ShaderStages)
pub fn toggle(&mut self, other: ShaderStages)
Toggles the specified flags in-place.
pub fn set(&mut self, other: ShaderStages, value: bool)
pub fn set(&mut self, other: ShaderStages, value: bool)
Inserts or removes the specified flags depending on the passed value.
pub const fn intersection(self, other: ShaderStages) -> ShaderStages
pub const fn intersection(self, other: ShaderStages) -> ShaderStages
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
.
pub const fn union(self, other: ShaderStages) -> ShaderStages
pub const fn union(self, other: ShaderStages) -> ShaderStages
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
.
pub const fn difference(self, other: ShaderStages) -> ShaderStages
pub const fn difference(self, other: ShaderStages) -> ShaderStages
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
.
pub const fn symmetric_difference(self, other: ShaderStages) -> ShaderStages
pub const fn symmetric_difference(self, other: ShaderStages) -> ShaderStages
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
.
pub const fn complement(self) -> ShaderStages
pub const fn complement(self) -> ShaderStages
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
impl Binary for ShaderStages
impl Binary for ShaderStages
impl BitAnd<ShaderStages> for ShaderStages
impl BitAnd<ShaderStages> for ShaderStages
pub fn bitand(self, other: ShaderStages) -> ShaderStages
pub fn bitand(self, other: ShaderStages) -> ShaderStages
Returns the intersection between the two sets of flags.
type Output = ShaderStages
type Output = ShaderStages
The resulting type after applying the &
operator.
impl BitAndAssign<ShaderStages> for ShaderStages
impl BitAndAssign<ShaderStages> for ShaderStages
pub fn bitand_assign(&mut self, other: ShaderStages)
pub fn bitand_assign(&mut self, other: ShaderStages)
Disables all flags disabled in the set.
impl BitOr<ShaderStages> for ShaderStages
impl BitOr<ShaderStages> for ShaderStages
pub fn bitor(self, other: ShaderStages) -> ShaderStages
pub fn bitor(self, other: ShaderStages) -> ShaderStages
Returns the union of the two sets of flags.
type Output = ShaderStages
type Output = ShaderStages
The resulting type after applying the |
operator.
impl BitOrAssign<ShaderStages> for ShaderStages
impl BitOrAssign<ShaderStages> for ShaderStages
pub fn bitor_assign(&mut self, other: ShaderStages)
pub fn bitor_assign(&mut self, other: ShaderStages)
Adds the set of flags.
impl BitXor<ShaderStages> for ShaderStages
impl BitXor<ShaderStages> for ShaderStages
pub fn bitxor(self, other: ShaderStages) -> ShaderStages
pub fn bitxor(self, other: ShaderStages) -> ShaderStages
Returns the left flags, but with all the right flags toggled.
type Output = ShaderStages
type Output = ShaderStages
The resulting type after applying the ^
operator.
impl BitXorAssign<ShaderStages> for ShaderStages
impl BitXorAssign<ShaderStages> for ShaderStages
pub fn bitxor_assign(&mut self, other: ShaderStages)
pub fn bitxor_assign(&mut self, other: ShaderStages)
Toggles the set of flags.
impl Clone for ShaderStages
impl Clone for ShaderStages
pub fn clone(&self) -> ShaderStages
pub fn clone(&self) -> ShaderStages
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
impl Debug for ShaderStages
impl Debug for ShaderStages
impl<'de> Deserialize<'de> for ShaderStages
impl<'de> Deserialize<'de> for ShaderStages
pub fn deserialize<D>(
deserializer: D
) -> Result<ShaderStages, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
pub fn deserialize<D>(
deserializer: D
) -> Result<ShaderStages, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Extend<ShaderStages> for ShaderStages
impl Extend<ShaderStages> for ShaderStages
pub fn extend<T>(&mut self, iterator: T) where
T: IntoIterator<Item = ShaderStages>,
pub fn extend<T>(&mut self, iterator: T) where
T: IntoIterator<Item = ShaderStages>,
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
impl FromIterator<ShaderStages> for ShaderStages
impl FromIterator<ShaderStages> for ShaderStages
pub fn from_iter<T>(iterator: T) -> ShaderStages where
T: IntoIterator<Item = ShaderStages>,
pub fn from_iter<T>(iterator: T) -> ShaderStages where
T: IntoIterator<Item = ShaderStages>,
Creates a value from an iterator. Read more
impl Hash for ShaderStages
impl Hash for ShaderStages
impl LowerHex for ShaderStages
impl LowerHex for ShaderStages
impl Not for ShaderStages
impl Not for ShaderStages
pub fn not(self) -> ShaderStages
pub fn not(self) -> ShaderStages
Returns the complement of this set of flags.
type Output = ShaderStages
type Output = ShaderStages
The resulting type after applying the !
operator.
impl Octal for ShaderStages
impl Octal for ShaderStages
impl Ord for ShaderStages
impl Ord for ShaderStages
pub fn cmp(&self, other: &ShaderStages) -> Ordering
pub fn cmp(&self, other: &ShaderStages) -> Ordering
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
impl PartialEq<ShaderStages> for ShaderStages
impl PartialEq<ShaderStages> for ShaderStages
pub fn eq(&self, other: &ShaderStages) -> bool
pub fn eq(&self, other: &ShaderStages) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
pub fn ne(&self, other: &ShaderStages) -> bool
pub fn ne(&self, other: &ShaderStages) -> bool
This method tests for !=
.
impl PartialOrd<ShaderStages> for ShaderStages
impl PartialOrd<ShaderStages> for ShaderStages
pub fn partial_cmp(&self, other: &ShaderStages) -> Option<Ordering>
pub fn partial_cmp(&self, other: &ShaderStages) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
impl Serialize for ShaderStages
impl Serialize for ShaderStages
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Sub<ShaderStages> for ShaderStages
impl Sub<ShaderStages> for ShaderStages
pub fn sub(self, other: ShaderStages) -> ShaderStages
pub fn sub(self, other: ShaderStages) -> ShaderStages
Returns the set difference of the two sets of flags.
type Output = ShaderStages
type Output = ShaderStages
The resulting type after applying the -
operator.
impl SubAssign<ShaderStages> for ShaderStages
impl SubAssign<ShaderStages> for ShaderStages
pub fn sub_assign(&mut self, other: ShaderStages)
pub fn sub_assign(&mut self, other: ShaderStages)
Disables all flags enabled in the set.
impl UpperHex for ShaderStages
impl UpperHex for ShaderStages
impl Copy for ShaderStages
impl Eq for ShaderStages
impl StructuralEq for ShaderStages
impl StructuralPartialEq for ShaderStages
Auto Trait Implementations
impl RefUnwindSafe for ShaderStages
impl Send for ShaderStages
impl Sync for ShaderStages
impl Unpin for ShaderStages
impl UnwindSafe for ShaderStages
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.