Skip to content

mesa/st: Always precompile the first shader variant, and rely on mesa/st variants in v3d/vc4

Emma Anholt requested to merge anholt/mesa:gallium-always-variant into master

Every driver needs shader precompiles so that you get a chance to build the happy-path shader at link time instead of draw time. Yet, we have this trap in our mesa/st where only if you set all the "I can handle this weird GL state in HW" bits do you get shader precompiles. Drivers like vc4 and v3d tried to signal all the HW support so that they could get precompiles, causing needless code duplication (even though precompiels recently got disabled with the addition of alpha-test lowering!). And new drivers often missed this requirement and ended up with stuttering at draw time.

Fix the trap by always precompiling the default variant, and clean up some fastpath precompile-or-not checks based on that now always being the case.

And, now that there's no pressure to fake HW features in v3d and vc4, garbage collect a bunch of duplicated lowering code.

Merge request reports