Class

MTLSamplerDescriptor

An object that you use to configure a texture sampler.

Declaration

@interface MTLSamplerDescriptor : NSObject

Overview

To create a sampler, first create a MTLSamplerDescriptor object and configure the descriptor’s properties. Then call the newSamplerStateWithDescriptor: method on the MTLDevice object that will use this sampler. After you create the sampler, you can release the descriptor or reconfigure its properties to create other samplers.

Topics

Declaring the Coordinate Space

normalizedCoordinates

A Boolean value that indicates whether texture coordinates are normalized to the range [0.0, 1.0].

Declaring Addressing Modes

rAddressMode

The address mode for the texture depth (r) coordinate.

sAddressMode

The address mode for the texture width (s) coordinate.

tAddressMode

The address mode for the texture height (t) coordinate.

borderColor

The border color for clamped texture values.

MTLSamplerAddressMode

Modes that determine the texture coordinate at each pixel when a fetch falls outside the bounds of a texture.

MTLSamplerBorderColor

Values that determine the border color for clamped texture values when the sampler address mode is MTLSamplerAddressModeClampToBorderColor.

Declaring Filter Modes

minFilter

The filtering option for combining pixels within one mipmap level when the sample footprint is larger than a pixel (minification).

magFilter

The filtering operation for combining pixels within one mipmap level when the sample footprint is smaller than a pixel (magnification).

mipFilter

The filtering option for combining pixels between two mipmap levels.

lodMinClamp

The minimum level of detail (LOD) to use when sampling from a texture.

lodMaxClamp

The maximum level of detail (LOD) to use when sampling from a texture.

lodAverage

A Boolean value that specifies whether the GPU can use an average level of detail (LOD) when sampling from a texture.

maxAnisotropy

The number of samples that can be taken to improve the quality of sample footprints that are anisotropic.

MTLSamplerMinMagFilter

Filtering options for determining which pixel value is returned within a mipmap level.

MTLSamplerMipFilter

Filtering options for determining what pixel value is returned with multiple mipmap levels.

Declaring the Depth Comparison Mode

compareFunction

The sampler comparison function used when performing a sample compare operation on a depth texture.

MTLCompareFunction

Options used to specify how a sample compare operation should be performed on a depth texture.

Declaring Whether the Sampler Can Be Used in Argument Buffers

supportArgumentBuffers

A Boolean value that specifies whether the sampler can be encoded into an argument buffer.

Identifying the Sampler

label

A string that identifies the sampler.

Relationships

Inherits From

Conforms To

See Also

Sampling Texture Data

MTLSamplerState

An object that defines how a texture should be sampled.