---
title: "setScissorRect(_:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrendercommandencoder/setscissorrect(_:)"
---

# setScissorRect(_:)

Configures a rectangle for the fragment scissor test.

## Declaration

```swift
func setScissorRect(_ rect: MTLScissorRect)
```

## Parameters

- `rect`: An doc://com.apple.metal/documentation/Metal/MTLScissorRect instance that represents a rectangle that needs to lie completely within the current render attachment.

## Discussion

Discussion The rendering pipeline discards any fragments that lie outside the scissor rectangle. The default scissor rectangle is the same size as the current render attachment, with its origin coordinates in the upper-left corner at (0, 0). note: You can change the render pass’s scissor rectangle configuration by calling this method again or by calling the setScissorRects(_:) method.

## See Also

### Configuring viewport and scissor behavior

- [setViewport(_:)](metal/mtlrendercommandencoder/setviewport(_:).md)
- [setViewports(_:)](metal/mtlrendercommandencoder/setviewports(_:).md)
- [setScissorRects(_:)](metal/mtlrendercommandencoder/setscissorrects(_:).md)
