Open Bug 1708020 Opened 4 years ago Updated 7 months ago

Remove an extra copy from WebGPU software presentation path

Categories

(Core :: Graphics: WebGPU, enhancement, P5)

enhancement

Tracking

()

People

(Reporter: kvark, Unassigned)

References

(Blocks 1 open bug)

Details

The current presentation logic is described in https://phabricator.services.mozilla.com/D113172
We are doing these steps:

  1. render to texture
  2. copy from texture to buffer (in a ring of buffers)
  3. map that buffer, copy into the TextureHost
  4. WR locks the texture host and uploads the data on GPU

We could get rid of one of these copies by making the TextureHost actually access the mapped buffers, instead of keeping its own storage.
While discussing this with Andrew, we found two different ways to get there:

  • Have our own TextureHost class that knows about the ring of buffers and can look into the right buffer when returning contents.
  • Associate each buffer in a ring with a separate external image ID. Then we'd send a command from the compositor thread to WR, which would switch the image key to the next external image ID (corresponding to the last buffer that got read). The tricky aspect of this is that we'd be sending messages from the compositor, while all other messages to WR come from the content process.
Severity: -- → S3
Depends on: webgpu-v1
Priority: -- → P3
Depends on: webgpu-perf
No longer depends on: webgpu-v1
Blocks: webgpu-perf
No longer depends on: webgpu-perf

I think this has been obviated by the new download-free presentation path.

P5 for performance.

Priority: P3 → P5
No longer blocks: webgpu-triage
You need to log in before you can comment on or make changes to this bug.