Instance Method


Sets the scissor rectangle for a fragment scissor test.



func setScissorRect(_ rect: MTLScissorRect)



The scissor rectangle used for a fragment scissor test.


The scissor rectangle must lie entirely within the current attachment. The rendering pipeline discards fragments that lie outside the scissor rectangle.

The default value is (0, 0, width, height), where width and height are the x and y dimensions of the attachment, respectively.

Calling setScissorRect(_:) after calling setScissorRects(_:count:), and vice versa, overrides previously set scissor rectangles.

See Also

Setting Viewport and Scissor Behavior

Rendering to Multiple Viewports in a Draw Command

Select viewports and their corresponding scissor rectangles in your vertex shader.

func setViewport(MTLViewport)

Sets the viewport used for transformations and clipping.


func setViewports([MTLViewport])

Sets an array of viewports.

func setScissorRects([MTLScissorRect])

Sets an array of scissor rectangles.

struct MTLViewport

A 3D rectangular region for the viewport clipping.

struct MTLScissorRect

A rectangle for the scissor fragment test.