Closed Bug 1821233 Opened 3 years ago Closed 3 years ago

Simplify and optimize how prims are pushed to command buffers

Categories

(Core :: Graphics: WebRender, task)

task

Tracking

()

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: gw, Assigned: gw)

References

Details

(Keywords: perf-alert)

Attachments

(1 file)

No description provided.

Previously, we would do a fine-grained visibility check for
prims against the dirty rect stack (after coarse grained
tile visibility), then prepare the primitive, then determine
which command buffer(s) the prim should be added to, based
on which tile(s) the prim affects.

The patch changes this so that the fine-grained visibility
check returns a list of command buffer(s) that the prim
should be added to. This is passed to the prim prepare
step, and then used to directly add prims to the buffers
rather than checking which tiles are affected by the prim.

The motivation for doing this will become apparent in
follow up patches. We want to be able to encode
multiple command buffer commands per-prim, whereas it
was previously only possible to encode primitive
commands. By allowing prim-prepare to write directly
to the command buffers, rather than return a list of
primitive commands, we can write whatever commands
are needed. Future patches will use this to write
segment rect streams, and other information.

A side effect of this is that the tile_rect field
in the PrimitiveVisibility struct is no longer
required. This reduces the size of PrimitiveInstance
from 104 bytes to 88 bytes, which is likely to be
a reasonable performance win on pages that have
high primitive counts.

Assignee: nobody → gwatson
Status: NEW → ASSIGNED
Pushed by gwatson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b5cc339840e6 Simplify and optimize how prims are pushed to command buffers r=gfx-reviewers,lsalzman
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
Regressions: 1822548
Regressions: 1822567

Backed out for the various regressions linked to this bug. Please make sure we land tests for the various things that broke before this re-lands.
https://hg.mozilla.org/mozilla-central/rev/0c2282fe55b24b7a2020ac034f99b2e5583719f1

Status: RESOLVED → REOPENED
Flags: needinfo?(gwatson)
Resolution: FIXED → ---
Target Milestone: 113 Branch → ---
Flags: needinfo?(gwatson)

I have updated the patch with a fix for this + a wrench test for the code path that was broken.

I have verified locally that this fixes bug #1822548 however I was not able to reproduce on bug #1822567 locally.

I've pushed a try run to https://treeherder.mozilla.org/jobs?repo=try&revision=112e733aa10c920ef020e13fd2391be4cff34897 - perhaps someone who was able to reproduce bug #1822567 previously could verify that it's also fixed by a build from the try run artifacts before I try to re-land (I expect it to be the same underlying issue for both bugs)?

Flags: needinfo?(ryanvm)

Tested locally and confirmed that the patch fixes the Google docs cursor issue as well.

Flags: needinfo?(ryanvm)
Pushed by gwatson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7631604adbf7 Simplify and optimize how prims are pushed to command buffers r=gfx-reviewers,lsalzman
Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
Blocks: 1823579

(In reply to Ryan VanderMeulen [:RyanVM] from comment #4)

Backed out for the various regressions linked to this bug. Please make sure we land tests for the various things that broke before this re-lands.
https://hg.mozilla.org/mozilla-central/rev/0c2282fe55b24b7a2020ac034f99b2e5583719f1

== Change summary for alert #37696 (as of Fri, 17 Mar 2023 13:59:43 GMT) ==

Regressions:

Ratio Test Platform Options Absolute values (old vs new)
5% instagram LastVisualChange windows10-64-shippable-qr fission warm webrender 602.75 -> 630.92

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=37696

Regressions: 1823648

Looking at the graph in [1] it seems like this change is within the noise level for that test, if I'm reading it correctly?

[1] https://treeherder.mozilla.org/perfherder/graphs?highlightAlerts=1&highlightChangelogData=1&highlightCommonAlerts=0&series=autoland,3870277,1,13&timerange=5184000

== Change summary for alert #37723 (as of Wed, 22 Mar 2023 17:26:40 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
4% displaylist_mutate windows10-64-shippable-qr e10s fission stylo webrender 2,487.08 -> 2,389.82
4% displaylist_mutate windows10-64-shippable-qr e10s fission stylo webrender 2,489.13 -> 2,396.38

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=37723

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: