Show Your Support: This site is primarily supported by advertisements. Ads are what have allowed this site to be maintained on a daily basis for the past 18+ years. We do our best to ensure only clean, relevant ads are shown, when any nasty ads are detected, we work to remove them ASAP. If you would like to view the site without ads while still supporting our work, please consider our ad-free Phoronix Premium.
Mesa Lands New Single File Cache To Help Steam's Pre-Compiled Shaders, Space Savings
Mesa's new single file shader cache has been in the works by Valve contractor Timothy Arceri the past few months. The single file cache doesn't help with load times any further beyond the existing multi-file cache layout but can help in space savings. By tucking all the cached shaders into a single file is the possibility of better on-disk space savings. Arceri estimates the multi-file cache behavior as is used right now inflates disk usage by more than 3x of the single file cache.
The other driver though for the single file cache is making it easier to redistribute by third-party software, namely Steam with its pre-compiled shader caching and distributing of those shader caches to gamers to help in performance / load times.
This new implementation also adds an environment variable (MESA_DISK_CACHE_READ_ONLY_FOZ_DBS) that allows pointing to a read-only path for external shader cache databases. So once Mesa 21.1+ is out there, this will likely be used by Steam for more easily redistributing the shader caches to Linux gamers.
For the moment though this new single file cache isn't used by default but requires setting the MESA_DISK_CACHE_SINGLE_FILE=1 environment variable for enabling.
More details on this Mesa 21.1 addition via this honored merge request.