Article

Seeing a Frame's Render Passes with the Dependency Viewer

View your render passes as a flow chart and inspect individual resource dependencies to understand which commands wait on others to complete.

Overview

To support Metal's multipass rendering system, use the dependency viewer to analyze frame calls and inspect your app's render passes. The dependency viewer provides a graph-based alternative to viewing your frame's instructions with the call list. Being a tree-based graph, the dependency viewer enables you to easily spot discrepancies in resource contention or identify extraneous render passes.

Open the Dependency Viewer

Access the dependency viewer within a captured Metal frame. Most commonly, you capture a Metal frame by clicking the camera button on Xcode's debug bar as covered in Performing a GPU Capture from the Debug Bar.

From the captured frame, display the call list using the steps hightlighted in Figure 1:

  1. Enable the Debug navigator.

  2. Choose View Frame By Call.

Figure 1

Viewing your frame by call.

Screenshot showing Xcode after enabling the debug navigator and choosing to view the frame by call.

Next, display the dependency viewer:

  1. Select your command buffer in the call list.

  2. Observe the dependency viewer in Xcode's center pane.

Figure 2

Examining the dependency viewer.

Screenshot showing your command buffer selected in the call list and the dependency viewer in the center pane.

Inspect your Render Passes

Use the dependency viewer to validate your app's render passes as a structured hierarchical flowchart. Because the dependency viewer can easily show multiple dependencies, it provides more information than viewing your frame in the call list alone.

The call list and dependency viewer are different ways to view the same general information, so the corresponding entry in the call list is selected automatically when you choose a render pass in the dependency viewer. See these steps highlighted in Figure 3:

  1. Click a render pass.

  2. See its corresponding entry in the call list at left select automatically.

Figure 3

A render pass selected in the call list and dependency viewer.

On the right, the dependency viewer which, when clicked, selects the corresponding entry in the call list on the left.

Visually check your render passes for completeness and conciseness. One of the benefits of the dependency viewer's visual layout is the ability to easily identify redundant or extraneous render passes that could otherwise go unnoticed in the code or call list.

Understand your Render Pass Dependencies

See your first render passes at the top of the graph, and subsequent render passes flowing downward chronologically. The layout of each pass, its lines and connections that make up the graph indicate dependencies. A pass whose line flows up to another render pass is one that depends on the completion of that pass before it can be scheduled for execution.

For example, observe in Figure 4, two passes that depend on the completion of the DownSampleBloom compute pass (1):

  • a blur pass (2).

  • a compute pass (3).

Figure 4

Render passes, at right, match the number of their entry in the call list at left.

On the right, a compute pass and blur pass require the Down Sample Bloom pass to complete as seen in the dependency viewer. Each pass's corresponding entry in the call list is shown on the left.

See Also

Frame Capture

Metal GPU Capture

Use Xcode tools or Metal API to capture a runtime snapshot of your app's Metal commands and state.

Labeling Metal Objects and Commands

Assign meaningful labels to your Metal objects and commands so you can easily identify them in the call list of a captured frame.