Open Bug 1668298 Opened 4 years ago Updated 3 months ago

We generate a lot more shader variants than we need

Categories

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

task

Tracking

()

People

(Reporter: nical, Unassigned)

References

(Blocks 1 open bug)

Details

The way the brush shader code is articulated it is a bit complicated to be precise about how what combination of shader features is strictly required.

Typically, brush shaders all need to have an opaque and an alpha version even for shaders that only make sense in an alpha pass (for example brush_opacity). In addition for each feature added we need a version with and without WR_FEATURE_DEBUG_OVERDRAW while in most cases we really only need a single verion of the overdraw shader since what is drawn doesn't matter.

As a result, adding a shader feature can be a bit of a series of trial and error figuring ou all of the combindations of features that we know won't ever be used (though their existence is checked at startup).

Yeah, all the optimized debug overdraw fragment shaders are identical, and the vertex shaders are identical to their non-debug-overdraw counterparts. (Except for the shader name and feature comments.) Perhaps I should file a separate bug for this, but that's a lot of MB on disk. And we probably don't need the optimization for a debug feature, so I think we should stop optimizing the debug overdraw shaders.

Blocks: wr-todos
No longer blocks: gfx-complexity
You need to log in before you can comment on or make changes to this bug.