Contents

setObjectBufferOffset(_:index:)

Updates an entry in the object shader argument table with a new location within the entry’s current buffer.

Declaration

func setObjectBufferOffset(_ offset: Int, index: Int)

Parameters

  • 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 already stores a record of an Mtlbuffer.

Discussion

The command this method encodes changes the offset for a mesh buffer that already has a previous assignment from one of your earlier commands.

For more information, see:

The command can also adjust the offset for an entry that you previously set with the setObjectBytes(_:length:index:) method.

See Also

Assigning buffers for object shaders