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
.
pub fn simple_repeat_linear(
device: Arc<Device>
) -> Result<Arc<Sampler>, SamplerCreationError>
pub fn simple_repeat_linear(
device: Arc<Device>
) -> Result<Arc<Sampler>, SamplerCreationError>
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.
pub fn simple_repeat_linear_no_mipmap(
device: Arc<Device>
) -> Result<Arc<Sampler>, SamplerCreationError>
pub fn simple_repeat_linear_no_mipmap(
device: Arc<Device>
) -> Result<Arc<Sampler>, SamplerCreationError>
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.
pub fn check_can_sample<I>(
&self,
image_view: &I
) -> Result<(), SamplerImageViewIncompatibleError> where
I: ImageViewAbstract + ?Sized,
pub fn check_can_sample<I>(
&self,
image_view: &I
) -> Result<(), SamplerImageViewIncompatibleError> where
I: ImageViewAbstract + ?Sized,
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
Returns a reference to the object.
Auto Trait Implementations
impl RefUnwindSafe for Sampler
impl UnwindSafe for Sampler
Blanket Implementations
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.