diff options
author | Timothy Arceri <[email protected]> | 2017-04-10 11:48:48 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-04-15 11:36:44 +1000 |
commit | c2bc0aa7b188708e702bc3eaac5389793cbb85a8 (patch) | |
tree | fd6eb5b1729e50ba6fe9593a539587a0b9bd2968 /src/compiler/glsl/shader_cache.cpp | |
parent | d2d6cf6c8387ac06c8559027f57683a61b48671b (diff) |
glsl: delay optimisations on individual shaders when cache is available
Due to a max limit of 65,536 entries on the index table that we use to
decide if we can skip compiling individual shaders, it is very likely
we will have collisions.
To avoid doing too much work when the linked program may be in the
cache this patch delays calling the optimisations until link time.
Improves cold cache start-up times on Deus Ex by ~20 seconds.
When deleting the cache index to simulate a worst case scenario
of collisions in the index, warm cache start-up time improves by
~45 seconds.
V2: fix indentation, make sure to call optimisations on cache
fallback, make sure optimisations get called for XFB.
Tested-by: Grazvydas Ignotas <[email protected]>
Tested-by: Dieter Nützel <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler/glsl/shader_cache.cpp')
-rw-r--r-- | src/compiler/glsl/shader_cache.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index f5e6a22bb9e..e51fecd6518 100644 --- a/src/compiler/glsl/shader_cache.cpp +++ b/src/compiler/glsl/shader_cache.cpp @@ -1418,7 +1418,7 @@ shader_cache_read_program_metadata(struct gl_context *ctx, */ char sha1_buf[41]; for (unsigned i = 0; i < prog->NumShaders; i++) { - if (prog->Shaders[i]->CompileStatus == compile_success) { + if (prog->Shaders[i]->CompileStatus == compiled_no_opts) { disk_cache_put_key(cache, prog->Shaders[i]->sha1); if (ctx->_Shader->Flags & GLSL_CACHE_INFO) { _mesa_sha1_format(sha1_buf, prog->Shaders[i]->sha1); |