Contents

setMeshSamplerStates(_:lodMinClamps:lodMaxClamps:range:)

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

Declaration

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

Parameters

  • samplers:

    An array of Mtlsamplerstate instances the command assigns to entries in the mesh shader argument table for sampler states.

  • lodMinClamps:

    An array of floating-point values. Each element is the smallest level of detail value a mesh 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 mesh 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 mesh shader argument table for sampler states. Each entry stores a record of the corresponding element in samplers.

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.

See Also

Assigning sampler states for mesh shaders