pub struct SamplerDescriptor { /* private fields */ }Expand description
A strongly-typed sampler descriptor for create_sampler.
Replaces the historical GpuSamplerDescriptor, which spelled the
filter and address modes as six independent &'static str fields plus
a compare: bool. The new layout keeps the same information but as
three orthogonal decisions — how to interpolate, how to blend mip
levels, how to wrap — so the combinations the old fields allowed but
the renderer could not express (a Nearest magnification filter with a
Linear minification filter, a comparison other than the hardcoded
one) are now expressible, and an invalid value is a compile error
rather than a silently rejected createSampler call.
Implementations§
Source§impl SamplerDescriptor
Named constructors for the pipeline state structs.
impl SamplerDescriptor
Named constructors for the pipeline state structs.
Sourcepub fn nearest_clamp() -> Self
pub fn nearest_clamp() -> Self
The cheapest sampler: nearest filtering on every axis with clamp-to-edge addressing and no comparison.
§Returns
Self- The assembled sampler descriptor.