Struct vulkano::sampler::Sampler [] [src]

pub struct Sampler { /* fields omitted */ }

Describes how to retrieve data from an image within a shader.

Methods

impl Sampler
[src]

[src]

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.

Panic

  • Panics if out of memory or the maximum number of samplers has exceeded.

[src]

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.

Panic

  • Panics if out of memory or the maximum number of samplers has exceeded.

[src]

Creates a new Sampler with the given behavior.

mag_filter and min_filter define how the implementation should sample from the image when it is respectively larger and smaller than the original.

mipmap_mode defines how the implementation should choose which mipmap to use.

address_u, address_v and address_w define how the implementation should behave when sampling outside of the texture coordinates range [0.0, 1.0].

mip_lod_bias is a value to add to .

max_anisotropy must be superior or equal to 1.0. If superior to 1.0, the implementation will use anistropic filtering. Using a value superior to 1.0 requires the sampler_anisotropy feature to be enabled when creating the device.

min_lod and max_lod are respectively the minimum and maximum mipmap level to use. max_lod must always be superior or equal to min_lod.

Panic

  • Panics if multiple ClampToBorder values are passed and the border color is different.
  • Panics if max_anisotropy < 1.0.
  • Panics if min_lod > max_lod.

[src]

Creates a new Sampler with the given behavior.

Contrary to new, this creates a sampler that is used to compare depth values.

A sampler like this can only operate on depth or depth-stencil textures. Instead of returning the value of the texture, this sampler will return a value between 0.0 and 1.0 indicating how much the reference value (passed by the shader) compares to the value in the texture.

Note that it doesn't make sense to create a compare-mode sampler with an integer border color, as such a sampler would be unusable.

Panic

Same panic reasons as new.

[src]

Creates a sampler with unnormalized coordinates. This means that texture coordinates won't range between 0.0 and 1.0 but use plain pixel offsets.

Using an unnormalized sampler adds a few restrictions:

  • It can only be used with non-array 1D or 2D images.
  • It can only be used with images with a single mipmap.
  • Projection and offsets can't be used by shaders. Only the first mipmap can be accessed.

Panic

  • Panics if multiple ClampToBorder values are passed and the border color is different.

[src]

Returns true if the sampler is a compare-mode sampler.

[src]

Returns true if the sampler is unnormalized.

[src]

Returns true if the sampler can be used with floating-point image views. See the documentation of the sampler module for more info.

[src]

Returns true if the sampler can be used with integer image views. See the documentation of the sampler module for more info.

[src]

Returns true if the sampler can be used with image views that have non-identity swizzling. See the documentation of the sampler module for more info.

Trait Implementations

impl DeviceOwned for Sampler
[src]

[src]

Returns the device that owns Self.

impl VulkanObject for Sampler
[src]

The type of the object.

TYPE: DebugReportObjectTypeEXT = vk::DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT

The DebugReportObjectTypeEXT of the internal Vulkan handle.

[src]

Returns a reference to the object.

impl Debug for Sampler
[src]

[src]

Formats the value using the given formatter. Read more

impl Drop for Sampler
[src]

[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl Send for Sampler

impl Sync for Sampler