stepFunction
The circumstances under which the vertex and its attributes are presented to the vertex function.
Declaration
var stepFunction: MTLVertexStepFunction { get set }Discussion
The default value is MTLVertexStepFunction.perVertex.
If stepFunction is MTLVertexStepFunction.perVertex, the function fetches new attribute data based on the [[ vertex_id ]] attribute qualifier. The function fetches new attribute data each time a new vertex is processed. In this case, stepRate needs to be set to 1, which is its default value.
If stepFunction is MTLVertexStepFunction.perInstance, the function fetches new attribute data based on the [[ instance_id ]] attribute qualifier. In this case, stepRate needs to be greater than 0 and its value determines how often the function fetches new attribute data.
If stepFunction is MTLVertexStepFunction.constant, the function fetches attribute data just once, and that attribute data is used for every vertex. In this case,stepRate needs to be set to 0.
See Also
Related Documentation
- Metal Shading Language Guide
- Metal Programming Guide