Instance Method

setVertexAmplificationCount(_:viewMappings:)

Sets the number of output vertices for each input vertex, along with offsets into the layer and viewport lists.

Required.

Declaration

func setVertexAmplificationCount(_ count: Int, viewMappings: UnsafePointer<MTLVertexAmplificationViewMapping>?)

Parameters

count

The number of outputs to create.

viewMappings

An optional parameter that specifies per-output offsets into the layer and viewport lists. If you provide a value for this parameter, you must provide the same number of entries as the count you specified.

Discussion

By default, vertex amplification is not used. If you set a count greater than 1, each input vertex generates multiple output vertices (and correspondingly, each primitive becomes multiple output primitives). Typically, you use vertex amplification in conjunction with generating a render target index or viewport index inside your vertex shader, so that each output primitive is rendered to a distinct location.

If you specify view mappings, the render target index and viewport index are calculated by adding the offsets to the values provided by the vertex shader.

See Also

Configuring Vertex Amplification

struct MTLVertexAmplificationViewMapping

An offset applied to a render target index and viewport index.