[][src]Struct bedrock::resources::SamplerBuilder

pub struct SamplerBuilder(_);

Builder object for constructing the sampler object

Methods

impl SamplerBuilder[src]

pub fn filter(&mut self, mag: FilterMode, min: FilterMode) -> &mut Self[src]

The magnification and the minification filters to apply to lookups.
Default: Magnification=FilterMode::Linear, Minification=FilterMode::Linear

pub fn mip_filter(&mut self, f: MipmapFilterMode) -> &mut Self[src]

The mipmap filter to apply to lookups.
Default: MipmapFilterMode::Linear

pub fn addressing(
    &mut self,
    u: AddressingMode,
    v: AddressingMode,
    w: AddressingMode
) -> &mut Self
[src]

The addressing mode for outside [0..1] range for U, V and W coordinates.
Default: U=AddressingMode::Repeat, V=AddressinMode::Repeat, W=AddressingMode::Repeat

pub fn lod_bias(&mut self, bias: f32) -> &mut Self[src]

The bias to be added to mipmap LOD calculation and bias provided by image sampling functions in SPIR-V, as described in the Level-of-Detail Operation section in Vulkan Specification.
Default: 0.0

pub fn max_anisotropy(&mut self, level: Option<f32>) -> &mut Self[src]

The anisotropy value clamp. Specifying None switches off the anisotropic filtering
Default: None

pub fn comparison(&mut self, op: Option<CompareOp>) -> &mut Self[src]

The comparison function to apply to fetched data before filtering as described in the Depth Compare Operation section in Vulkan Specification. Specifying None switches off the comparison against a reference value during lookups.
Default: None

pub fn lod_clamp(&mut self, min_lod: f32, max_lod: f32) -> &mut Self[src]

The values used to clamp the computed level-of-detail value, as described in the Level-of-Detail Operation section in Vulkan Specification.
Default: min_lod=0.0, max_lod=0.0

Panics

max_lod must be greater than or equal to min_lod

pub unsafe fn unnormalized_coordinates(
    &mut self,
    use_unnormalized: bool
) -> &mut Self
[src]

Whether to use unnormalized or normalized texel coordinates to address texels of the image.
Default: false

Safety

User must meet the constraints as described in the "Valid Usage" section in the VkSamplerCreateInfo manual page

pub fn create(&self, device: &Device) -> Result<Sampler>[src]

[feature = "Implements"] Create a new sampler object

Failures

On failure, this command returns

  • VK_ERROR_OUT_OF_HOST_MEMORY
  • VK_ERROR_OUT_OF_DEVICE_MEMORY
  • VK_ERROR_TOO_MANY_OBJECTS

Trait Implementations

impl Default for SamplerBuilder[src]

A default sampler builder: Linear Filtering, Repeat addressing, no anisotrophy and no lod biases

Auto Trait Implementations

impl RefUnwindSafe for SamplerBuilder

impl !Send for SamplerBuilder

impl !Sync for SamplerBuilder

impl Unpin for SamplerBuilder

impl UnwindSafe for SamplerBuilder

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.