<!--
{
  "documentType" : "article",
  "framework" : "Xcode",
  "identifier" : "/documentation/Xcode/Inspecting-sampler-states",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Inspecting sampler states"
}
-->

# Inspecting sampler states

Verify your sampler state configurations by examining their properties.

## Overview

The Metal debugger allows you to inspect a sampler state with the Sampler State viewer.
After opening a sampler state, you can view its associated properties and preview the sampling behavior.
For more information, see [Inspecting the bound resources for a command](/documentation/Xcode/Inspecting-the-bound-resources-for-a-command) or [Analyzing memory usage](/documentation/Xcode/Analyzing-memory-usage).

### Navigate your sampler state

The Sampler State viewer shows the properties of your sampler state on the left (as configured by <doc://com.apple.documentation/documentation/Metal/MTLSamplerDescriptor>) and a preview on the right. The preview illustrates how pixels in a texture appear when using your sampler state.

![A screenshot of the Sampler State viewer displaying a sampler state configured with nearest filtering and clamp-to-edge address mode.](images/com.apple.Xcode/gputools-metal-debugger-sv-outline.png)

The square region in the center of the preview corresponds to UV coordinates within the range of `0.0` to `1.0`.

![A screenshot of the Sampler State viewer displaying a sampler state configured with nearest filtering and clamp-to-edge address mode. The region in bounds is highlighted.](images/com.apple.Xcode/gputools-metal-debugger-sv-outline-green.png)

You can use the preview to quickly verify the configuration for your sampler state.
For example, if you want a texture to mirror, but it’s drawing a constant value instead, you can check the sampler state.
In the screenshot below, the sampler state is configured to clamp to a border color that’s opaque black, rather than using mirror repeat as the address mode:

![A screenshot of the Sampler State viewer displaying a sampler state configured with nearest filtering and clamp-to-border address mode. The border color is opaque black.](images/com.apple.Xcode/gputools-metal-debugger-sv-nearest-clamp-border-black-plus-overview.png)

### Try various combinations

The properties you configure when creating a sampler state determine how a texture looks when sampling it.
The properties related to filtering control how pixels combine when the sample footprint is either larger or smaller than a pixel, or when it’s between mipmap levels.
The address mode determines the texture coordinate at each pixel when a read falls outside the bounds of a texture. You can try using different combinations of filtering
and addressing modes until you achieve your desired look.

|Properties                                                                                                                                                                                                                                                                  |Preview                                                                                                                                                                                                                                           |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/nearest>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/clampToEdge>                                                                                                   |![A screenshot of the Sampler State viewer displaying a sampler state configured with nearest filtering and clamp-to-edge address mode.](gputools-metal-debugger-sv-nearest-clamp.png)                                                            |
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/nearest>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/mirrorClampToEdge>                                                                                             |![A screenshot of the Sampler State viewer displaying a sampler state configured with nearest filtering and mirror-clamp-to-edge address mode.](gputools-metal-debugger-sv-nearest-mirror-clamp.png)                                              |
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/nearest>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/repeat>                                                                                                        |![A screenshot of the Sampler State viewer displaying a sampler state configured with nearest filtering and repeat address mode.](gputools-metal-debugger-sv-nearest-repeat.png)                                                                  |
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/nearest>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/mirrorRepeat>                                                                                                  |![A screenshot of the Sampler State viewer displaying a sampler state configured with nearest filtering and mirror-repeat address mode.](gputools-metal-debugger-sv-nearest-mirror.png)                                                           |
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/nearest>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/clampToZero>                                                                                                   |![A screenshot of the Sampler State viewer displaying a sampler state configured with nearest filtering and clamp-to-zero address mode.](gputools-metal-debugger-sv-nearest-zero.png)                                                             |
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/nearest>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/clampToBorderColor>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerBorderColor/opaqueBlack>     |![A screenshot of the Sampler State viewer displaying a sampler state configured with nearest filtering and clamp-to-border address mode. The border color is opaque black.](gputools-metal-debugger-sv-nearest-clamp-border-black.png)           |
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/nearest>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/clampToBorderColor>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerBorderColor/opaqueWhite>     |![A screenshot of the Sampler State viewer displaying a sampler state configured with nearest filtering and clamp-to-border address mode. The border color is opaque white.](gputools-metal-debugger-sv-nearest-clamp-border-white.png)           |
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/nearest>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/clampToBorderColor>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerBorderColor/transparentBlack>|![A screenshot of the Sampler State viewer displaying a sampler state configured with nearest filtering and clamp-to-border address mode. The border color is transparent black.](gputools-metal-debugger-sv-nearest-clamp-border-transparent.png)|
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/linear>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/clampToEdge>                                                                                                    |![A screenshot of the Sampler State viewer displaying a sampler state configured with linear filtering and clamp-to-edge address mode.](gputools-metal-debugger-sv-linear-clamp.png)                                                              |
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/linear>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/clampToEdge>                                                                                                    |![A screenshot of the Sampler State viewer displaying a sampler state configured with linear filtering and mirror-clamp-to-edge address mode.](gputools-metal-debugger-sv-linear-mirror-clamp.png)                                                |
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/linear>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/repeat>                                                                                                         |![A screenshot of the Sampler State viewer displaying a sampler state configured with linear filtering and repeat address mode.](gputools-metal-debugger-sv-linear-repeat.png)                                                                    |
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/linear>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/mirrorRepeat>                                                                                                   |![A screenshot of the Sampler State viewer displaying a sampler state configured with linear filtering and mirror-repeat address mode.](gputools-metal-debugger-sv-linear-mirror.png)                                                             |
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/linear>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/clampToZero>                                                                                                    |![A screenshot of the Sampler State viewer displaying a sampler state configured with linear filtering and clamp-to-zero address mode.](gputools-metal-debugger-sv-linear-zero.png)                                                               |
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/linear>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/clampToBorderColor>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerBorderColor/opaqueBlack>      |![A screenshot of the Sampler State viewer displaying a sampler state configured with linear filtering and clamp-to-border address mode. The border color is opaque black.](gputools-metal-debugger-sv-linear-clamp-border-black.png)             |
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/linear>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/clampToBorderColor>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerBorderColor/opaqueWhite>      |![A screenshot of the Sampler State viewer displaying a sampler state configured with linear filtering and clamp-to-border address mode. The border color is opaque white.](gputools-metal-debugger-sv-linear-clamp-border-white.png)             |
|<doc://com.apple.documentation/documentation/Metal/MTLSamplerMinMagFilter/linear>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerAddressMode/clampToBorderColor>, <doc://com.apple.documentation/documentation/Metal/MTLSamplerBorderColor/transparentBlack> |![A screenshot of the Sampler State viewer displaying a sampler state configured with linear filtering and clamp-to-border address mode. The border color is transparent black.](gputools-metal-debugger-sv-linear-clamp-border-transparent.png)  |

---

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)