makeArgumentEncoder(bufferIndex:)
Creates an argument encoder for an argument buffer that’s one of this function’s arguments.
Declaration
func makeArgumentEncoder(bufferIndex: Int) -> any MTLArgumentEncoderParameters
- bufferIndex:
The index of an argument buffer in the function’s argument list. This method fails if the specified index doesn’t correspond to an argument buffer.
Discussion
Resources encoded into an argument buffer by the MTLArgumentEncoder object need to match the structure of the argument buffer located at the specified buffer index. If you want to interpret a regular structure as an argument buffer, at least one of the members of the structure needs to have an [[id(n)]] attribute.