pub struct ShaderFlags { /* private fields */ }
Expand description
Flags matching the defines in the PBR shader
Implementations§
Source§impl ShaderFlags
impl ShaderFlags
pub const HAS_NORMALS: ShaderFlags
pub const HAS_TANGENTS: ShaderFlags
pub const HAS_UV: ShaderFlags
pub const HAS_COLORS: ShaderFlags
pub const USE_IBL: ShaderFlags
pub const HAS_BASECOLORMAP: ShaderFlags
pub const HAS_NORMALMAP: ShaderFlags
pub const HAS_EMISSIVEMAP: ShaderFlags
pub const HAS_METALROUGHNESSMAP: ShaderFlags
pub const HAS_OCCLUSIONMAP: ShaderFlags
pub const USE_TEX_LOD: ShaderFlags
Sourcepub const fn empty() -> ShaderFlags
pub const fn empty() -> ShaderFlags
Returns an empty set of flags
Sourcepub const fn all() -> ShaderFlags
pub const fn all() -> ShaderFlags
Returns the set containing all flags.
Sourcepub fn from_bits(bits: u16) -> Option<ShaderFlags>
pub fn from_bits(bits: u16) -> Option<ShaderFlags>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Sourcepub const fn from_bits_truncate(bits: u16) -> ShaderFlags
pub const fn from_bits_truncate(bits: u16) -> ShaderFlags
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: u16) -> ShaderFlags
pub const unsafe fn from_bits_unchecked(bits: u16) -> ShaderFlags
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Sourcepub const fn intersects(&self, other: ShaderFlags) -> bool
pub const fn intersects(&self, other: ShaderFlags) -> bool
Returns true
if there are flags common to both self
and other
.
Sourcepub const fn contains(&self, other: ShaderFlags) -> bool
pub const fn contains(&self, other: ShaderFlags) -> bool
Returns true
all of the flags in other
are contained within self
.
Sourcepub fn insert(&mut self, other: ShaderFlags)
pub fn insert(&mut self, other: ShaderFlags)
Inserts the specified flags in-place.
Sourcepub fn remove(&mut self, other: ShaderFlags)
pub fn remove(&mut self, other: ShaderFlags)
Removes the specified flags in-place.
Sourcepub fn toggle(&mut self, other: ShaderFlags)
pub fn toggle(&mut self, other: ShaderFlags)
Toggles the specified flags in-place.
Sourcepub fn set(&mut self, other: ShaderFlags, value: bool)
pub fn set(&mut self, other: ShaderFlags, value: bool)
Inserts or removes the specified flags depending on the passed value.
Source§impl ShaderFlags
impl ShaderFlags
pub fn as_strings(self) -> Vec<String>
Trait Implementations§
Source§impl Binary for ShaderFlags
impl Binary for ShaderFlags
Source§impl BitAnd for ShaderFlags
impl BitAnd for ShaderFlags
Source§fn bitand(self, other: ShaderFlags) -> ShaderFlags
fn bitand(self, other: ShaderFlags) -> ShaderFlags
Returns the intersection between the two sets of flags.
Source§type Output = ShaderFlags
type Output = ShaderFlags
&
operator.Source§impl BitAndAssign for ShaderFlags
impl BitAndAssign for ShaderFlags
Source§fn bitand_assign(&mut self, other: ShaderFlags)
fn bitand_assign(&mut self, other: ShaderFlags)
Disables all flags disabled in the set.
Source§impl BitOr for ShaderFlags
impl BitOr for ShaderFlags
Source§fn bitor(self, other: ShaderFlags) -> ShaderFlags
fn bitor(self, other: ShaderFlags) -> ShaderFlags
Returns the union of the two sets of flags.
Source§type Output = ShaderFlags
type Output = ShaderFlags
|
operator.Source§impl BitOrAssign for ShaderFlags
impl BitOrAssign for ShaderFlags
Source§fn bitor_assign(&mut self, other: ShaderFlags)
fn bitor_assign(&mut self, other: ShaderFlags)
Adds the set of flags.
Source§impl BitXor for ShaderFlags
impl BitXor for ShaderFlags
Source§fn bitxor(self, other: ShaderFlags) -> ShaderFlags
fn bitxor(self, other: ShaderFlags) -> ShaderFlags
Returns the left flags, but with all the right flags toggled.
Source§type Output = ShaderFlags
type Output = ShaderFlags
^
operator.Source§impl BitXorAssign for ShaderFlags
impl BitXorAssign for ShaderFlags
Source§fn bitxor_assign(&mut self, other: ShaderFlags)
fn bitxor_assign(&mut self, other: ShaderFlags)
Toggles the set of flags.
Source§impl Clone for ShaderFlags
impl Clone for ShaderFlags
Source§fn clone(&self) -> ShaderFlags
fn clone(&self) -> ShaderFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ShaderFlags
impl Debug for ShaderFlags
Source§impl Extend<ShaderFlags> for ShaderFlags
impl Extend<ShaderFlags> for ShaderFlags
Source§fn extend<T: IntoIterator<Item = ShaderFlags>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = ShaderFlags>>(&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<ShaderFlags> for ShaderFlags
impl FromIterator<ShaderFlags> for ShaderFlags
Source§fn from_iter<T: IntoIterator<Item = ShaderFlags>>(iterator: T) -> ShaderFlags
fn from_iter<T: IntoIterator<Item = ShaderFlags>>(iterator: T) -> ShaderFlags
Source§impl Hash for ShaderFlags
impl Hash for ShaderFlags
Source§impl LowerHex for ShaderFlags
impl LowerHex for ShaderFlags
Source§impl Not for ShaderFlags
impl Not for ShaderFlags
Source§fn not(self) -> ShaderFlags
fn not(self) -> ShaderFlags
Returns the complement of this set of flags.
Source§type Output = ShaderFlags
type Output = ShaderFlags
!
operator.Source§impl Octal for ShaderFlags
impl Octal for ShaderFlags
Source§impl Ord for ShaderFlags
impl Ord for ShaderFlags
Source§fn cmp(&self, other: &ShaderFlags) -> Ordering
fn cmp(&self, other: &ShaderFlags) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ShaderFlags
impl PartialEq for ShaderFlags
Source§impl PartialOrd for ShaderFlags
impl PartialOrd for ShaderFlags
Source§impl Sub for ShaderFlags
impl Sub for ShaderFlags
Source§fn sub(self, other: ShaderFlags) -> ShaderFlags
fn sub(self, other: ShaderFlags) -> ShaderFlags
Returns the set difference of the two sets of flags.
Source§type Output = ShaderFlags
type Output = ShaderFlags
-
operator.Source§impl SubAssign for ShaderFlags
impl SubAssign for ShaderFlags
Source§fn sub_assign(&mut self, other: ShaderFlags)
fn sub_assign(&mut self, other: ShaderFlags)
Disables all flags enabled in the set.
Source§impl UpperHex for ShaderFlags
impl UpperHex for ShaderFlags
impl Copy for ShaderFlags
impl Eq for ShaderFlags
impl StructuralPartialEq for ShaderFlags
Auto Trait Implementations§
impl Freeze for ShaderFlags
impl RefUnwindSafe for ShaderFlags
impl Send for ShaderFlags
impl Sync for ShaderFlags
impl Unpin for ShaderFlags
impl UnwindSafe for ShaderFlags
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<Trait>
(where Trait: Downcast
) to Box<Any>
. Box<Any>
can then be
further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.