---
title: "setVertexAmplificationCount(_:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtl4rendercommandencoder/setvertexamplificationcount(_:)-911ja"
---

# setVertexAmplificationCount(_:)

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

## Declaration

```swift
func setVertexAmplificationCount(_ viewMappings: [MTLVertexAmplificationViewMapping])
```

## Parameters

- `viewMappings`: A Swift array of doc://com.apple.metal/documentation/Metal/MTLVertexAmplificationViewMapping elements. Each element in the array provides per-output offsets to a specific render target and viewport

## Discussion

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.

## See Also

### Configuring vertex amplification

- [setVertexAmplificationCount(_:)](metal/mtl4rendercommandencoder/setvertexamplificationcount(_:)-85tu1.md)
