<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalKit",
  "identifier" : "/documentation/MetalKit/MTKView/clearDepth",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "MetalKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MTKView(py)clearDepth"
  },
  "title" : "clearDepth"
}
-->

# clearDepth

The depth value to use to clear the depth target when creating a render pass descriptor.

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

## Discussion

If you specified that you want a depth texture, the view configures any render passes to use the depth texture, with a load action of <doc://com.apple.documentation/documentation/Metal/MTLLoadAction/clear> and the value of this property as the value to clear it to. The default value is `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)