---
title: MTLPixelFormat.depth24Unorm_stencil8
framework: metal
role: symbol
role_heading: Case
path: metal/mtlpixelformat/depth24unorm_stencil8
---

# MTLPixelFormat.depth24Unorm_stencil8

A 32-bit combined depth and stencil pixel format with a 24-bit normalized unsigned integer for depth and an 8-bit unsigned integer for stencil.

## Declaration

```swift
case depth24Unorm_stencil8
```

## Discussion

Discussion To blit either the depth or stencil information to a Metal buffer, call the copy(from:sourceSlice:sourceLevel:sourceOrigin:sourceSize:to:destinationOffset:destinationBytesPerRow:destinationBytesPerImage:options:) method, specifying the blit options for which part you want to copy. You need to provide space for 4 bytes per pixel in your destination buffer. When Metal copies the data, it sets the bottom 3 bytes of each pixel to the depth data and sets the top byte to arbitrary data. Ignore any data stored in the top byte of each pixel.

## See Also

### Depth and stencil pixel formats

- [MTLPixelFormat.depth16Unorm](metal/mtlpixelformat/depth16unorm.md)
- [MTLPixelFormat.depth32Float](metal/mtlpixelformat/depth32float.md)
- [MTLPixelFormat.stencil8](metal/mtlpixelformat/stencil8.md)
- [MTLPixelFormat.depth32Float_stencil8](metal/mtlpixelformat/depth32float_stencil8.md)
- [MTLPixelFormat.x32_stencil8](metal/mtlpixelformat/x32_stencil8.md)
- [MTLPixelFormat.x24_stencil8](metal/mtlpixelformat/x24_stencil8.md)
