Struct nannou_wgpu::SamplerBuilder
source · pub struct SamplerBuilder {
pub descriptor: SamplerDescriptor<'static>,
}
Expand description
Simplifies the construction of a Sampler
with a set of reasonable defaults.
Fields§
§descriptor: SamplerDescriptor<'static>
Implementations§
source§impl<'b> SamplerBuilder
impl<'b> SamplerBuilder
pub const DEFAULT_ADDRESS_MODE_U: AddressMode = wgpu::AddressMode::ClampToEdge
pub const DEFAULT_ADDRESS_MODE_V: AddressMode = wgpu::AddressMode::ClampToEdge
pub const DEFAULT_ADDRESS_MODE_W: AddressMode = wgpu::AddressMode::ClampToEdge
pub const DEFAULT_MAG_FILTER: FilterMode = wgpu::FilterMode::Linear
pub const DEFAULT_MIN_FILTER: FilterMode = wgpu::FilterMode::Linear
pub const DEFAULT_MIPMAP_FILTER: FilterMode = wgpu::FilterMode::Nearest
pub const DEFAULT_LOD_MIN_CLAMP: f32 = 0f32
pub const DEFAULT_LOD_MAX_CLAMP: f32 = 100f32
pub const DEFAULT_COMPARE: Option<CompareFunction> = None
pub const DEFAULT_ANISOTROPY_CLAMP: u16 = 1u16
pub const DEFAULT_LABEL: &'static str = "nannou-sampler"
pub const DEFAULT_BORDER_COLOR: Option<SamplerBorderColor> = None
pub const DEFAULT_DESCRIPTOR: SamplerDescriptor<'static> = _
sourcepub fn address_mode_u(self, mode: AddressMode) -> Self
pub fn address_mode_u(self, mode: AddressMode) -> Self
How the implementation should behave when sampling outside of the texture coordinates range [0.0, 1.0].
sourcepub fn address_mode_v(self, mode: AddressMode) -> Self
pub fn address_mode_v(self, mode: AddressMode) -> Self
How the implementation should behave when sampling outside of the texture coordinates range [0.0, 1.0].
sourcepub fn address_mode_w(self, mode: AddressMode) -> Self
pub fn address_mode_w(self, mode: AddressMode) -> Self
How the implementation should behave when sampling outside of the texture coordinates range [0.0, 1.0].
sourcepub fn address_mode(self, mode: AddressMode) -> Self
pub fn address_mode(self, mode: AddressMode) -> Self
How the implementation should behave when sampling outside of the texture coordinates range [0.0, 1.0].
Applies the same address mode to all axes.
sourcepub fn mag_filter(self, filter: FilterMode) -> Self
pub fn mag_filter(self, filter: FilterMode) -> Self
How the implementation should sample from the image when it is respectively larger than the original.
sourcepub fn min_filter(self, filter: FilterMode) -> Self
pub fn min_filter(self, filter: FilterMode) -> Self
How the implementation should sample from the image when it is respectively smaller than the original.
sourcepub fn mipmap_filter(self, filter: FilterMode) -> Self
pub fn mipmap_filter(self, filter: FilterMode) -> Self
How the implementation should choose which mipmap to use.
sourcepub fn lod_min_clamp(self, min: f32) -> Self
pub fn lod_min_clamp(self, min: f32) -> Self
The minimum mipmap level to use.
sourcepub fn lod_max_clamp(self, max: f32) -> Self
pub fn lod_max_clamp(self, max: f32) -> Self
The maximum mipmap level to use.
sourcepub fn compare(self, f: Option<CompareFunction>) -> Self
pub fn compare(self, f: Option<CompareFunction>) -> Self
The comparison function to use, if any.
sourcepub fn anisotropy_clamp(self, clamp: u16) -> Self
pub fn anisotropy_clamp(self, clamp: u16) -> Self
The anisotropy level to clamp to, if any.
sourcepub fn build(&self, device: &Device) -> Sampler
pub fn build(&self, device: &Device) -> Sampler
Calls device.create_sampler(&self.descriptor)
internally.
sourcepub fn into_descriptor(self) -> SamplerDescriptor<'static>
pub fn into_descriptor(self) -> SamplerDescriptor<'static>
Consume the builder and produce the inner SamplerDescriptor
.