---
title: "setMeshSamplerStates:withRange:"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrendercommandencoder/setmeshsamplerstates:withrange:"
---

# setMeshSamplerStates:withRange:

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

## Declaration

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

## Parameters

- `samplers`: A pointer to a C 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 Swift version of this method is setMeshSamplerStates(_:range:).

## 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:withRange:](metal/mtlrendercommandencoder/setmeshsamplerstates:lodminclamps:lodmaxclamps:withrange:.md)
