<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLCaptureScope",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLCaptureScope"
  },
  "title" : "MTLCaptureScope"
}
-->

# MTLCaptureScope

A type that can programmatically customize a GPU frame capture.

```
protocol MTLCaptureScope : NSObjectProtocol
```

## Overview

Each capture scope instance configures what a frame capture records and methods
that programmatically start and stop recording data.

Filter the commands a frame capture records by selecting specific sources with a capture scope.
By contrast, the default capture scope records all the data for a single frame when you
click the Capture GPU workload button in the debug bar in Xcode.
You can choose which data Metal records during a frame capture by creating your own capture scope.

You can program exactly which Metal commands to record in a frame capture by calling
the [`begin()`](/documentation/Metal/MTLCaptureScope/begin()) and [`end()`](/documentation/Metal/MTLCaptureScope/end()) methods around the Metal calls you want the capture to include.
In the case of a rendering loop, your calls to [`begin()`](/documentation/Metal/MTLCaptureScope/begin()) and [`end()`](/documentation/Metal/MTLCaptureScope/end()) can capture a small part of a frame,
or capture data from multiple frames.

For more information about frame captures and capture scopes,
see <doc://com.apple.documentation/documentation/Xcode/Metal-debugger>
and <doc://com.apple.documentation/documentation/Xcode/Metal-developer-workflows>, respectively.

## Topics

### Defining capture scope boundaries

[`begin()`](/documentation/Metal/MTLCaptureScope/begin())

Tells Metal to begin recording command information.

[`end()`](/documentation/Metal/MTLCaptureScope/end())

Tells Metal to stop recording command information.

### Identifying the capture scope

[`label`](/documentation/Metal/MTLCaptureScope/label)

A string that helps you identify the capture scope.

[`device`](/documentation/Metal/MTLCaptureScope/device)

The device object from which you created the capture scope.

[`commandQueue`](/documentation/Metal/MTLCaptureScope/commandQueue)

The command queue that this capture scope uses to limit which commands are recorded.



---

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)