---
title: "setMeshSamplerStates(_:range:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrendercommandencoder/setmeshsamplerstates(_:range:)"
---

# setMeshSamplerStates(_:range:)

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

## Declaration

```swift
func setMeshSamplerStates(_ samplers: [(any MTLSamplerState)?], range: Range<Int>)
```

## Parameters

- `samplers`: An array of doc://com.apple.metal/documentation/Metal/MTLSamplerState instances the command assigns to entries in the mesh shader argument table for sampler states.
- `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

Discussion By default, the sampler state at each index is nil. note: The Objective-C version of this method is setMeshSamplerStates:withRange:.

## See Also

### Assigning sampler states for mesh shaders

- [setMeshSamplerState(_:index:)](metal/mtlrendercommandencoder/setmeshsamplerstate(_:index:).md)
- [setMeshSamplerState(_:lodMinClamp:lodMaxClamp:index:)](metal/mtlrendercommandencoder/setmeshsamplerstate(_:lodminclamp:lodmaxclamp:index:).md)
- [setMeshSamplerStates(_:lodMinClamps:lodMaxClamps:range:)](metal/mtlrendercommandencoder/setmeshsamplerstates(_:lodminclamps:lodmaxclamps:range:).md)
