[Mesa-dev] On disk shader cache for i965

Timothy Arceri timothy.arceri at collabora.com
Fri Apr 29 13:32:59 UTC 2016


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

I've split up Carls original patches for easier review, and also merged
a number of fixes and clean-ups into his patches. However there is still
a small amount of code churn for example patches 14-17 that I decided to
keep separate to hopefully make review a little easier and preserve some
history but I could also squash them if people prefer.

For now I have left in some printf's as the feature is still disabled by
default and they are useful for debugging. I can hide them behind an
environment var if people would rather that.

This series has be tested with Intels CI system with no regressions
(shader cache disabled) and with no regressions after two runs in piglit
with shader cache enabled on my Broadwell machine.

This series enables the on disk shader cache for vs+fs programs. For now
transform feedback, SSO, tes, geom and vs or fs only programs all skip
using the cache, these will be added in a follow up series.

My goal with this series is to land something that passes piglit as soon
as possible so that others can begin testing and playing around with it.
I'm sure there are still many issue piglit is not exposing. Some issues
I'm aware of include using the correct source and attribute bindings if
they have been changed after linking and we fallback to a full recompile
after a cache miss.

There is some code duplication in brw_shader_cache.cpp that should be 
removed but I would like to make that a task for the follow-up series
as there is likely to be a bit of refactoring when adding the tes and 
geom stages anyway.

As stated above 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 leave this until we have
something fully working.

I attempted to get some shader-db times but I hit some stack smashing
with champions-of-regnum the offending shader_test contained multiple
vertex and frament shaders I'm still looking into the problem.

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.




More information about the mesa-dev mailing list