Closed Bug 1823411 Opened 1 year ago Closed 1 year ago

Give webrender's shader's varyings explicit precisions

Categories

(Core :: Graphics: WebRender, task)

task

Tracking

()

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: jnicol, Assigned: jnicol)

References

Details

Attachments

(2 files)

Mali profiler shows us that we are fragment bounds, and particularly varying interpolation bound on many websites on Mali devices. Reducing varying precision to mediump where possible will help mitigate this.

Mali profiling tools have shown we are frequently fragment bound, in
particular due to varying interpolation. To help mitigate this, we
should use mediump where possible. Currently most of our varyings are
implicitly highp by default. This patch reduces their precision to
mediump where possible. When varyings must remain highp for
correctness reasons, this is now stated explicitly.

As expected, this does cause a fair bit of reftest fuzziness on
Android devices. This patch also updates reftest expectations to
reflect this.

Assignee: nobody → jnicol
Status: NEW → ASSIGNED

The previous patch in this series ensured that every varying is now
given an explicit precision. We want to use mediump where possible for
performance reasons, and highp when required for correctness. Going
forward, in order to ensure that developers have considered what
precision is required for new varyings, this patch adds a shader test
to ensure that they are explicitly qualified.

Shader tests have until now used the glsl crate. And as the glsl
crate does not handle preprocessor directive properly, we ran them on
the pre-optimized shader sources. However, the optimization pass
outputs explicit varying precisions even if the input did not contain
them, so that does not work for this case. Instead, we have switched
to use theglsl-lang crate, which does handle preprocessor directives
correctly. This does add some duplicate crate dependencies, however
this only affects wrench, not webrender itself.

Depends on D173028

Pushed by jnicol@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8d13c0ab66f0
Give all webrender's shader varyings an explicit precision. r=gfx-reviewers,lsalzman
https://hg.mozilla.org/integration/autoland/rev/c365f3dc09e9
Add test to ensure shaders have explicit precision specifier. r=gfx-reviewers,lsalzman
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
Regressions: 1824158
Regressions: 1825518
Duplicate of this bug: 1696390
Regressions: 1850815
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: