Contents

setVertexSamplerState(_:lodMinClamp:lodMaxClamp:index:)

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

Declaration

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

Parameters

  • sampler:

    An 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 and lodMaxClamp properties of MTLSamplerDescriptor before you create the sampler.

By default, the sampler state at each index is nil.

See Also

Assigning sampler states