Contents

setBufferOffset(_:index:)

Changes where the data begins in a buffer already bound to the buffer argument table.

Declaration

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

Parameters

  • offset:

    Where the data to bind begins, in bytes, from the start of the bound buffer.

  • index:

    The argument table entry to change.

Discussion

Prefer calling this method to unbinding and then rebinding data.

For buffers binding to an argument using the device address space, align the offset to the data type’s size. The maximum size for an offset is 16 bytes.

For buffers in the constant address space, the minimum alignment depends on the hardware running your app. See the Metal feature set tables (PDF) for information on each Apple GPU family.

See Also

Binding buffers