Canvases presented through ImageBridge can stop updating, or be missing from compositor snapshots, while a remote texture is pending
Categories
(Core :: Graphics, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: aosmond, Assigned: aosmond)
References
(Blocks 1 open bug)
Details
Attachments
(3 external files)
Async image hosts (WebRenderImageHost with an async ref, used by OffscreenCanvas and WebGPU presenting through ImageBridge) only show a remote texture once its ready check completes. That pending ready check can be lost, can go stale, or is not waited on:
-
RemoteTextureMap::SuppressRemoteTextureReadyCheckis called when queued WebRender transactions are flushed without waiting, for example when a WebRender bridge is torn down. It drops every pending ready check waiting for an unregistered owner, including checks made by unrelated image hosts. Those hosts are never called back and keepmWaitingReadyCallbackset, soUseRemoteTextureignores all later textures and the canvas stops updating. -
WebRenderImageHostdoes not keep its ready check in sync with its pending textures. Clearing the pending textures does not always resetmWaitingReadyCallback, and a ready callback for an owner that went away is treated as obsolete, leaving the host waiting. -
WebRenderBridgeParent::RecvGetSnapshot, which the reftest and WPT harnesses use for their screenshots, does not wait for pending ready checks. A snapshot taken after a frame was sent, but before its ready callback ran, shows the previous frame or nothing. This is a possible cause of the remaining failures in bug 1788351, after the test change in bug 2092395.
Proposed fix:
- Replace
SuppressRemoteTextureReadyCheckwithCancelRemoteTextureReadyCheck, which only cancels the checks made by the caller. - Track
WebRenderImageHost's pending ready check by generation, cancel it when the pending textures are cleared, and check again on any callback. - When taking a compositor snapshot, wait for the newest pending remote texture of each async image pipeline, use it, and generate a frame before flushing.
| Assignee | ||
Comment 1•5 days ago
|
||
SuppressRemoteTextureReadyCheck dropped every pending ready check waiting
for an unregistered owner, including those of other image hosts, which
would then never be woken. Cancel only the caller's own checks, and
release them after the call since they may hold the last reference to the
caller.
| Assignee | ||
Comment 2•5 days ago
|
||
Clearing the pending remote textures did not reset mWaitingReadyCallback,
so the host could ignore every later texture, and a ready callback for an
owner that went away was treated as obsolete and left it waiting. Track
the pending ready check by generation instead of by owner, cancel it when
the pending textures are cleared, and check again on any callback.
| Assignee | ||
Comment 3•5 days ago
|
||
Remote textures presented via ImageBridge are only shown once their ready
check completes, so a snapshot taken in the meantime, such as for a reftest,
could miss the latest frame or show nothing at all.
Comment 5•3 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/2eda5a850c09
https://hg.mozilla.org/mozilla-central/rev/a269f04d98bf
https://hg.mozilla.org/mozilla-central/rev/d82261fb103f
Description
•