An object that you use to configure a texture sampler.
- iOS 8.0+
- macOS 10.11+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
To create a sampler, first create a
MTLSamplerDescriptor object and configure the descriptor’s properties. Then call the
makeSamplerState(descriptor:) 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.
Declaring the Coordinate Space
Declaring Addressing Modes
Modes that determine the texture coordinate at each pixel when a fetch falls outside the bounds of a texture.
Declaring Filter Modes
var lodAverage: Bool
A Boolean value that specifies whether the GPU can use an average level of detail (LOD) when sampling from a texture.
var maxAnisotropy: Int
The number of samples that can be taken to improve the quality of sample footprints that are anisotropic.
Declaring the Depth Comparison Mode
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
This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.Learn more about using Apple's beta software