<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLRenderCommandEncoder/setScissorRect(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLRenderCommandEncoder(im)setScissorRect:"
  },
  "title" : "setScissorRect(_:)"
}
-->

# setScissorRect(_:)

Configures a rectangle for the fragment scissor test.

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

## Parameters

`rect`

An [`MTLScissorRect`](/documentation/Metal/MTLScissorRect) instance that represents a rectangle that needs to lie completely within the current render attachment.

## 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 ``doc://com.apple.metal/documentation/Metal/MTLRenderCommandEncoder/setScissorRects(_:)`` method.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)