---
title: "setFragmentSamplerStates(_:lodMinClamps:lodMaxClamps:range:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrendercommandencoder/setfragmentsamplerstates(_:lodminclamps:lodmaxclamps:range:)"
---

# setFragmentSamplerStates(_:lodMinClamps:lodMaxClamps:range:)

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

## Declaration

```swift
func setFragmentSamplerStates(_ samplers: [(any MTLSamplerState)?], lodMinClamps: [Float], lodMaxClamps: [Float], range: Range<Int>)
```

## Parameters

- `samplers`: An array of doc://com.apple.metal/documentation/Metal/MTLSamplerState instances the command assigns to entries in the fragment shader argument table for sampler states.
- `lodMinClamps`: An array of floating-point values. Each element is the smallest level of detail value a fragment shader can use when it samples a texture with the corresponding element in samplers.
- `lodMaxClamps`: An array of floating-point values. Each element is the largest level of detail value a fragment 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 fragment shader argument table for sampler states. Each entry stores a record of the corresponding element in samplers.

## Discussion

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 and lodMaxClamp properties of MTLSamplerDescriptor before you create the sampler. By default, the sampler state at each index is nil. note: The Objective-C version of this method is setFragmentSamplerStates:lodMinClamps:lodMaxClamps:withRange:.

## See Also

### Assigning sampler states

- [setFragmentSamplerState(_:index:)](metal/mtlrendercommandencoder/setfragmentsamplerstate(_:index:).md)
- [setFragmentSamplerState(_:lodMinClamp:lodMaxClamp:index:)](metal/mtlrendercommandencoder/setfragmentsamplerstate(_:lodminclamp:lodmaxclamp:index:).md)
- [setFragmentSamplerStates(_:range:)](metal/mtlrendercommandencoder/setfragmentsamplerstates(_:range:).md)
