Closed Bug 1410030 Opened 8 years ago Closed 5 years ago

The background is cleared twice.

Categories

(Core :: Graphics: WebRender, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
Tracking Status
firefox57 --- unaffected
firefox58 --- unaffected

People

(Reporter: nical, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [gfx-noted])

If the the background of the page is a solid color, we should use the clear color of the set_display_list call instead of emitting a big rectangle. This would let us avoid touching a lot of fragments twice which amounts to a lot of overdraw.
It should be noted that we have both a non-scrolled background color and a scrolled background color for most pages. The non-scrolled background color is in the back and is what is shown during checkerboarding, when the scrolled background color is clipped to the display port and doesn't cover the whole window.
Whiteboard: [wr-mvp][triage][gfx-noted] → [gfx-noted]

Does this still happen? Do we care?

Flags: needinfo?(nical.bugzilla)

I just looked at this in renderdoc and when rendering a github issue, we have 4 quads more or less the size of the screen that are fully occluded as far as I can tell (that is, looking at the view that shows the fragments that are rejected by the depth test with batching disabled).

IIRC, Dzmitry's tool that estimates the cost of depth-rejected primitives taught us that we pay on average 7% of the cost of a full screen rect in GPU time if it is completely depth rejected, which is not negligible for a full screen rect (not sure how much of that cost is memory bandwidth vs other things).

I think that we should care. Nothing blocking, but this is an area to look into when working on performance.

Flags: needinfo?(nical.bugzilla)

I count 5 full screen (or almost) occluded quads on this bugzilla page.

Worth looking again?

Blocks: wr-perf
No longer blocks: stage-wr-next
Flags: needinfo?(nical.bugzilla)

Picture caching makes things a bit better because the chrome tiles that are fully occluded are discarded without being drawn. We still get a lot of overdraw in the areas near the top (and the scroll bars? not sure what's going on there) from a glance at a renderdoc trace, we composite large rectangular tiles for these parts, most of which being z-rejected.

When tiles are rendered from scratch we also pay for clearing + drawing a solid background, but this cost is amortized by retaining the tiles and (hopefully) not invalidating all of the tiles every frame.

Wherever picture caching is disabled we still pay a few screen-fulls of z-rejected overdraw every frame.

Flags: needinfo?(nical.bugzilla)

This is resolved now. WR will take the background color as the clear color where possible, and will occlude background tiles where possible.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.