Closed Bug 1754556 Opened 2 years ago Closed 2 years ago

Update WebGPU external image resource only after present is complete

Categories

(Core :: Graphics: WebGPU, defect, P3)

defect

Tracking

()

RESOLVED FIXED
99 Branch
Tracking Status
firefox99 --- fixed

People

(Reporter: aosmond, Assigned: aosmond)

References

Details

Attachments

(1 file)

Right now we present (i.e. do a readback from the wgpu instance) only if there is a change. However we issue a resource update for the external image on every frame even so. We should fix that and hopefully get a little closer to how things should look with OffscreenCanvas.

This patch ensures that we only update the external image resource for
WebGPU when there has been an actual change for the resource. In order
to guarantee this, we wait for the present to complete, and only then
issue the update. WebRenderBridgeChild::SendResourceUpdates will also
trigger a frame generation if any resources were changed, which means we
don't need to trigger a paint on the frame itself anymore.

Note that we still have a race condition when we write into the
MemoryTextureHost while in PresentCallback, and the renderer thread may
be accessing the pixel data to upload to the GPU.

Pushed by aosmond@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/77862afef57f
Update WebGPU external image resource only after present is complete. r=kvark
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: