logo
#[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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

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 !=.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.