Open Bug 1937100 Opened 8 months ago Updated 2 months ago

Content stutters from `CommandEncoder` and `ComputePipeline` DOM object destruction in `Marching Cubes` example from official WebGPU samples

Categories

(Core :: Graphics: WebGPU, defect)

defect

Tracking

()

ASSIGNED

People

(Reporter: ErichDonGubler, Assigned: teoxoy)

References

(Blocks 1 open bug, )

Details

Steps to reproduce

  1. Open https://webgpu.github.io/webgpu-samples/?sample=marchingCubes. Observe that while the demo runs, occasional stutter on the order of a hundred milliseconds occurs, interrupting multiple render frames.

Originally found while re-triaging bug 1806659.

FYI we had a similar issue in Chromium on GC because many GPUCommandBuffers get released at once, which all have O(commands) cost to that. The solution was to eagerly destroy them after submit (they are consumed even if the submit is an error for that reason IIRC).

We do consume the content of command buffers on submit, so it's probably something else.

IIRC Firefox uses content-side tracking of objects used by the command buffers. So even if the command buffers are consumed on submit on the GPU process side, if they aren't on the content-process, it could cause stutters.

Good point, we do hold references to objects https://searchfox.org/mozilla-central/rev/04a2c5317c0af560ed1689304498416c9c6c485a/dom/webgpu/RenderPassEncoder.h#56-60 that we don't clear on encoder.end().

Summary: Content stutters from `CommandEncoder` and `ComputePipeline` DOM object destruction in `Marching Cubes example from official WebGPU samples → Content stutters from `CommandEncoder` and `ComputePipeline` DOM object destruction in `Marching Cubes` example from official WebGPU samples
See Also: → 1963161
Depends on: 1968102
Depends on: 1968122
Assignee: nobody → ttanasoaia
Status: NEW → ASSIGNED
No longer depends on: 1968102
See Also: → 1962753

With the shader cache https://github.com/gfx-rs/wgpu/pull/7729 the sample runs a lot smoother with occasional hitches due to GC, see https://share.firefox.dev/3FubZUh.

Based on the new profile I don't think this needs to be blocked on Bug 1968122 anymore.

No longer depends on: 1968122
No longer blocks: webgpu-official-samples
See Also: → 1969834
You need to log in before you can comment on or make changes to this bug.