Closed Bug 1604567 Opened 5 years ago Closed 4 years ago

Generate shaders at build time

Categories

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

enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: jrmuizel, Unassigned)

References

(Blocks 2 open bugs)

Details

We would like to have this for a number of reasons:

  • sw-wr wants to translate to c++ at build time
  • mac may want to do glsl optimizations at build time
  • it would be nice to compile to d3d byte code at build time
  • gfx-rs wants spirv so needs to do glsl-to-spirv at build time
Blocks: 1604615

Apparently https://github.com/szeged/webrender has some kind of implementation of this. Dzmitry, can you point it out?

Flags: needinfo?(dmalyshau)

Yep, Szeged team generates SPIR-V modules from our GLSL shaders at build time: https://github.com/szeged/webrender/blob/master/webrender/build_gfx.rs

Flags: needinfo?(dmalyshau)
Priority: -- → P3
Blocks: 1618968

This is done.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED

I'm still seeing that Fenix is ~10% slower on the first pageload with WebRender enabled vs WebRender disabled.
https://docs.google.com/spreadsheets/d/18qCiz3SReDgDPwhbYfuDrbnBK1030FuVWGBHWwdgCFY/edit#gid=2107265838

Are shaders being generated at build time on Android?

The optimized shaders are generated at build time, but they still need to be compiled at runtime, once per Firefox profile.
The fact that our pageload tests exercise shader compilation is still tracked by bug 1624331, which remains unfixed.

You need to log in before you can comment on or make changes to this bug.