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
bufferwhere the object shader argument data begins.See the Metal Feature Set Tables to check for offset alignment requirements for buffers in
deviceandconstantaddress space. - index:
An integer that represents the entry in the object shader argument table for buffers that stores a record of
bufferandoffset.
Mentioned in
Discussion
By default, the texture at each index is nil.