Metal debugger
Debug and profile your Metal workload with a GPU trace.
Overview
The Metal debugger consists of a suite of tools for debugging and profiling your Metal app.
Unlike pausing at breakpoints during runtime, you can capture your Metal workload for multiple frames and then jump back and forth in time to explore the captured work. The Metal debugger enables you to explore the dependencies between passes, and offers insights for improving the performance of your app. You can also debug your shaders in draw commands and compute dispatches to fix sources of artifacts (see Investigating visual artifacts).
In addition, the Metal debugger displays your Metal workload on a profiling timeline and offers detailed statistics like performance counters and per-line shader profiling data. These tools can help you identify and eliminate performance bottlenecks in your app (see Optimizing GPU performance).
[Image]
For additional information about the Metal debugger, see the following video sessions:
Topics
Essentials
Capturing a Metal workload in XcodeCapturing a Metal workload programmaticallyReplaying a GPU trace fileInvestigating visual artifactsOptimizing GPU performance
Metal workload analysis
Analyzing your Metal workloadAnalyzing resource dependenciesAnalyzing memory usageAnalyzing Apple GPU performance using a visual timelineAnalyzing Apple GPU performance using counter statisticsAnalyzing Apple GPU performance with performance heat mapsAnalyzing Apple GPU performance using the shader cost graphAnalyzing non-Apple GPU performance using counter statistics
Metal resource inspection
Inspecting acceleration structuresInspecting buffersInspecting pipeline statesInspecting sampler statesInspecting shadersInspecting textures
Metal command analysis
Inspecting the bound resources for a commandInspecting the geometry of a draw commandInspecting the attachments of a draw commandDebugging the shaders within a draw command or compute dispatchAnalyzing draw command and compute dispatch performance with GPU countersAnalyzing draw command and compute dispatch performance with pipeline statistics