setViewports(_:)
Sets an array of viewports to transform vertices from normalized device coordinates to window coordinates.
Declaration
func setViewports(_ viewports: [MTLViewport])Parameters
- viewports:
A Swift array of Mtlviewport elements.
Discussion
Metal clips fragments that lie outside of the viewport, and optionally clamps fragments outside of z-near/z-far range, depending on the value you assign to setDepthClipMode(_:).
Metal selects the viewport to use from the [[ viewport_array_index ]] attribute you specify in the pipeline state’s vertex shader function in the Metal Shading Language.