---
title: "generateDilatedDepth(from:commandBuffer:)"
framework: arkit
role: symbol
role_heading: Instance Method
path: "arkit/armattegenerator/generatedilateddepth(from:commandbuffer:)"
---

# generateDilatedDepth(from:commandBuffer:)

Generates dilated depth at the resolution of the segmentation stencil.

## Declaration

```swift
func generateDilatedDepth(from frame: ARFrame, commandBuffer: any MTLCommandBuffer) -> any MTLTexture
```

## Return Value

Return Value A dilated depth texture which consists of a single channel of type float32.

## Discussion

Discussion You use the linear depth information this function provides when compositing a virtual object with the camera image.
