Use span buffer for SWGL depth testing
Categories
(Core :: Graphics: WebRender, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: lsalzman, Assigned: lsalzman)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Most of the pages we render in SWGL have large rectangular areas of opaque pixels that become expensive to depth test at higher resolutions, even with a 16bpp Z-buffer. This often shows up in profiles where we spend a significant amount of time just churning through the Z-buffer rejecting pixels for a whole-page background that is occluded by other div backgrounds. On hardware, this is generally not a problem since it is has a lot more throughput and usually from form of hierarchical Z-buffer. However, in SWGL, we're stuck checking all the samples, which even with SIMD comparisons and careful packing of depth samples (8 per SIMD register), turns out to at least be a potential bottleneck.
Given that unlike in a true 3D scene, we don't have a lot of depth complexity or small awkwardly shaped triangles, it would make sense to use some form of span buffering so that we could depth test entire spans of pixels all at once, regardless of the actual resolution of the screen. This would move the algorithmic complexity away from the amount of pixels on the screen instead towards the actual complexity of the page and the number of spans required to represent it which should scale much better for actual web pages.
We still, however, need to support perspective-correct rasterization too for anything that uses a 3D transform, so SWGL ideally needs to support a mixed-mode way of using the depth buffer that can both deal with a span buffer for simple cases, and flat depth samples when we suddenly need to deal with a 3D transform with varying depth per sample.
Assignee | ||
Comment 1•4 years ago
|
||
Comment 3•4 years ago
|
||
bugherder |
Description
•