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

# setDepthClipMode(_:)

Configures how the render pipeline handles fragments outside the near and far planes of the view frustum.

## Declaration

```swift
func setDepthClipMode(_ depthClipMode: MTLDepthClipMode)
```

## Parameters

- `depthClipMode`: The mode that determines how to handle fragments outside the near and far planes.

## Discussion

Discussion You can use depth clipping to ignore fragments outside the z-axis boundaries of a viewing volume. The render pass’s default clip mode is MTLDepthClipMode.clip.

## See Also

### Configuring depth and stencil behavior

- [setDepthStencilState(_:)](metal/mtlrendercommandencoder/setdepthstencilstate(_:).md)
- [setDepthBias(_:slopeScale:clamp:)](metal/mtlrendercommandencoder/setdepthbias(_:slopescale:clamp:).md)
- [setDepthTestBounds(_:)](metal/mtlrendercommandencoder/setdepthtestbounds(_:).md)
- [setStencilReferenceValue(_:)](metal/mtlrendercommandencoder/setstencilreferencevalue(_:).md)
- [setStencilReferenceValues(front:back:)](metal/mtlrendercommandencoder/setstencilreferencevalues(front:back:).md)
