capture_frames
Capture one or more WebGPU frames, returning command/draw/pass counts, validation errors, and optional per-pass GPU timing for performance analysis.
Instructions
Ask a connected page to capture one or more WebGPU frames, then return a summary of the resulting capture (command/draw/pass counts, object counts, validation errors, flagged issues). Use list_pages first if unsure. For a PERFORMANCE analysis, set profilePasses:true (and payloads:"none" for a light perf-only capture) to measure per-pass GPU time, then call analyze_performance — treat a performance request as implying profilePasses:true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| frames | No | Number of frames to capture (default 1). | |
| pageId | No | Page to capture from. Optional when exactly one page is connected. | |
| passType | No | Optional: only capture heavy payloads for passes of this type. | |
| payloads | No | Convenience over maxBufferSize/maxTextureSize for capturing a large frame (e.g. a full game world) without a heavy upload. "none" records only the command list, object graph and validation errors — no buffer/texture bytes — which is the fastest way to inspect draw calls, passes and pipeline usage at scale. "buffers" or "textures" keeps only that payload kind. "all" (default) keeps both, subject to the maxBufferSize/maxTextureSize caps. Explicit maxBufferSize/maxTextureSize override this. | |
| passLabel | No | Optional: only capture heavy payloads (buffers/textures) for render/compute passes whose label matches this regular expression. Greatly shrinks captures of large frames by skipping unrelated passes (shadows, IBL, post). | |
| maxBufferSize | No | Optional cap, in bytes, applied to EVERY captured buffer payload (vertex/index/storage/uniform/indirect). Buffers larger than this are truncated to the first N bytes (recorded as truncated). Default 64KB. Use -1 to disable. | |
| profilePasses | No | Inject per-pass GPU timestamp queries so each render/compute pass in the capture carries a measured GPU duration (surfaced in get_capture_summary's passes breakdown as durationMs, and as frameGpuTimeMs total). Requires the adapter to support the "timestamp-query" feature (the inspector enables it automatically when available); a no-op otherwise. Default false. Pairs well with payloads:"none" for a light perf pass. | |
| maxTextureSize | No | Optional cap, in bytes, on each captured texture's pixel data. Textures larger than this are skipped (descriptor still recorded), keeping captures light. Default 16MB. Use -1 to capture all texture data. |