Panfrost Gallium3D Driver Wires Up Mesa Shader Disk Cache Support

Written by Michael Larabel in Mesa on 3 November 2022 at 04:53 AM EDT. Add A Comment
MESA --
One of the last features to land in Mesa 22.3 prior to yesterday's branching and Mesa 22.3-rc1 release is enabling the Mesa shader disk cache for Panfrost, the Arm Mali open-source driver for Midgard and Bifrost generations.

Panfrost Gallium3D has made the necessary changes in Mesa 22.3 to enable the common Mesa shader disk cache. In turn this should help with Panfrost on faster game load times by avoiding shader recompilation on subsequent game loads, helping with performance for any games compiling shaders on the fly, etc. It's the same Mesa on-disk cache used by other drivers, just the integration bits were needed for the Panfrost support.

Alyssa Rosenzweig of Collabora worked out the shader disk cache support. She summed it up as:
Wire up the Mesa shader disk cache into Panfrost. Coupled with the precompiles from the previous patch, this should greatly reduce shader recompile jank.

This is a bare bones implementation. Obvious future work includes:

- Caching internal (outside of Gallium) shaders
- Implement finalize_nir to reduce on disk size of shaders

As part of this merge is also the ability to pre-compile shaders at CSO creation time for trying to avoid "draw-time jank". The shader pre-compilation can be enabled using the new "precompile" debug option.


More details on the Mesa shader disk cache support for Panfrost via this merge.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week