Instance Method

drawIndexedPatches:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:controlPointIndexBuffer:controlPointIndexBufferOffset:instanceCount:baseInstance:

Encodes a command to render a number of instances of tessellated patches, using a control point index buffer.

Required.

Declaration

- (void)drawIndexedPatches:(NSUInteger)numberOfPatchControlPoints patchStart:(NSUInteger)patchStart patchCount:(NSUInteger)patchCount patchIndexBuffer:(id<MTLBuffer>)patchIndexBuffer patchIndexBufferOffset:(NSUInteger)patchIndexBufferOffset controlPointIndexBuffer:(id<MTLBuffer>)controlPointIndexBuffer controlPointIndexBufferOffset:(NSUInteger)controlPointIndexBufferOffset instanceCount:(NSUInteger)instanceCount baseInstance:(NSUInteger)baseInstance;

Parameters

numberOfPatchControlPoints

The number of control points per patch. This value must be between 0 and 32, inclusive.

patchStart

The patch start index.

patchCount

The number of patches in each instance.

patchIndexBuffer

A buffer that contains indices to patches.

patchIndexBufferOffset

The byte offset within patchIndexBuffer to start reading indices from.

controlPointIndexBuffer

A buffer that contains indices to the control points of a patch.

controlPointIndexBufferOffset

The byte offset within controlPointIndexBuffer to start reading indices from.

instanceCount

The number of instances to draw.

baseInstance

The first instance to draw.

Discussion

When a draw command is encoded, any necessary references to rendering state or resources previously set on the encoder are recorded as part of the command. After encoding a command, you can safely change the encoding state to set up parameters needed to encode other commands.

See Also

Drawing Geometric Primitives and Tessellated Patches

- drawPrimitives:vertexStart:vertexCount:instanceCount:baseInstance:

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

Required.

- drawPrimitives:vertexStart:vertexCount:instanceCount:

Encodes a command to render a number of instances of primitives using vertex data in contiguous array elements.

Required.

- drawPrimitives:vertexStart:vertexCount:

Encodes a command to render one instance of primitives using vertex data in contiguous array elements.

Required.

- drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:baseVertex:baseInstance:

Encodes a command to render a number of instances of primitives using an index list specified in a buffer, starting from the base vertex of the base instance.

Required.

- drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:

Encodes a command to render a number of instances of primitives using an index list specified in a buffer.

Required.

- drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:

Encodes a command to render one instance of primitives using an index list specified in a buffer.

Required.

- drawPatches:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:

Encodes a command to render a number of instances of tessellated patches.

Required.

MTLPrimitiveType

The geometric primitive type for drawing commands.

MTLIndexType

The index type for an index buffer that references vertices of geometric primitives.

MTLQuadTessellationFactorsHalf

The per-patch tessellation factors for a quad patch.

MTLTriangleTessellationFactorsHalf

The per-patch tessellation factors for a triangle patch.