[Mesa-dev] V6 On disk shader cache GLSL/i965

Timothy Arceri timothy.arceri at collabora.com
Mon Oct 3 06:00:01 UTC 2016


The last two patches are not needed but it seems safer to just store
separate shaders for different platform to avoid any future bugs which
we are unlikely to do regression testing for since there is no real
advantage in sharing the cached shaders.

V6:
- rewrote a bunch of the i965 shader cache functions to reduce
 duplication.
- fixed some i965 bugs that only happen when falling back to a full
 recompile when a cache object is deemed invalid (created with different
 mesa version).
- added env var to more easily debug bugs as described in previous dot
 point.
- Store all pointers as uint64_t.

V5:
- added support for caching shaders with transform feedback
 enabled by the in shader xfb qualifiers now ARB_enhanced_layouts
 is enabled.
- rebased on last 3 months of Mesa changes

V4:
- lots of reworking patches to remove code churn should be much nicer now
- fixed fallback when shader has been detached
- fixed a couple of bugs with UBOs
- no more printfs, debug info is behind an environment var
- various cleanups, tweaks and fixes
 
V3:
- add support for geometry and tessellation stages
- cache clip planes
- reserve parameter storage before restoring list
- stop losing  buffer blocks on cache fallback
- lots of little fixes I cant remember

V2: 
- rebased on master
- add support for encoding doubles
- renamed skip_cache params to is_cache_fallback, and fix related bug
 when  disabling shader cache for xfb.

This series is based on the great work done by Carl, Kristian and
others.

This series enables on disk shader cache for all stage except compute
programs. For now transform feedback (when enabled via the API), and
SSO programs skip using the cache, these will be added as follow ups.

My main goal with this series is to land something that
passes piglit there is a number of optimisations that can still be done
such as skipping more validation and state recreation when falling back
to a full recompile but I would rather land something that is working
before trying to optimise further.

Games:

Enabling shader cache with the Shadow of Mordor benchmark make things noticeably
smoother and helps consitently keep the min FPS at 15 on my Skylake,
were as without it can be anywhere between 4-15.

The elemental demo which Dave pointed out as also doing a bunch of
compiles during the demo is also smoother especially on the second run
but its really slow on my Skylake regardless. Maybe someone with a
highend Skylake would like to give it a try.


You can find the series in the shader-cache branch of:

https://github.com/tarceri/Mesa_arrays_of_arrays.git

MESA_GLSL_CACHE_ENABLE=1 - enables the cache.
MESA_GLSL=cache_info - enables some debug messages



More information about the mesa-dev mailing list