git:// program-binary-shader-cache

I found that when running DOTA2, most programs were skipping the
shader cache. It appears that since DOTA2 uses ARB_get_program_binary,
the programs loaded with ProgramBinary set the LinkStatus to

Currently we never look in the shader cache when the LinkStatus is set
to LINKING_SUCCESS, so we would always fallback to generating the i965
gen program from NIR. We would still save the program to the shader
cache, but the next time DOTA2 ran, it would still use ProgramBinary,
and once again we would regenerate the program from NIR.

I also looked into whether we could also check the shader cache for
programs that have a LinkStatus of LINKING_SUCCESS. I think this might
be possible, but given that we skip the shader cache for programs
using transform feedback, and they set LinkStatus to LINKING_SUCCESS,
it was a bit more difficult to ensure things would always behave

Cc: Timothy Arceri <>

Jordan Justen (2):
  glsl/serialize: Save shader program metadata sha1
  main/program_binary: In ProgramBinary set link status as

 src/compiler/glsl/serialize.cpp | 4 ++++
 src/mesa/main/program_binary.c  | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)


mesa-dev mailing list

Reply via email to