---
title: depthStencilPixelFormat
framework: metalkit
role: symbol
role_heading: Instance Property
path: metalkit/mtkview/depthstencilpixelformat
---

# depthStencilPixelFormat

The format used to generate the depthStencilTexture object.

## Declaration

```swift
var depthStencilPixelFormat: MTLPixelFormat { get set }
```

## Discussion

Discussion The default value is MTLPixelFormat.invalid, which means that the view doesn’t create a depth and stencil texture. If you set it to a different format, the view automatically creates those textures for you and configures them as part of any render passes that the view creates.

## See Also

### Configuring the Render Target Properties

- [depthStencilAttachmentTextureUsage](metalkit/mtkview/depthstencilattachmenttextureusage.md)
- [clearDepth](metalkit/mtkview/cleardepth.md)
- [clearStencil](metalkit/mtkview/clearstencil.md)
