diff options
author | Marek Olšák <[email protected]> | 2017-05-31 13:07:04 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-06-05 18:25:57 +0200 |
commit | 2ec50f98a9be9ee94aa0dd82fb7560c00153b03f (patch) | |
tree | 4f2d5c06ce4bbedfcb34e561ce81bf89e40971aa /src | |
parent | bb0452442a77570fce529cbb3d9fd99a94f3b50e (diff) |
st/mesa: don't load cached TGSI shaders on demand
This fixes a performance issue with the shader cache that delayed Gallium
shader create calls until draw calls.
I'd like this in stable, but it's not a showstopper.
Cc: 17.1 <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_shader_cache.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_shader_cache.c b/src/mesa/state_tracker/st_shader_cache.c index 31c3430aa4a..305435ff5bb 100644 --- a/src/mesa/state_tracker/st_shader_cache.c +++ b/src/mesa/state_tracker/st_shader_cache.c @@ -22,7 +22,7 @@ */ #include <stdio.h> - +#include "st_debug.h" #include "st_program.h" #include "st_shader_cache.h" #include "compiler/glsl/program.h" @@ -367,6 +367,11 @@ st_load_tgsi_from_disk_cache(struct gl_context *ctx, _mesa_associate_uniform_storage(ctx, prog, glprog->Parameters, false); + /* Create Gallium shaders now instead of on demand. */ + if (ST_DEBUG & DEBUG_PRECOMPILE || + st->shader_has_one_variant[glprog->info.stage]) + st_precompile_shader_variant(st, glprog); + free(buffer); } else { /* Failed to find a matching cached shader so fallback to recompile. |