Enum vulkano::sampler::SamplerAddressMode
source · [−]#[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
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
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SamplerAddressMode
impl Debug for SamplerAddressMode
sourceimpl From<SamplerAddressMode> for SamplerAddressMode
impl From<SamplerAddressMode> for SamplerAddressMode
sourcefn from(val: SamplerAddressMode) -> Self
fn from(val: SamplerAddressMode) -> Self
Performs the conversion.
sourceimpl Hash for SamplerAddressMode
impl Hash for SamplerAddressMode
impl Copy for SamplerAddressMode
impl Eq for SamplerAddressMode
impl StructuralEq for SamplerAddressMode
impl StructuralPartialEq for SamplerAddressMode
Auto Trait Implementations
impl RefUnwindSafe for SamplerAddressMode
impl Send for SamplerAddressMode
impl Sync for SamplerAddressMode
impl Unpin for SamplerAddressMode
impl UnwindSafe for SamplerAddressMode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more