Interleave frame building and command submission
Categories
(Core :: Graphics: WebRender, enhancement, P3)
Tracking
()
People
(Reporter: nical, Unassigned)
References
(Blocks 1 open bug)
Details
On some configurations, especially slow-ish CPUs with ANGLE, we spend a lot of time on the renderer thread and only start that work after we are done scene building.
To get a better chance of meeting the frame budget it would be better to start submitting work earlier while doing frame building.
Unfortunately the way frame building is organized we first do a visibility pass on everything, then prepare all primitives, then build all of the batches, so we know about all of the drawing commands towards the end of the frame building process.
In the short term one of the most actionable item could be to send texture uploads earlier. We know that they have a lot of CPU overhead for many configurations, so sending them to the renderer thread before the end of frame building should help.
Longer term, it would be nice to be able to better split between various chunks of work, for example do the visibility, prepare and batching passes somewhat independently per picture or render target, so that we can give the renderer draw calls to submit earlier while we still have a sizeable amount of work left to do in frame building.
In the even longer term we'll likely want to get rid of the renderer thread thanks to vulkan and friends via gfx-rs, but being able to submit GPU work earlier during the frame will still be very valuable.
Description
•