APZScroll composition payloads are wrong with WebRender
Categories
(Core :: Panning and Zooming, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox85 | --- | fixed |
People
(Reporter: mstange, Assigned: mstange)
References
Details
Attachments
(5 files)
Profile: https://share.firefox.dev/3lGjOad
The APZScroll markers in this profile have end times that are likely wrong. Specifically, the second, third, fourth and fifth marker seem to end one frame too early. The markers make it look like the first and second APZScroll payload were presented by the same composite, and then there was a composite between the fifth and sixth payload that did not present any payload. But in the screenshots you can see that the composite in question did indeed have a changed scroll position.
Assignee | ||
Comment 1•4 years ago
•
|
||
Edit: this comment was confused, please ignore.
Looking at the control flow in APZCTreeManager::SampleForWebRender
, I'm not sure how the frame delay is supposed to work:
- We call
AdvanceAnimationsInternal
before we callapzc->NotifyScrollSampling()
. - During
AdvanceAnimationsInternal
, viaAdvanceAnimations
andUpdateAnimation
, we callSampleCompositedAsyncTransform
, whichmovesenqueues the current payloads frommScrollPayload
tomSampledState
. - Then we reach the call to
apzc->NotifyScrollSampling()
, whichreturns the payload that we just put intopops the oldest enqueued payload frommSampledState
. - Then we enqueue the payload associated with the current (pipeline, epoch) pair.
- When rendering is done, we look up the payload based on the rendered (pipeline, epoch) pairs.
Based on this reading I'm surprised that some of the payloads are correctly delayed.
Assignee | ||
Comment 2•4 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #1)
Oh, never mind, I missed that mSampledState
is a queue. I'll think about this some more.
Assignee | ||
Comment 3•4 years ago
|
||
I'm now thinking this might be a race between AddPendingScrollPayload
for the current frame and TakePendingScrollPayload
for the previous frame. APZ sampling for the current frame can run just before NotifyPipelineRendered for the previous frame. And if the epoch doesn't increase, there's nothing stopping the payload for the next frame to be included in the current frame's reporting.
Assignee | ||
Comment 4•4 years ago
|
||
This reduces some code duplication, and makes it clear which things we want to
do only once per window, and which things we want to do once per pipeline / CompositorBridge.
This change affects the ordering of messages, but hopefully not in a way that
anybody was relying on. Specifically, the image notifications are now sent before
the NotifyDidPaint for the root CompositorBridge is sent.
Assignee | ||
Comment 5•4 years ago
|
||
Depends on D97533
Assignee | ||
Comment 6•4 years ago
|
||
This ID allows the compositor to track per-frame information from frame
generation, through APZ sampling, to the NotifyDidRender notification.
Depends on D97534
Assignee | ||
Comment 7•4 years ago
|
||
The epoch doesn't change during pure-APZ scrolling, so we were picking up
payloads from a future composite. As a result, we were computing incorrect
latencies, when the actual latencies were in fact one frame higher.
Depends on D97535
Assignee | ||
Comment 8•4 years ago
|
||
Profile with patches: https://share.firefox.dev/3lJfHu4
Updated•4 years ago
|
Is this a (proposed) fix for bug 1658205? If so is there a test build I can try? cheers
Comment 10•4 years ago
|
||
(In reply to Mark from comment #9)
Is this a (proposed) fix for bug 1658205?
I don't believe so. This bug is about a telemetry probe related to scrolling latency sometimes reporting incorrect data.
Assignee | ||
Comment 11•4 years ago
|
||
Depends on D97536
Comment 12•4 years ago
|
||
Comment 13•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7eb45ae1b6c6
https://hg.mozilla.org/mozilla-central/rev/7f229cb74fc9
https://hg.mozilla.org/mozilla-central/rev/ea368af2bb9e
https://hg.mozilla.org/mozilla-central/rev/b89ced58eb98
https://hg.mozilla.org/mozilla-central/rev/d83351f78077
Description
•