Enum vulkano::sampler::SamplerAddressMode
source · [−]#[non_exhaustive]
#[repr(i32)]
pub enum SamplerAddressMode {
Repeat,
MirroredRepeat,
ClampToEdge,
ClampToBorder,
MirrorClampToEdge,
}
Expand description
How the sampler should behave when it needs to access a pixel that is out of range of the texture.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Repeat
Repeat the texture. In other words, the pixel at coordinate x + 1.0
is the same as the
one at coordinate x
.
MirroredRepeat
Repeat the texture but mirror it at every repetition. In other words, the pixel at
coordinate x + 1.0
is the same as the one at coordinate 1.0 - x
.
ClampToEdge
The coordinates are clamped to the valid range. Coordinates below 0.0 have the same value as coordinate 0.0. Coordinates over 1.0 have the same value as coordinate 1.0.
ClampToBorder
Any pixel out of range is colored using the colour selected with the border_color
on the
SamplerBuilder
.
When this mode is chosen, the numeric type of the image view’s format must match the border color. When using a floating-point border color, the sampler can only be used with floating-point or depth image views. When using an integer border color, the sampler can only be used with integer or stencil image views. In addition to this, you can’t use an opaque black border color with an image view that uses component swizzling.
MirrorClampToEdge
Similar to MirroredRepeat
, except that coordinates are clamped to the range
[-1.0, 1.0]
.
The sampler_mirror_clamp_to_edge
feature or the
khr_sampler_mirror_clamp_to_edge
extension must be enabled on the device.
Trait Implementations
sourceimpl Clone for SamplerAddressMode
impl Clone for SamplerAddressMode
sourcefn clone(&self) -> SamplerAddressMode
fn clone(&self) -> SamplerAddressMode
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more