Instance Method

setScissorRect(_:)

Sets the scissor rectangle for a fragment scissor test.

Required.

Declaration

func setScissorRect(_ rect: MTLScissorRect)

Parameters

rect

The scissor rectangle used for a fragment scissor test.

Discussion

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.

Required.

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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software