<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLRenderCommandEncoder/setMeshSamplerStates:lodMinClamps:lodMaxClamps:withRange:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLRenderCommandEncoder(im)setMeshSamplerStates:lodMinClamps:lodMaxClamps:withRange:"
  },
  "title" : "setMeshSamplerStates:lodMinClamps:lodMaxClamps:withRange:"
}
-->

# setMeshSamplerStates:lodMinClamps:lodMaxClamps:withRange:

Assigns multiple sampler states and clamp values to a range of entries in the mesh shader argument table.

```
- (void) setMeshSamplerStates:(id<MTLSamplerState> const[]) samplers lodMinClamps:(const float[]) lodMinClamps lodMaxClamps:(const float[]) lodMaxClamps withRange:(NSRange) range;
```

## Parameters

`samplers`

A pointer to a C array of [`MTLSamplerState`](/documentation/Metal/MTLSamplerState) instances the command assigns to entries in the mesh shader argument table for sampler states.

`lodMinClamps`

A pointer to a C array of floating-point values. Each element is the smallest level of detail value a mesh shader can use when it samples a texture with the corresponding element in `samplers`.

`lodMaxClamps`

A pointer to a C array of floating-point values. Each element is the largest level of detail value a mesh shader can use when it samples a texture with the corresponding element in `samplers`.

`range`

A span of integers that represent the entries in the mesh shader argument table for sampler states. Each entry stores a record of the corresponding element in `samplers`.

## Discussion

Each element of the method’s `lodMinClamps` and `lodMaxClamps` parameters overrides the default values for the corresponding sampler in `samplers`. You can set a sampler’s default values by configuring the [`lodMinClamp`](/documentation/Metal/MTLSamplerDescriptor/lodMinClamp) and [`lodMaxClamp`](/documentation/Metal/MTLSamplerDescriptor/lodMaxClamp) properties of [`MTLSamplerDescriptor`](/documentation/Metal/MTLSamplerDescriptor) before you create the sampler.

By default, the sampler state at each index is `nil`.

> Note:
> The Swift version of this method is ``doc://com.apple.metal/documentation/Metal/MTLRenderCommandEncoder/setMeshSamplerStates(_:lodMinClamps:lodMaxClamps:range:)``.

---

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)