Mesa's Lima Driver Finally Implements OpenGL Shader Cache Support

The Lima Gallium3D driver now supports on-disk shader cache functionality for OpenGL fragment and vertex shaders. Like with the other OpenGL drivers providing on-disk shader caching, it's for speeding up subsequent game/application load times and for helping with performance for any software that is otherwise trying to compile shaders on the fly.
Independent developer Erico Nunes who implemented the Gallium3D shader cache support for Lima noted, "Some opengl features require shader recompilation to be implemented in the mali400 and can only be detected at draw time. In some applications, this could lead to recompiling shaders on every frame which could kill performance. Introduce a shader cache to prevent this issue. lima didn't have vertex shader recompilation yet but it is needed to implement followup features, so include it here too. Code heavily borrowed from the vc4 shader cache implementation."
The code landed with this commit for Mesa 21.1 due out next quarter.
7 Comments