An object that defines custom boundaries for a GPU frame capture.
- iOS 11.0+
- macOS 10.13+
- Mac Catalyst 13.0+Beta
- tvOS 11.0+
A capture scope works with Metal’s frame capture feature to filter a captured frame to include the specific commands that you choose. By contrast, when you capture a frame with the default capture scope by clicking the camera button on Xcode’s debug bar, the resulting capture includes all the data from a single frame. You create your own capture scope when you want to choose which data Metal should record.
To determine exactly which Metal commands to record in a captured frame, call
end() around the Metal calls you want the capture to include. In the case of a rendering loop, your calls to
end() can capture a small part of a frame, or capture data across multiple frames.
You can use capture scopes in a few different ways:
You can change Xcode’s default capturing behavior.
In Xcode, you can add additional capture scopes that appear when you click and hold the camera button on the debug bar.
You can programmatically trigger a capture session using a specific scope.