MTLSamplerState
An instance that defines how a texture should be sampled.
Declaration
protocol MTLSamplerState : NSObjectProtocol, SendableMentioned in
Overview
The MTLSamplerState protocol defines the interface for a lightweight instance used to encode how a shader or compute kernel should sample a texture. To create a sampler state instance:
Create an MTLSamplerDescriptor instance.
Set the desired properties of the sampler descriptor, including filtering options, addressing modes, maximum anisotropy, and level-of-detail parameters.
Call the makeSamplerState(descriptor:) method of the MTLDevice instance.
(Your app does not define a class that implements the MTLSamplerState protocol.)
You can either release the MTLSamplerDescriptor instance or modify its property values and reuse it to create more MTLSamplerState instances. The descriptor’s properties are only used during instance creation; once created the behavior of a sampler state instance is fixed and cannot be changed.