logo
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;

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

More detailed sampler creation:

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

let _sampler = Sampler::start(device.clone())
    .filter(Filter::Linear)
    .address_mode(SamplerAddressMode::Repeat)
    .mip_lod_bias(1.0)
    .lod(0.0..=100.0)
    .build()
    .unwrap();

Implementations

Starts constructing a new Sampler.

Shortcut for creating a sampler with linear sampling, linear mipmaps, and with the repeat mode for borders.

Useful for prototyping, but can also be used in real projects.

Shortcut for creating a sampler with linear sampling, that only uses the main level of images, and with the repeat mode for borders.

Useful for prototyping, but can also be used in real projects.

Checks whether this sampler is compatible with image_view.

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 magnification filter.

Returns the minification filter.

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The type of the object.

Returns a reference to 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

Builds a pointer to this type from a raw pointer.

Returns true if the size is suitable to store a type like this.

Returns the size of an individual element.

Performs the conversion.

Performs the conversion.

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.