Closed Bug 1665274 Opened 4 years ago Closed 4 years ago

rasterflood_gradient spends a lot of time in brush_opacity

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: lsalzman, Assigned: nical)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

When testing under SWGL, it seems that half the time in rasterflood_gradient is spent inside brush_opacity, aside from brush_radial_gradient comprising the other half, as rasterflood_gradient sets opacity on the background.

Glenn suggests that brush_opacity is probably very inefficient for this common case that is both axis-aligned and requires no edge AA. He suggests that we could possibly just use a hardware blend mode and a simple blit shader instead to fast-path that case. That would be a win for both SWGL and HW.

Blocks: wr-gpu-time
Severity: -- → N/A
Priority: -- → P3
  • Remove a bunch of unnecessary arithmetic that un-premultiply/premultiply unmodified rgb channels.
  • Clamp the uvs as we do in other shaders instead of doing a point-in-rect test.
  • Add a shader variant that doesn't deal with anti-aliasing for the common axis-aligned transform case.

In the future we can merge the opacity funcionality into the brush_image shader to reduce the number of shaders.

Assignee: nobody → nical.bugzilla
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: