Closed Bug 1886628 Opened 11 months ago Closed 11 months ago

[wpt-sync] Sync PR 45007 - Add naive implementation of `beginWebGPUAccess`.

Categories

(Core :: Graphics: Canvas2D, task, P4)

task

Tracking

()

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 45007 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/45007
Details from upstream follow.

John Stiles <johnstiles@google.com> wrote:

Add naive implementation of beginWebGPUAccess.

Explainer:
https://github.com/fserb/canvas2D/blob/master/spec/webgpu.md

This API converts a canvas' currently-displayed image to a
GPUTexture which can be used by WebGPU. At present, the current
implementation uses Snapshot(), which always clones the image.
An ideal design would avoid this copy, but this gives us a
starting point to iterate from.

We do not yet have any guards against continuing to use the
Canvas2D APIs after calling beginWebGPUAccess. This is safe
because we don't actually steal the existing texture away from
the canvas; it still has its own storage, distinct from the WebGPU
texture. Once endWebGPUAccess is implemented, it is expected
that this would clobber any canvas changes that might have
occurred during WebGPU access (as the canvas texture would be
replaced by the GPUTexture from WebGPU).

Change-Id: Ied046431fbfdfff673ae61280317f8e0931ece7e
Bug: 41490345
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5289055
Reviewed-by: Austin Eng \<enga@chromium.org>
Reviewed-by: Jean-Philippe Gravel \<jpgravel@chromium.org>
Reviewed-by: Vasiliy Telezhnikov \<vasilyt@chromium.org>
Auto-Submit: John Stiles \<johnstiles@google.com>
Commit-Queue: John Stiles \<johnstiles@google.com>
Cr-Commit-Position: refs/heads/main@{#1275839}

Component: web-platform-tests → Graphics: Canvas2D
Product: Testing → Core
The PR was not expected to affect any tests, but the try push wasn't a success. Check the try results for infrastructure issues
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b05154beb3a8 [wpt PR 45007] - Add naive implementation of `beginWebGPUAccess`., a=testonly
Test result changes from PR not available.
Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch
You need to log in before you can comment on or make changes to this bug.