---
title: "setDepthTestBounds(_:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtl4rendercommandencoder/setdepthtestbounds(_:)"
---

# setDepthTestBounds(_:)

Configures the range for depth bounds testing.

## Declaration

```swift
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

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.

## See Also

### Configuring depth and stencil behavior

- [setDepthStencilState(_:)](metal/mtl4rendercommandencoder/setdepthstencilstate(_:).md)
- [setDepthBias(_:slopeScale:clamp:)](metal/mtl4rendercommandencoder/setdepthbias(_:slopescale:clamp:).md)
- [setDepthClipMode(_:)](metal/mtl4rendercommandencoder/setdepthclipmode(_:).md)
- [setStencilReferenceValue(_:)](metal/mtl4rendercommandencoder/setstencilreferencevalue(_:).md)
- [setStencilReferenceValue(front:back:)](metal/mtl4rendercommandencoder/setstencilreferencevalue(front:back:).md)
