Skip to content

lima: introduce fs and vs shader cache

Erico Nunes requested to merge enunes/mesa:lima-shader-cache into master

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.

One notable difference between the vc4 reference implementation and lima is that lima still compiles the base shader at state creation time without deferring it to the next draw (so that it stays compatible with behaviour expected by unmodified shader-db, for example).

Tested with piglit, deqp and shader-db, no regressions.

Checking with !7825 rebased on top of this, it saves some shader compilations when enabling and disabling features.

Merge request reports

Loading