---
title: captureObject
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlcapturedescriptor/captureobject
---

# captureObject

The instance whose contents should be captured.

## Declaration

```swift
var captureObject: Any? { get set }
```

## Discussion

Discussion The default value is nil, but you need to set an instance before using this descriptor to start a capture session. The behavior of the capture session depends on the kind of instance being captured: Specify an MTLDevice instance to capture commands in command buffers created on any command queues created by the device instance. Specify an MTLCommandQueue instance to capture commands in command buffers created by a specific command queue. Specify an MTLCaptureScope instance to indirectly define which commands are captured.

## See Also

### Setting capture parameters

- [destination](metal/mtlcapturedescriptor/destination.md)
- [outputURL](metal/mtlcapturedescriptor/outputurl.md)
