<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLSamplerAddressMode",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:@E@MTLSamplerAddressMode"
  },
  "title" : "MTLSamplerAddressMode"
}
-->

# MTLSamplerAddressMode

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

```
enum MTLSamplerAddressMode
```

## Topics

### Address mode options

[`MTLSamplerAddressMode.clampToEdge`](/documentation/Metal/MTLSamplerAddressMode/clampToEdge)

Texture coordinates are clamped between `0.0` and `1.0`, inclusive.

[`MTLSamplerAddressMode.mirrorClampToEdge`](/documentation/Metal/MTLSamplerAddressMode/mirrorClampToEdge)

Between `-1.0` and `1.0`, the texture coordinates are mirrored across the axis; outside `-1.0` and `1.0`, texture coordinates are clamped.

[`MTLSamplerAddressMode.repeat`](/documentation/Metal/MTLSamplerAddressMode/repeat)

Texture coordinates wrap to the other side of the texture, effectively keeping only the fractional part of the texture coordinate.

[`MTLSamplerAddressMode.mirrorRepeat`](/documentation/Metal/MTLSamplerAddressMode/mirrorRepeat)

Between `-1.0` and `1.0`, the texture coordinates are mirrored across the axis; outside `-1.0` and `1.0`, the image is repeated.

[`MTLSamplerAddressMode.clampToZero`](/documentation/Metal/MTLSamplerAddressMode/clampToZero)

Out-of-range texture coordinates return transparent zero `(0,0,0,0)` for images with an alpha channel and return opaque zero `(0,0,0,1)` for images without an alpha channel.

[`MTLSamplerAddressMode.clampToBorderColor`](/documentation/Metal/MTLSamplerAddressMode/clampToBorderColor)

An address mode that returns the sampler’s border color.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)