pub struct SamplerKey {
pub address_mode_u: AddressMode,
pub address_mode_v: AddressMode,
pub address_mode_w: AddressMode,
pub mag_filter: FilterMode,
pub min_filter: FilterMode,
pub mipmap_filter: FilterMode,
pub lod_min_clamp: u32,
pub lod_max_clamp: u32,
pub compare: Option<CompareFunction>,
pub anisotropy_clamp: u16,
pub border_color: Option<SamplerBorderColor>,
}Expand description
A hashable key for sampler descriptors.
wgpu::SamplerDescriptor doesn’t implement Hash, so we need this wrapper.
Fields§
§address_mode_u: AddressModeAddress mode for U coordinate
address_mode_v: AddressModeAddress mode for V coordinate
address_mode_w: AddressModeAddress mode for W coordinate
mag_filter: FilterModeMagnification filter
min_filter: FilterModeMinification filter
mipmap_filter: FilterModeMipmap filter
lod_min_clamp: u32Minimum LOD clamp
lod_max_clamp: u32Maximum LOD clamp
compare: Option<CompareFunction>Comparison function (if any)
anisotropy_clamp: u16Anisotropy clamp (1-16)
border_color: Option<SamplerBorderColor>Border color (for ClampToBorder address mode)
Implementations§
Source§impl SamplerKey
impl SamplerKey
Sourcepub fn nearest_repeat() -> Self
pub fn nearest_repeat() -> Self
Create a key for a repeating nearest (point) sampler.
Sourcepub fn linear_mirror() -> Self
pub fn linear_mirror() -> Self
Create a key for a mirrored linear sampler.
Sourcepub fn nearest_mirror() -> Self
pub fn nearest_mirror() -> Self
Create a key for a mirrored nearest (point) sampler.
Sourcepub fn from_descriptor(desc: &SamplerDescriptor<'_>) -> Self
pub fn from_descriptor(desc: &SamplerDescriptor<'_>) -> Self
Create a key from a sampler descriptor.
Sourcepub fn to_descriptor<'a>(&self, label: Option<&'a str>) -> SamplerDescriptor<'a>
pub fn to_descriptor<'a>(&self, label: Option<&'a str>) -> SamplerDescriptor<'a>
Create a descriptor from this key.
Sourcepub fn linear_repeat() -> Self
pub fn linear_repeat() -> Self
Create a key for a repeating linear sampler.
Trait Implementations§
Source§impl Clone for SamplerKey
impl Clone for SamplerKey
Source§fn clone(&self) -> SamplerKey
fn clone(&self) -> SamplerKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SamplerKey
impl Debug for SamplerKey
Source§impl Hash for SamplerKey
impl Hash for SamplerKey
Source§impl PartialEq for SamplerKey
impl PartialEq for SamplerKey
impl Eq for SamplerKey
impl StructuralPartialEq for SamplerKey
Auto Trait Implementations§
impl Freeze for SamplerKey
impl RefUnwindSafe for SamplerKey
impl Send for SamplerKey
impl Sync for SamplerKey
impl Unpin for SamplerKey
impl UnsafeUnpin for SamplerKey
impl UnwindSafe for SamplerKey
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
Mutably borrows from an owned value. Read more
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>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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