Skip to content

Add JS binding for wgpu's start_capture and stop_capture #26766

Open
@jowens

Description

I would like to use Deno to profile WebGPU compute workloads within Xcode without any need for graphics. Currently, to capture a Metal trace within Xcode for a Deno workload, I'm having to create a window and canvas, invoke my compute workload, and then present the canvas, and then I can (manually) capture the Metal layer and see my compute-workload profile. This is not ideal; I don't want or need graphics at all. I'd like to do this at the command line and/or completely headless.

I believe I can do this if I have JS bindings to the wgpu calls start_capture and stop_capture. With JS bindings to those calls, I can then start and stop capture around my compute workload, then run within Xcode and see profile information.

What would make this even better is if I could write that trace to a file (and this was exposed in JS). Metal has a MTLCaptureManager and gfx-rs/wgpu#3504 appears relevant here.

Also please note gfx-rs/wgpu#6255, which notes Metal backend device capture issues in wgpu.

cc: @raphlinus

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions