---
title: MTLSamplerState
framework: metal
role: symbol
role_heading: Protocol
path: metal/mtlsamplerstate
---

# MTLSamplerState

An instance that defines how a texture should be sampled.

## Declaration

```swift
protocol MTLSamplerState : NSObjectProtocol, Sendable
```

## Mentioned in

Improving CPU performance by using argument buffers Adding mipmap filtering to samplers

## Overview

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.

## Topics

### Identifying the sampler

- [device](metal/mtlsamplerstate/device.md)
- [label](metal/mtlsamplerstate/label.md)

### Instance Properties

- [gpuResourceID](metal/mtlsamplerstate/gpuresourceid.md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Texture samplers

- [Creating and sampling textures](metal/creating-and-sampling-textures.md)
- [MTLSamplerDescriptor](metal/mtlsamplerdescriptor.md)
- [MTLSamplePosition](metal/mtlsampleposition.md)
- [MTLSamplerReductionMode](metal/mtlsamplerreductionmode.md)
