---
title: clearDepth
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlrenderpassdepthattachmentdescriptor/cleardepth
---

# clearDepth

The depth to use when clearing the depth attachment.

## Declaration

```swift
var clearDepth: Double { get set }
```

## Discussion

Discussion If the loadAction property of the attachment is set to MTLLoadAction.clear, then at the start of a render pass, the GPU fills the contents of the attachment with the value stored in the clearDepth property. Otherwise, the GPU ignores clearDepth. The default value is 1.0.
