Contents

setObjectBuffer(_:offset:index:)

Assigns a buffer to an entry in the object shader argument table.

Declaration

func setObjectBuffer(_ buffer: (any MTLBuffer)?, offset: Int, index: Int)

Parameters

  • buffer:

    An Mtlbuffer instance the command assigns to an entry in the object shader argument table for buffers.

  • offset:

    An integer that represents the location, in bytes, from the start of buffer where the object shader argument data begins.

    See the Metal Feature Set Tables to check for offset alignment requirements for buffers in device and constant address space.

  • index:

    An integer that represents the entry in the object shader argument table for buffers that stores a record of buffer and offset.

Mentioned in

Discussion

By default, the texture at each index is nil.

See Also

Assigning buffers for object shaders