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:) overrides previously set scissor rectangles, and vice versa.

See Also

Setting Viewport and Scissor Behavior

func setViewport(MTLViewport)

Sets the viewport used for transformations and clipping.

Required.

func setViewports([MTLViewport])

Sets an array of viewports.

struct MTLViewport

A 3D rectangular region for the viewport clipping.

struct MTLScissorRect

A rectangle for the scissor fragment test.