Closed Bug 1661427 Opened 4 years ago Closed 4 years ago

Allow SWGL SwCompositor to split up compositing work between SwComposite and render threads

Categories

(Core :: Graphics: WebRender, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: lsalzman, Assigned: lsalzman)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The render thread currently blocks on the calling thread waiting for composition to finish on the SwComposite thread. Given that SWGL rasterization has completed by then and the renderer thread has nothing to do, it would make more sense to donate it to finishing the composition jobs instead of simply blocking.

This requires keeping a dependency graph of available jobs so that we can track job availability for the job queue across multiple threads.

Further, for large jobs like fullscreen video, we need some useful way of partitioning the job into smaller sections that multiple threads can participate in. Given that SWGL is span-oriented rather than tile-oriented, it makes most sense to split up work into horizontal bands that can be parceled out to threads as needed.

To preserve the scaling ratios supplied to the SWGL composite routines in integer coordinates, this requires adding band clipping parameters so as not to disturb the other parameters that specify the scaling, so SWGL has been extended as such.

The concurrency has been cleaned up to use crossbeam from webrender_api rather than mpsc.

The webrender compositor API needs to be slightly extended with a "start_compositing" hook. We need to know that all add_surface calls have finished for this frame before any subsequent bind/end_frame calls. This allows for the dependency graph to be built up completely as add_surface calls come in, after which when start_compositing is called we know we can safely queue compositing jobs because all dependencies have been fully accounted for.

This seems to gain us quite noticeable speedups on basic_compositor_video.

Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b99610a6833f Allow SWGL SwCompositor to split up compositing work between SwComposite and render threads. r=mattwoodrow
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
Flags: needinfo?(lsalzman)
Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6005986e1bce Allow SWGL SwCompositor to split up compositing work between SwComposite and render threads. r=mattwoodrow
Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
Regressions: 1679585
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: