We generate a lot more shader variants than we need
Categories
(Core :: Graphics: WebRender, task, P3)
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).
Comment 1•4 years ago
|
||
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.
Reporter | ||
Updated•3 months ago
|
Description
•