glsl: don't run the GLSL pre-processor when we are skipping compilation
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 10 Apr 2017 01:48:49 +0000 (11:48 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sat, 15 Apr 2017 01:36:52 +0000 (11:36 +1000)
commit9f0dd85aa65b5eba783d6023b51deacd529cf918
tree7955ebe7c7bc6d2cfa0dbbc4d402c939bcfd60f2
parentc2bc0aa7b188708e702bc3eaac5389793cbb85a8
glsl: don't run the GLSL pre-processor when we are skipping compilation

This moves the hashing of shader source for the cache lookup to before
the preprocessor.  In our experience, shaders are unlikely to hash the
same after preprocessing if they didn't hash the same before, so we can
skip preprocessing for cache hits.

Improves Deus Ex start-up times with a warm cache from ~30 seconds to
~22 seconds.

Also fixes the leaking of state.

V2: fix indentation

v3: add the value of MESA_EXTENSION_OVERRIDE to the hash of the shader.

Tested-by (v2): Grazvydas Ignotas <notasas@gmail.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/compiler/glsl/glsl_parser_extras.cpp
src/compiler/glsl/shader_cache.cpp