pub enum FilterMode {
Nearest,
Linear,
}Expand description
How texels are interpolated when a sample is fetched.
Used for both the magnification filter (magFilter) and the
minification filter (minFilter) of a sampler. The two filters are
separate WebGPU fields because a magnified surface and a minified
surface of the same texture want different behaviour — pixel art wants
Nearest when magnified and Linear when minified — so a single
SamplerDescriptor::filter covers both by letting the caller pick
the same mode or override it per stage.
Variants§
Nearest
Sample the nearest texel. Keeps hard edges and is the correct choice for pixel art and for integer data.
Linear
Blend the neighbouring texels. Smooths magnification and minification alike.
Trait Implementations§
Source§impl Clone for FilterMode
impl Clone for FilterMode
impl Copy for FilterMode
Source§impl Debug for FilterMode
impl Debug for FilterMode
Source§impl Default for FilterMode
impl Default for FilterMode
impl Eq for FilterMode
Source§impl Hash for FilterMode
impl Hash for FilterMode
Source§impl PartialEq for FilterMode
impl PartialEq for FilterMode
impl StructuralPartialEq for FilterMode
Auto Trait Implementations§
impl Freeze for FilterMode
impl RefUnwindSafe for FilterMode
impl Send for FilterMode
impl Sync for FilterMode
impl Unpin for FilterMode
impl UnsafeUnpin for FilterMode
impl UnwindSafe for FilterMode
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