Closed Bug 1692731 (sw-wr-perf-linear) Opened 2 years ago Closed 2 years ago

Improve SWGL linear filter performance when upscaling


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




87 Branch
Tracking Status
firefox87 --- fixed


(Reporter: lsalzman, Assigned: lsalzman)


(Blocks 1 open bug)



(2 files)

Now that we've moved some inner loops for texture sampling inside SWGL itself as a result of bug 1678119, there are a few things we can do to make texture filtering faster in general.

Severity: -- → N/A
Priority: -- → P3

Often images are upscaled from a smaller resolution on a page, especially
when there is any amount of zoom being used, and especially at higher screen
resolutions. In this case, we don't really take advantage of the fact that all
the samples for a SIMD chunk can be loaded from memory in a single load, so
long as we're willing to shuffle them around. We also can take advantage of the
fact that most images are axis-aligned so that they have a constant filter
offset with the next row.

Also, we can easily fall off the fast past for blendTextureNearest if for some
reason there is a significant subpixel offset. In this case, we can still do
something way faster than a normal linear filter the optimizes for the fact
that both the X and Y steps are constant 1:1, but we need to interpolate with
neighboring samples.

Assignee: nobody → lsalzman

For YUV 422 video, when we are sampling UV planes at half the resolution of the
Y plane, we can interpolate from 2 samples for the UV planes as an approximation
of the 4 samples, allowing us to better pack the math into SIMD vectors and
substantially reduce the number of multiplications.

Depends on D105131

Pushed by
Accelerate linear filter upscaling in SWGL. r=jrmuizel
Accelerate YUV 422 compositing in SWGL. r=jrmuizel
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch

== Change summary for alert #28833 (as of Thu, 18 Feb 2021 02:25:54 GMT) ==


Ratio Suite Test Platform Options Absolute values (old vs new)
4% basic_compositor_video linux64-qr e10s stylo webrender-sw 2.81 -> 2.69

For up to date results, see:

Regressions: 1693924
Blocks: 1678779
Blocks: 1676253
Blocks: 1675621
Regressions: 1695782
Regressions: 1706441
You need to log in before you can comment on or make changes to this bug.