Structure

MTLDrawPrimitivesIndirectArguments

The data layout required for drawing primitives via indirect buffer calls.

Declaration

struct MTLDrawPrimitivesIndirectArguments

Overview

Topics

Initializers

init()

Returns a new data layout for drawing primitives via indirect buffer calls.

init(vertexCount: UInt32, instanceCount: UInt32, vertexStart: UInt32, baseInstance: UInt32)

Returns a new data layout for drawing primitives via indirect buffer calls, with specified parameters.

Instance Properties

var baseInstance: UInt32

The first instance to draw.

var instanceCount: UInt32

The number of instances to draw.

var vertexCount: UInt32

The number of vertices to draw.

var vertexStart: UInt32

The first vertex to draw.

See Also

Drawing Geometric Primitives and Tessellated Patches Indirectly

Specifying Drawing and Dispatch Arguments Indirectly

Use indirect commands if you don't know your draw or dispatch call arguments when you encode the command.

func drawPrimitives(type: MTLPrimitiveType, indirectBuffer: MTLBuffer, indirectBufferOffset: Int)

Encodes a command to render a number of instances of primitives using vertex data in contiguous array elements, starting from a base instance.

Required.

func drawIndexedPrimitives(type: MTLPrimitiveType, indexType: MTLIndexType, indexBuffer: MTLBuffer, indexBufferOffset: Int, indirectBuffer: MTLBuffer, indirectBufferOffset: Int)

Encodes a command to render a number of instances of primitives using index data in contiguous array elements, starting from the base vertex of a base instance.

Required.

func drawPatches(numberOfPatchControlPoints: Int, patchIndexBuffer: MTLBuffer?, patchIndexBufferOffset: Int, indirectBuffer: MTLBuffer, indirectBufferOffset: Int)

Encodes a command to render a number of instances of tessellated patches, using an indirect buffer.

Required.

struct MTLDrawIndexedPrimitivesIndirectArguments

The data layout required for drawing indexed primitives via indirect buffer calls.

struct MTLDrawPatchIndirectArguments

The data layout required for drawing patches via indirect buffer calls.