<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLRenderCommandEncoder/setVertexSamplerState(_:lodMinClamp:lodMaxClamp:index:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLRenderCommandEncoder(im)setVertexSamplerState:lodMinClamp:lodMaxClamp:atIndex:"
  },
  "title" : "setVertexSamplerState(_:lodMinClamp:lodMaxClamp:index:)"
}
-->

# setVertexSamplerState(_:lodMinClamp:lodMaxClamp:index:)

Assigns a sampler state and clamp values to an entry in the vertex shader argument table.

```
func setVertexSamplerState(_ sampler: (any MTLSamplerState)?, lodMinClamp: Float, lodMaxClamp: Float, index: Int)
```

## Parameters

`sampler`

An [`MTLSamplerState`](/documentation/Metal/MTLSamplerState) instance the command assigns to an entry in the vertex shader argument table for sampler states.

`lodMinClamp`

The smallest level of detail value a vertex shader can use when it samples a texture.

`lodMaxClamp`

The largest level of detail value a vertex shader can use when it samples a texture.

`index`

An integer that represents the entry in the vertex shader argument table for sampler states that stores a record of `sampler`.

## Discussion

The method’s `lodMinClamp` and `lodMaxClamp` parameters override the default values for `sampler`. You can set the 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`.

---

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)