pub struct Sampler { /* private fields */ }
Expand description

Describes how to retrieve data from a sampled image within a shader.

Examples

A simple sampler for most usages:

use vulkano::sampler::{Sampler, SamplerCreateInfo};

let _sampler = Sampler::new(device.clone(), SamplerCreateInfo::simple_repeat_linear_no_mipmap());

More detailed sampler creation:

use vulkano::sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo};

let _sampler = Sampler::new(device.clone(), SamplerCreateInfo {
    mag_filter: Filter::Linear,
    min_filter: Filter::Linear,
    address_mode: [SamplerAddressMode::Repeat; 3],
    mip_lod_bias: 1.0,
    lod: 0.0..=100.0,
    ..Default::default()
})
.unwrap();

Implementations

Creates a new Sampler.

Panics
  • Panics if create_info.anisotropy is Some and contains a value less than 1.0.
  • Panics if create_info.lod is empty.

Creates a new Sampler from a raw object handle.

Safety
  • handle must be a valid Vulkan object handle created from device.
  • create_info must match the info used to create the object.

Checks whether this sampler is compatible with image_view.

Returns the address modes for the u, v and w coordinates.

Returns the anisotropy mode.

Returns the border color if one is used by this sampler.

Returns the compare operation if the sampler is a compare-mode sampler.

Returns the LOD range.

Returns the magnification filter.

Returns the minification filter.

Returns the mip LOD bias.

Returns the mipmap mode.

Returns the reduction mode.

Returns a reference to the sampler YCbCr conversion of this sampler, if any.

Returns true if the sampler uses unnormalized coordinates.

Trait Implementations

Formats the value using the given formatter. Read more
Returns the device that owns Self.
Executes the destructor for this type. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
The type of the object.
Returns the raw Vulkan handle of the object.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.