Closed Bug 1403857 Opened 7 years ago Closed 7 years ago

Dark red clear color misses fast clear optimization

Categories

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

enhancement

Tracking

()

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

People

(Reporter: nical, Assigned: nical)

References

Details

(Whiteboard: [wr-mvp] [gfx-noted])

Attachments

(1 file)

We are clearing the widget's background color with a dark red (0.3, 0.0, 0.0, 1.0) color. On some GPUs (intel ones in particular), clearing with transparent black or opaque white is a lot faster than any other color because it consists in mostly flipping a single flag instead of clearing all of the bits in the framebuffer.

See:
https://searchfox.org/mozilla-central/rev/f54c1723befe6bcc7229f005217d5c681128fcad/gfx/webrender_bindings/src/bindings.rs#646 and https://searchfox.org/mozilla-central/source/gfx/layers/wr/WebRenderBridgeParent.cpp#554


We should clear with (0.0, 0.0, 0.0, 0.0) or (1.0, 1.0, 1.0, 1.0) at least in release mode.
Assignee: nobody → nical.bugzilla
Whiteboard: [wr-mvp][triage][gfx-noted]
There we go.
Attachment #8913104 - Flags: review?(kvark)
Comment on attachment 8913104 [details] [diff] [review]
Clear with transparent black.

Review of attachment 8913104 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, assuming 0.3 didn't have any valuable semantics in there.
Attachment #8913104 - Flags: review?(kvark) → review+
Pushed by nsilva@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/405cec6a92e7
Clear with transparent black to benefit from fast glClear optimization. r=kvark
Status: NEW → ASSIGNED
Priority: -- → P1
Whiteboard: [wr-mvp][triage][gfx-noted] → [wr-mvp] [gfx-noted]
Whiteboard: [wr-mvp] [gfx-noted] → [gfx-noted]
https://hg.mozilla.org/mozilla-central/rev/405cec6a92e7
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Whiteboard: [gfx-noted] → [wr-mvp] [gfx-noted]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: