<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLIndirectRenderCommand",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLIndirectRenderCommand"
  },
  "title" : "MTLIndirectRenderCommand"
}
-->

# MTLIndirectRenderCommand

A render command in an indirect command buffer.

```
protocol MTLIndirectRenderCommand : NSObjectProtocol
```

## Overview

Don’t implement this protocol; you get instances of this type by asking an [`MTLIndirectCommandBuffer`](/documentation/Metal/MTLIndirectCommandBuffer) for them.

Use this instance to reset or encode a command. You need to reset a command before encoding a new command.

## Topics

### Setting command arguments

[`setRenderPipelineState(_:)`](/documentation/Metal/MTLIndirectRenderCommand/setRenderPipelineState(_:))

Sets the render pipeline state for the command.

[`setVertexBuffer(_:offset:at:)`](/documentation/Metal/MTLIndirectRenderCommand/setVertexBuffer(_:offset:at:))

Sets a vertex buffer argument for the command.

[`setFragmentBuffer(_:offset:at:)`](/documentation/Metal/MTLIndirectRenderCommand/setFragmentBuffer(_:offset:at:))

Sets a fragment buffer argument for the command.

### Encoding a drawing command

[`drawPrimitives(_:vertexStart:vertexCount:instanceCount:baseInstance:)`](/documentation/Metal/MTLIndirectRenderCommand/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.

[`drawIndexedPrimitives(_:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:baseVertex:baseInstance:)`](/documentation/Metal/MTLIndirectRenderCommand/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.

[`drawPatches(_:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride:)`](/documentation/Metal/MTLIndirectRenderCommand/drawPatches(_:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride:))

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

[`drawIndexedPatches(_:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:controlPointIndexBuffer:controlPointIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride:)`](/documentation/Metal/MTLIndirectRenderCommand/drawIndexedPatches(_:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:controlPointIndexBuffer:controlPointIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride:))

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

### Resetting a command

[`reset()`](/documentation/Metal/MTLIndirectRenderCommand/reset())

Resets the command to its default state.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)