Closed Bug 2066829 Opened 1 month ago Closed 1 month ago

One-frame magenta flash during view transitions on Asahi (snapshot sampled before it is rendered)

Categories

(Core :: Graphics: WebRender, defect)

Firefox 154
defect

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: ghwns6743, Assigned: ghwns6743)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36

Steps to reproduce:

Fedora Asahi Remix 44 (Mesa 26.1.7), Apple M1 Pro, Wayland. Reproduces on
Firefox 154 (Fedora package) and a local build of main at 1ac9c360f82e.

  1. Open a youtube.com watch page.
  2. Repeatedly click video thumbnails in sidebar.

Actual results:

The transition often starts with one frame where most or all of the viewport is magenta.

The ::view-transition-new image samples its snapshot's texture cache
entry before the snapshot has been rendered into it.
image_dependencies in frame_builder.rs is meant to order the two, but nothing reads it on current main, so the snapshot task ends up in the last pass while the
image, nested in the cross-fade's opacity/mix-blend surfaces, reads the
entry a few passes earlier.

on the frame the entry is allocated, it is uninitialized, which on AGX
reads back as magenta. Another driver may show something else there; the missing dependency is not driver-specific.

reftests/image/snapshot-dependency.yaml is meant to cover this, but it
has "filter:" where wrench expects "filters:", so the nested surfaces
are never built and the test never hits the case it was written for.
with the key fixed it fails on unpatched main.

Patch attached: read image_dependencies in prepare_image_quads and make the image's surface depend on the snapshot task, plus the "filters:" fix in the test and its reference.

Across three 90-second runs each way, I recorded 23 magenta frames without the patch and 0 with it; the wrench image reftests pass (27/27, swgl).
if that sounds reasonable, I'll put it on Phabricator once this has a number.

Expected results:

A cross-fade.

Nothing reads image_dependencies, so a snapshot's render task has no
dependents and is scheduled in the last pass, after the image that
displays it from inside an intermediate surface has already sampled the
texture cache entry. On the frame the entry is allocated it is
uninitialized.

Make the surface that displays a snapshot depend on its task, unless the
snapshot's own surface is still on the builder stack, where that would be
a cycle.

Assignee: nobody → ghwns6743
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

The test used the singular filter: key, which wrench ignores, so the image
it displays was never nested in filter surfaces and the test passed even
without the dependency.

The severity field is not set for this bug.
:gw, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(mozilla)
Severity: -- → S3
Flags: needinfo?(mozilla)

There are some r+ patches which didn't land and no activity in this bug for 1 week.
:ghwns6743, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.

Flags: needinfo?(nical.bugzilla)
Flags: needinfo?(ghwns6743)
Flags: needinfo?(nical.bugzilla)
Flags: needinfo?(ghwns6743)
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
QA Whiteboard: [qa-triage-done-c159/b158]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: