<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTL4RenderCommandEncoder/setDepthTestBounds(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:So24MTL4RenderCommandEncoderP5MetalE18setDepthTestBoundsyySNySfGF"
  },
  "title" : "setDepthTestBounds(_:)"
}
-->

# setDepthTestBounds(_:)

Configures the range for depth bounds testing.

```
func setDepthTestBounds(_ bounds: ClosedRange<Float>)
```

## Parameters

`bounds`

A closed range the renderer applies to depth bounds testing.
The renderer discards fragments with a stored depth that is outside `bounds`.

## Discussion

The render command encoder disables depth bounds testing by default.
The render command encoder also disables depth bounds testing when the `bounds` property equals `0.0...1.0`.
`bounds.lowerBound` needs to be greater than or equal to `0.0`.
`bounds.upperBound` needs to be less than or equal to `1.0`.

---

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)