pub struct TextureUsage { /* private fields */ }
Expand description
Different ways that you can use a texture.
The usages determine what kind of memory the texture is allocated from and what actions the texture can partake in.
Implementations§
Source§impl TextureUsage
impl TextureUsage
Sourcepub const COPY_SRC: TextureUsage
pub const COPY_SRC: TextureUsage
Allows a texture to be the source in a [CommandEncoder::copy_texture_to_buffer
] or
[CommandEncoder::copy_texture_to_texture
] operation.
Sourcepub const COPY_DST: TextureUsage
pub const COPY_DST: TextureUsage
Allows a texture to be the destination in a [CommandEncoder::copy_texture_to_buffer
],
[CommandEncoder::copy_texture_to_texture
], or [Queue::write_texture
] operation.
Sourcepub const SAMPLED: TextureUsage
pub const SAMPLED: TextureUsage
Allows a texture to be a BindingType::SampledTexture
in a bind group.
Sourcepub const STORAGE: TextureUsage
pub const STORAGE: TextureUsage
Allows a texture to be a BindingType::StorageTexture
in a bind group.
Sourcepub const OUTPUT_ATTACHMENT: TextureUsage
pub const OUTPUT_ATTACHMENT: TextureUsage
Allows a texture to be a output attachment of a renderpass.
Sourcepub const fn empty() -> TextureUsage
pub const fn empty() -> TextureUsage
Returns an empty set of flags
Sourcepub const fn all() -> TextureUsage
pub const fn all() -> TextureUsage
Returns the set containing all flags.
Sourcepub fn from_bits(bits: u32) -> Option<TextureUsage>
pub fn from_bits(bits: u32) -> Option<TextureUsage>
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) -> TextureUsage
pub const fn from_bits_truncate(bits: u32) -> TextureUsage
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> TextureUsage
pub const unsafe fn from_bits_unchecked(bits: u32) -> TextureUsage
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Sourcepub const fn intersects(&self, other: TextureUsage) -> bool
pub const fn intersects(&self, other: TextureUsage) -> bool
Returns true
if there are flags common to both self
and other
.
Sourcepub const fn contains(&self, other: TextureUsage) -> bool
pub const fn contains(&self, other: TextureUsage) -> bool
Returns true
all of the flags in other
are contained within self
.
Sourcepub fn insert(&mut self, other: TextureUsage)
pub fn insert(&mut self, other: TextureUsage)
Inserts the specified flags in-place.
Sourcepub fn remove(&mut self, other: TextureUsage)
pub fn remove(&mut self, other: TextureUsage)
Removes the specified flags in-place.
Sourcepub fn toggle(&mut self, other: TextureUsage)
pub fn toggle(&mut self, other: TextureUsage)
Toggles the specified flags in-place.
Sourcepub fn set(&mut self, other: TextureUsage, value: bool)
pub fn set(&mut self, other: TextureUsage, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations§
Source§impl Binary for TextureUsage
impl Binary for TextureUsage
Source§impl BitAnd for TextureUsage
impl BitAnd for TextureUsage
Source§fn bitand(self, other: TextureUsage) -> TextureUsage
fn bitand(self, other: TextureUsage) -> TextureUsage
Returns the intersection between the two sets of flags.
Source§type Output = TextureUsage
type Output = TextureUsage
&
operator.Source§impl BitAndAssign for TextureUsage
impl BitAndAssign for TextureUsage
Source§fn bitand_assign(&mut self, other: TextureUsage)
fn bitand_assign(&mut self, other: TextureUsage)
Disables all flags disabled in the set.
Source§impl BitOr for TextureUsage
impl BitOr for TextureUsage
Source§fn bitor(self, other: TextureUsage) -> TextureUsage
fn bitor(self, other: TextureUsage) -> TextureUsage
Returns the union of the two sets of flags.
Source§type Output = TextureUsage
type Output = TextureUsage
|
operator.Source§impl BitOrAssign for TextureUsage
impl BitOrAssign for TextureUsage
Source§fn bitor_assign(&mut self, other: TextureUsage)
fn bitor_assign(&mut self, other: TextureUsage)
Adds the set of flags.
Source§impl BitXor for TextureUsage
impl BitXor for TextureUsage
Source§fn bitxor(self, other: TextureUsage) -> TextureUsage
fn bitxor(self, other: TextureUsage) -> TextureUsage
Returns the left flags, but with all the right flags toggled.
Source§type Output = TextureUsage
type Output = TextureUsage
^
operator.Source§impl BitXorAssign for TextureUsage
impl BitXorAssign for TextureUsage
Source§fn bitxor_assign(&mut self, other: TextureUsage)
fn bitxor_assign(&mut self, other: TextureUsage)
Toggles the set of flags.
Source§impl Clone for TextureUsage
impl Clone for TextureUsage
Source§fn clone(&self) -> TextureUsage
fn clone(&self) -> TextureUsage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TextureUsage
impl Debug for TextureUsage
Source§impl<'de> Deserialize<'de> for TextureUsage
impl<'de> Deserialize<'de> for TextureUsage
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TextureUsage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TextureUsage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Extend<TextureUsage> for TextureUsage
impl Extend<TextureUsage> for TextureUsage
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = TextureUsage>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = TextureUsage>,
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<TextureUsage> for TextureUsage
impl FromIterator<TextureUsage> for TextureUsage
Source§fn from_iter<T>(iterator: T) -> TextureUsagewhere
T: IntoIterator<Item = TextureUsage>,
fn from_iter<T>(iterator: T) -> TextureUsagewhere
T: IntoIterator<Item = TextureUsage>,
Source§impl Hash for TextureUsage
impl Hash for TextureUsage
Source§impl LowerHex for TextureUsage
impl LowerHex for TextureUsage
Source§impl Not for TextureUsage
impl Not for TextureUsage
Source§fn not(self) -> TextureUsage
fn not(self) -> TextureUsage
Returns the complement of this set of flags.
Source§type Output = TextureUsage
type Output = TextureUsage
!
operator.Source§impl Octal for TextureUsage
impl Octal for TextureUsage
Source§impl Ord for TextureUsage
impl Ord for TextureUsage
Source§fn cmp(&self, other: &TextureUsage) -> Ordering
fn cmp(&self, other: &TextureUsage) -> 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 TextureUsage
impl PartialEq for TextureUsage
Source§impl PartialOrd for TextureUsage
impl PartialOrd for TextureUsage
Source§impl Serialize for TextureUsage
impl Serialize for TextureUsage
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 TextureUsage
impl Sub for TextureUsage
Source§fn sub(self, other: TextureUsage) -> TextureUsage
fn sub(self, other: TextureUsage) -> TextureUsage
Returns the set difference of the two sets of flags.
Source§type Output = TextureUsage
type Output = TextureUsage
-
operator.Source§impl SubAssign for TextureUsage
impl SubAssign for TextureUsage
Source§fn sub_assign(&mut self, other: TextureUsage)
fn sub_assign(&mut self, other: TextureUsage)
Disables all flags enabled in the set.