Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save munrocket/1bb8b46a4e8d5de9891800eeb065e314 to your computer and use it in GitHub Desktop.
Save munrocket/1bb8b46a4e8d5de9891800eeb065e314 to your computer and use it in GitHub Desktop.
Capturing WebGPU metal trace on MacOS
1) Clone and build WebKit
git clone https://github.com/WebKit/WebKit.git WebKit
cd WebKit
Tools/Scripts/build-webkit -cmakeargs="-DENABLE_WEBGPU_BY_DEFAULT=1" --debug
2) Run your app
__XPC_METAL_CAPTURE_ENABLED=1 Tools/Scripts/run-minibrowser --debug --url http://localhost:5000/index.html#/loaders/gsplat
3) While app is running invoke WebGPU capture from a new terminal
notifyutil -p com.apple.WebKit.WebGPU.CaptureFrame
4) File is written to HD, WebKit terminal displays the path.
5) Load the file into xcode (file open) and profit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment