#[repr(C)]pub struct ShaderStages {
pub features_webgpu: ShaderStagesWebGPU,
pub features_wgpu: ShaderStagesWGPU,
}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
Corresponds to WebGPU GPUShaderStageFlags.
Fields§
§features_webgpu: ShaderStagesWebGPU§features_wgpu: ShaderStagesWGPUImplementations§
Source§impl ShaderStages
impl ShaderStages
Sourcepub const NONE: ShaderStages
pub const NONE: ShaderStages
Binding is not visible from any shader stage.
Sourcepub const VERTEX: ShaderStages
pub const VERTEX: ShaderStages
Binding is visible from the vertex shader of a render pipeline.
Sourcepub const FRAGMENT: ShaderStages
pub const FRAGMENT: ShaderStages
Binding is visible from the fragment shader of a render pipeline.
Sourcepub const COMPUTE: ShaderStages
pub const COMPUTE: ShaderStages
Binding is visible from the compute shader of a compute pipeline.
Sourcepub const VERTEX_FRAGMENT: ShaderStages
pub const VERTEX_FRAGMENT: ShaderStages
Binding is visible from the vertex and fragment shaders of a render pipeline.
Sourcepub const TASK: ShaderStages
pub const TASK: ShaderStages
Binding is visible from the task shader of a mesh pipeline.
Sourcepub const MESH: ShaderStages
pub const MESH: ShaderStages
Binding is visible from the mesh shader of a mesh pipeline.
Sourcepub const RAY_GENERATION: ShaderStages
pub const RAY_GENERATION: ShaderStages
Binding is visible from the ray generation shader of a ray tracing pipeline.
Sourcepub const ANY_HIT: ShaderStages
pub const ANY_HIT: ShaderStages
Binding is visible from the ray any hit shader of a ray tracing pipeline.
Sourcepub const CLOSEST_HIT: ShaderStages
pub const CLOSEST_HIT: ShaderStages
Binding is visible from the ray closest hit shader of a ray tracing pipeline.
Sourcepub const MISS: ShaderStages
pub const MISS: ShaderStages
Binding is visible from the ray miss shader of a ray tracing pipeline.
Sourcepub const fn bits(&self) -> ShaderStagesBits
pub const fn bits(&self) -> ShaderStagesBits
Gets the set flags as a container holding an array of bits.
Sourcepub const fn empty() -> ShaderStages
pub const fn empty() -> ShaderStages
Returns self with no flags set.
Sourcepub const fn all() -> ShaderStages
pub const fn all() -> ShaderStages
Returns self with all flags set.
Sourcepub const fn contains(self, other: ShaderStages) -> bool
pub const fn contains(self, other: ShaderStages) -> bool
Whether all the bits set in other are all set in self
Sourcepub const fn intersects(self, other: ShaderStages) -> bool
pub const fn intersects(self, other: ShaderStages) -> bool
Returns whether any bit set in self matched any bit set in other.
Sourcepub const fn union(self, other: ShaderStages) -> ShaderStages
pub const fn union(self, other: ShaderStages) -> ShaderStages
Bitwise or - self | other
Sourcepub const fn intersection(self, other: ShaderStages) -> ShaderStages
pub const fn intersection(self, other: ShaderStages) -> ShaderStages
Bitwise and - self & other
Sourcepub const fn difference(self, other: ShaderStages) -> ShaderStages
pub const fn difference(self, other: ShaderStages) -> ShaderStages
Bitwise and of the complement of other - self & !other
Sourcepub const fn symmetric_difference(self, other: ShaderStages) -> ShaderStages
pub const fn symmetric_difference(self, other: ShaderStages) -> ShaderStages
Bitwise xor - self ^ other
Sourcepub const fn complement(self) -> ShaderStages
pub const fn complement(self) -> ShaderStages
Bitwise not - !self
Sourcepub fn set(&mut self, other: ShaderStages, set: bool)
pub fn set(&mut self, other: ShaderStages, set: bool)
Calls Self::insert if set is true and otherwise calls Self::remove.
Sourcepub fn insert(&mut self, other: ShaderStages)
pub fn insert(&mut self, other: ShaderStages)
Inserts specified flag(s) into self
Sourcepub fn remove(&mut self, other: ShaderStages)
pub fn remove(&mut self, other: ShaderStages)
Removes specified flag(s) from self
Sourcepub fn toggle(&mut self, other: ShaderStages)
pub fn toggle(&mut self, other: ShaderStages)
Toggles specified flag(s) in self
Sourcepub const fn from_bits(bits: ShaderStagesBits) -> Option<ShaderStages>
pub const fn from_bits(bits: ShaderStagesBits) -> Option<ShaderStages>
Takes in ShaderStagesBits and returns
None if there are invalid bits or otherwise Self with those bits set
Sourcepub const fn from_bits_truncate(bits: ShaderStagesBits) -> ShaderStages
pub const fn from_bits_truncate(bits: ShaderStagesBits) -> ShaderStages
Takes in ShaderStagesBits and returns Self with only valid bits (all other bits removed)
Sourcepub const fn from_bits_retain(bits: ShaderStagesBits) -> ShaderStages
pub const fn from_bits_retain(bits: ShaderStagesBits) -> ShaderStages
Takes in ShaderStagesBits and returns Self with all bits that were set without removing invalid bits
Sourcepub fn from_name(name: &str) -> Option<ShaderStages>
pub fn from_name(name: &str) -> Option<ShaderStages>
Takes in a bitflags flag name (in SCREAMING_SNAKE_CASE) and returns Self
if it matches or none if the name does not match the name of any of the
flags. Name is capitalisation dependent.
[impl FromStr] can be used to recognize kebab-case names, like are used in
the WebGPU spec.
Sourcepub fn from_internal_flags(
features_webgpu: ShaderStagesWebGPU,
features_wgpu: ShaderStagesWGPU,
) -> ShaderStages
pub fn from_internal_flags( features_webgpu: ShaderStagesWebGPU, features_wgpu: ShaderStagesWGPU, ) -> ShaderStages
Combines the flags from the internal flags into the entire flags struct
Sourcepub const fn iter(&self) -> Iter<ShaderStages>
pub const fn iter(&self) -> Iter<ShaderStages>
Returns an iterator over the set flags.
Sourcepub const fn iter_names(&self) -> IterNames<ShaderStages>
pub const fn iter_names(&self) -> IterNames<ShaderStages>
Returns an iterator over the set flags and their names.
These are bitflags names in SCREAMING_SNAKE_CASE.
Trait Implementations§
Source§impl BitAnd for ShaderStages
impl BitAnd for ShaderStages
Source§type Output = ShaderStages
type Output = ShaderStages
& operator.Source§fn bitand(self, other: ShaderStages) -> ShaderStages
fn bitand(self, other: ShaderStages) -> ShaderStages
& operation. Read moreSource§impl BitAndAssign for ShaderStages
impl BitAndAssign for ShaderStages
Source§fn bitand_assign(&mut self, other: ShaderStages)
fn bitand_assign(&mut self, other: ShaderStages)
&= operation. Read moreSource§impl BitOr for ShaderStages
impl BitOr for ShaderStages
Source§type Output = ShaderStages
type Output = ShaderStages
| operator.Source§fn bitor(self, other: ShaderStages) -> ShaderStages
fn bitor(self, other: ShaderStages) -> ShaderStages
| operation. Read moreSource§impl BitOrAssign for ShaderStages
impl BitOrAssign for ShaderStages
Source§fn bitor_assign(&mut self, other: ShaderStages)
fn bitor_assign(&mut self, other: ShaderStages)
|= operation. Read moreSource§impl BitXor for ShaderStages
impl BitXor for ShaderStages
Source§type Output = ShaderStages
type Output = ShaderStages
^ operator.Source§fn bitxor(self, other: ShaderStages) -> ShaderStages
fn bitxor(self, other: ShaderStages) -> ShaderStages
^ operation. Read moreSource§impl BitXorAssign for ShaderStages
impl BitXorAssign for ShaderStages
Source§fn bitxor_assign(&mut self, other: ShaderStages)
fn bitxor_assign(&mut self, other: ShaderStages)
^= operation. Read moreSource§impl Clone for ShaderStages
impl Clone for ShaderStages
Source§fn clone(&self) -> ShaderStages
fn clone(&self) -> ShaderStages
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ShaderStages
impl Debug for ShaderStages
Source§impl<'de> Deserialize<'de> for ShaderStages
Available on crate feature serde only.
impl<'de> Deserialize<'de> for ShaderStages
serde only.Source§fn deserialize<D>(
deserializer: D,
) -> Result<ShaderStages, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ShaderStages, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Display for ShaderStages
impl Display for ShaderStages
Source§impl Flags for ShaderStages
impl Flags for ShaderStages
Source§const FLAGS: &'static [Flag<ShaderStages>] = ShaderStages::FLAGS
const FLAGS: &'static [Flag<ShaderStages>] = ShaderStages::FLAGS
Source§type Bits = ShaderStagesBits
type Bits = ShaderStagesBits
Source§fn bits(&self) -> ShaderStagesBits
fn bits(&self) -> ShaderStagesBits
Source§fn from_bits_retain(bits: ShaderStagesBits) -> ShaderStages
fn from_bits_retain(bits: ShaderStagesBits) -> ShaderStages
Source§fn empty() -> ShaderStages
fn empty() -> ShaderStages
Source§fn all() -> ShaderStages
fn all() -> ShaderStages
§fn known_bits(&self) -> Self::Bits
fn known_bits(&self) -> Self::Bits
§fn unknown_bits(&self) -> Self::Bits
fn unknown_bits(&self) -> Self::Bits
§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true if any unknown bits are set.§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
§fn iter_defined_names() -> IterDefinedNames<Self>
fn iter_defined_names() -> IterDefinedNames<Self>
Self::FLAGS].§fn iter_equal_names(&self) -> IterEqualNames<Self>
fn iter_equal_names(&self) -> IterEqualNames<Self>
§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|) of the bits in self and other.§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^) of the bits in self and other.§fn set(&mut self, other: Self, value: bool)where
Self: Sized,
fn set(&mut self, other: Self, value: bool)where
Self: Sized,
Flags::insert] when value is true or [Flags::remove] when value is false.§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&) of the bits in self and other.§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in self and other.§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in self, truncating the result.Source§impl From<ShaderStagesWGPU> for ShaderStages
impl From<ShaderStagesWGPU> for ShaderStages
Source§fn from(features_wgpu: ShaderStagesWGPU) -> ShaderStages
fn from(features_wgpu: ShaderStagesWGPU) -> ShaderStages
Source§impl From<ShaderStagesWebGPU> for ShaderStages
impl From<ShaderStagesWebGPU> for ShaderStages
Source§fn from(features_webgpu: ShaderStagesWebGPU) -> ShaderStages
fn from(features_webgpu: ShaderStagesWebGPU) -> ShaderStages
Source§impl Hash for ShaderStages
impl Hash for ShaderStages
Source§impl Not for ShaderStages
impl Not for ShaderStages
Source§type Output = ShaderStages
type Output = ShaderStages
! operator.Source§fn not(self) -> ShaderStages
fn not(self) -> ShaderStages
! operation. Read moreSource§impl PartialEq for ShaderStages
impl PartialEq for ShaderStages
Source§impl Serialize for ShaderStages
Available on crate feature serde only.
impl Serialize for ShaderStages
serde only.Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Source§impl Sub for ShaderStages
impl Sub for ShaderStages
Source§type Output = ShaderStages
type Output = ShaderStages
- operator.Source§fn sub(self, other: ShaderStages) -> ShaderStages
fn sub(self, other: ShaderStages) -> ShaderStages
- operation. Read moreimpl Copy for ShaderStages
impl Eq for ShaderStages
impl StructuralPartialEq for ShaderStages
Auto Trait Implementations§
impl Freeze for ShaderStages
impl RefUnwindSafe for ShaderStages
impl Send for ShaderStages
impl Sync for ShaderStages
impl Unpin for ShaderStages
impl UnsafeUnpin for ShaderStages
impl UnwindSafe for ShaderStages
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more