Closed Bug 1664735 Opened 4 years ago Closed 4 years ago

Optimize WR sample_gradient

Categories

(Core :: Graphics: WebRender, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: lsalzman, Assigned: lsalzman)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

There are a few micro-optimizations we can do for WR's sample_gradient that should make it friendlier with SWGL. Integer clamps are much more expensive than FP clamps in SSE2. We can also help the GLSL translator out a bit better with some of the floor/fract common-expressions in case it's not doing a good job.

Gradient shaders end up calling fetch_from_gpu_cache_2 with a vectorized
address. This currently disables SWGL texelFetchPtr optimization for repeated
uses of texelFetchOffsets. In principle this optimization can still work in
vector mode. We just need to use an I32 instead of a direct pointer into the
buffer in this case. I've added a texelFetchUnchecked wrapper to automagically
disambiguate between scalar and vector cases.

Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b9ca78d0a835 micro-optimizations for WR sample_gradient. r=mattwoodrow https://hg.mozilla.org/integration/autoland/rev/5219686dc465 support vectorized texelFetchPtr. r=mattwoodrow
Backout by nerli@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8fa84be67303 Backed out 2 changesets for causing failures in repeating-conic-gradient.html CLOSED TREE
Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/acc2af307fe8 micro-optimizations for WR sample_gradient. r=mattwoodrow https://hg.mozilla.org/integration/autoland/rev/ea8cc0187a75 support vectorized texelFetchPtr. r=mattwoodrow
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
Flags: needinfo?(lsalzman)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: