Glenn Watson 9223d06411 Bug 1757876 - Introduce command buffers between prepare <-> batch pass r=gfx-reviewers,nical
Previously, WR would recursively walk the entire picture
tree during each of the visibility, prepare and batching
passes. With this change, the prepare pass builds a tightly
packed command buffer of draw commands for each child surface
and/or picture cache tile. The batching pass now reads the
packed command buffers, meaning that no traversal of the
picture tree is required during batching.

This serves two purposes:

(1) It makes it possible to direct primitives within a
    single picture to different render tasks. This isn't
    yet used, but is a straightforward addition to how
    command buffers work. This functionality will be used
    to split primitives across render tasks where there
    are readback boundaries (e.g. backdrop-filter and also
    mix-blend-mode). The existing picture graph code ensures
    that we then optimally allocate, batch and draw pictures
    that contain these barrier style primitives.

(2) In the common case, where only a small portion of the
    scene has changed during a frame, it's a significant
    optimization to avoid another picture tree traversal.
    Instead, the batching code will only end up iterating
    small lists of the primitives that overlap the dirty
    region for the given tile / child surface.

Differential Revision: https://phabricator.services.mozilla.com/D140159
2022-03-09 19:39:28 +00:00
..