Instance Method

setVertexBuffers:offsets:withRange:

Sets an array of buffers for the vertex function.

Required.

Declaration

- (void)setVertexBuffers:(id<MTLBuffer>  _Nullable const *)buffers offsets:(const NSUInteger *)offsets withRange:(NSRange)range;

Parameters

buffers

An array of buffers to set in the buffer argument table.

offsets

An array of offsets, each of which specifies where the data begins, in bytes, from the start of its corresponding buffer.

range

A range of indices in the buffer argument table.

Discussion

For buffers in the device address space, align the offset to the data type consumed by the vertex function (which is always less than or equal to 16 bytes).

For buffers in the constant address space, align the offset to 256 bytes in macOS. In iOS, align the offset to the maximum of either the data type consumed by the vertex function, or 4 bytes. A 16-byte alignment is safe in iOS if you don't need to consider the data type.

See Also

Specifying Resources for a Vertex Function

- setVertexBuffer:offset:atIndex:

Sets a buffer for the vertex function.

Required.

- setVertexBufferOffset:atIndex:

Sets where the data begins in a buffer already bound to the vertex shader.

Required.

- setVertexBytes:length:atIndex:

Sets a block of data for the vertex shader.

Required.

- setVertexSamplerState:atIndex:

Sets a sampler for the vertex function.

Required.

- setVertexSamplerState:lodMinClamp:lodMaxClamp:atIndex:

Sets a sampler for the vertex function, specifying clamp values for the level of detail.

Required.

- setVertexSamplerStates:withRange:

Sets multiple samplers for the vertex function.

Required.

- setVertexSamplerStates:lodMinClamps:lodMaxClamps:withRange:

Sets multiple samplers for the vertex function, specifying clamp values for the level of detail of each sampler.

Required.

- setVertexTexture:atIndex:

Sets a texture for the vertex function.

Required.

- setVertexTextures:withRange:

Sets an array of textures for the vertex function.

Required.