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

# setFragmentSamplerStates:withRange:

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

## Declaration

```occ
- (void) setFragmentSamplerStates:(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 fragment shader argument table for sampler states.
- `range`: A span of integers that represent the entries in the fragment 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 setFragmentSamplerStates(_:range:).

## See Also

### Assigning sampler states

- [setFragmentSamplerState(_:index:)](metal/mtlrendercommandencoder/setfragmentsamplerstate(_:index:).md)
- [setFragmentSamplerState(_:lodMinClamp:lodMaxClamp:index:)](metal/mtlrendercommandencoder/setfragmentsamplerstate(_:lodminclamp:lodmaxclamp:index:).md)
- [setFragmentSamplerStates:lodMinClamps:lodMaxClamps:withRange:](metal/mtlrendercommandencoder/setfragmentsamplerstates:lodminclamps:lodmaxclamps:withrange:.md)
