<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTL4RenderCommandEncoder/setVertexAmplificationCount:viewMappings:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTL4RenderCommandEncoder(im)setVertexAmplificationCount:viewMappings:"
  },
  "title" : "setVertexAmplificationCount:viewMappings:"
}
-->

# setVertexAmplificationCount:viewMappings:

Sets the vertex amplification count and its view mapping for each amplification ID.

```
- (void) setVertexAmplificationCount:(NSUInteger) count viewMappings:(const MTLVertexAmplificationViewMapping *) viewMappings;
```

## Parameters

`count`

The number of outputs to create. The maximum value is `2`.

`viewMappings`

Array of [`MTLVertexAmplificationViewMapping`](/documentation/Metal/MTLVertexAmplificationViewMapping) instances. Each instance provides
per-output offsets to a specific render target and viewport.

## Discussion

Each view mapping element describes how to route the corresponding amplification ID to a specific viewport and
render target array index by using offsets from the base array index provided by the `[[ render_target_array_index ]]`
and/or `[[ viewport_array_index ]]` output attributes in the vertex shader. This allows Metal to route each amplified
vertex to a different `[[ render_target_array_index ]]` and `[[ viewport_array_index ]]`, even though you can’t
directly amplify these attributes.

---

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)