View your render passes as a flow chart and inspect individual resource dependencies to understand which commands wait on others to complete.
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. For more ways to capture a
Metal frame, see Metal GPU Capture.
From the captured frame, display the call list using the steps hightlighted in :
Enable the Debug navigator.
Choose View Frame By Call.
Next, display the dependency viewer, as shown in Figure 2:
Select your command buffer in the call list.
Observe the dependency viewer in Xcode's 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:
Click a render pass.
See its corresponding entry selected automatically in the call list at 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. For each pass in the graph, the layout, lines, and connections 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
Down compute pass (1):
A blur pass (2)
A compute pass (3)