Contents

setSamplerState(_:lodMinClamp:lodMaxClamp:index:)

Encodes a texture sampler with a custom level of detail clamping, allowing compute kernels to use it for sampling textures on the GPU.

Declaration

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

Parameters

  • sampler:

    An Mtlsamplerstate instance to bind to the sampler argument table.

  • lodMinClamp:

    The minimum level of detail used when sampling a texture.

  • lodMaxClamp:

    The maximum level of detail used when sampling a texture.

  • index:

    The index in the sampler argument table to bind the sampler to.

Discussion

Calling this method ignores the lodMinClamp and lodMaxClamp properties of the sampler, using the provided levels of detail instead.

See Also

Binding texture samplers