Struct SamplerBuilder

Source
pub struct SamplerBuilder<'b> { /* private fields */ }
Expand description

A builder for Sampler.

Implementations§

Source§

impl<'b> SamplerBuilder<'b>

Source

pub fn new() -> SamplerBuilder<'b>

Returns a new render pass builder.

Source

pub fn flags<'s>( &'s mut self, flags: SamplerCreateFlags, ) -> &'s mut SamplerBuilder<'b>

Reserved for future use.

Source

pub fn mag_filter<'s>( &'s mut self, mag_filter: Filter, ) -> &'s mut SamplerBuilder<'b>

Specifies the magnification filter to apply to lookups.

Source

pub fn min_filter<'s>( &'s mut self, min_filter: Filter, ) -> &'s mut SamplerBuilder<'b>

Specifies the minification filter to apply to lookups.

Source

pub fn mipmap_mode<'s>( &'s mut self, mipmap_mode: SamplerMipmapMode, ) -> &'s mut SamplerBuilder<'b>

Specifies the mipmap filter to apply to lookups.

Source

pub fn address_mode_u<'s>( &'s mut self, address_mode_u: SamplerAddressMode, ) -> &'s mut SamplerBuilder<'b>

Specifies the addressing mode for outside [0..1] range for U coordinate.

Source

pub fn address_mode_v<'s>( &'s mut self, address_mode_v: SamplerAddressMode, ) -> &'s mut SamplerBuilder<'b>

Specifies the addressing mode for outside [0..1] range for V coordinate.

Source

pub fn address_mode_w<'s>( &'s mut self, address_mode_w: SamplerAddressMode, ) -> &'s mut SamplerBuilder<'b>

Specifies the addressing mode for outside [0..1] range for W coordinate.

Source

pub fn mip_lod_bias<'s>( &'s mut self, mip_lod_bias: f32, ) -> &'s mut SamplerBuilder<'b>

Specifies the 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 [TODO: INSERT LINK].

Source

pub fn anisotropy_enable<'s>( &'s mut self, anisotropy_enable: bool, ) -> &'s mut SamplerBuilder<'b>

Specifies whether or not to enable anisotropic filtering, as described in the Texel Anisotropic Filtering section.

Source

pub fn max_anisotropy<'s>( &'s mut self, max_anisotropy: f32, ) -> &'s mut SamplerBuilder<'b>

Specifies the anisotropy value clamp.

Source

pub fn compare_enable<'s>( &'s mut self, compare_enable: bool, ) -> &'s mut SamplerBuilder<'b>

Specifies whether or not to enable comparison against a reference value during lookups.

Note: Some implementations will default to shader state if this member does not match.

Source

pub fn compare_op<'s>( &'s mut self, compare_op: CompareOp, ) -> &'s mut SamplerBuilder<'b>

Specifies the comparison function to apply to fetched data before filtering as described in the Depth Compare Operation section.

Source

pub fn min_lod<'s>(&'s mut self, min_lod: f32) -> &'s mut SamplerBuilder<'b>

Specifies the minimum value used to clamp the computed level-of-detail value, as described in the Level-of-Detail Operation section. max_lod must be greater than or equal to min_lod.

Source

pub fn max_lod<'s>(&'s mut self, max_lod: f32) -> &'s mut SamplerBuilder<'b>

Specifies the maximum value used to clamp the computed level-of-detail value, as described in the Level-of-Detail Operation section. max_lod must be greater than or equal to min_lod.

Source

pub fn border_color<'s>( &'s mut self, border_color: BorderColor, ) -> &'s mut SamplerBuilder<'b>

Specifies the predefined border color to use.

Source

pub fn unnormalized_coordinates<'s>( &'s mut self, unnormalized_coordinates: bool, ) -> &'s mut SamplerBuilder<'b>

Specifies whether to use unnormalized or normalized texel coordinates to address texels of the image. When set to VK_TRUE, the range of the image coordinates used to lookup the texel is in the range of zero to the image dimensions for x, y and z. When set to VK_FALSE the range of image coordinates is zero to one. When unnormalizedCoordinates is VK_TRUE, samplers have the following requirements:

  • minFilter and magFilter must be equal.

  • mipmapMode must be VK_SAMPLER_MIPMAP_MODE_NEAREST.

  • minLod and maxLod must be zero.

  • addressModeU and addressModeV must each be either VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE or VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER.

  • anisotropyEnable must be VK_FALSE.

  • compareEnable must be VK_FALSE.

  • The sampler must not enable sampler Y’CBCR conversion.

  • When unnormalizedCoordinates is VK_TRUE, images the sampler is used with in the shader have the following requirements:

    • The viewType must be either VK_IMAGE_VIEW_TYPE_1D or VK_IMAGE_VIEW_TYPE_2D.
    • The image view must have a single layer and a single mip level.
  • When unnormalizedCoordinates is VK_TRUE, image built-in functions in the shader that use the sampler have the following requirements:

    • The functions must not use projection.
    • The functions must not use offsets.
Source

pub fn build(&self, device: Device) -> VdResult<Sampler>

Creates and returns a new Sampler

Trait Implementations§

Source§

impl<'b> Clone for SamplerBuilder<'b>

Source§

fn clone(&self) -> SamplerBuilder<'b>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'b> Debug for SamplerBuilder<'b>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'b> Freeze for SamplerBuilder<'b>

§

impl<'b> RefUnwindSafe for SamplerBuilder<'b>

§

impl<'b> !Send for SamplerBuilder<'b>

§

impl<'b> !Sync for SamplerBuilder<'b>

§

impl<'b> Unpin for SamplerBuilder<'b>

§

impl<'b> UnwindSafe for SamplerBuilder<'b>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.