diff options
author | Timothy Arceri <[email protected]> | 2017-01-24 08:34:23 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-02-17 11:18:42 +1100 |
commit | 0057de58f954e6494b5661e505d12e92f18619e2 (patch) | |
tree | 5fcdb700b49ab82aa4a39339a97fe641a0e951c6 /src/compiler/glsl/linker.cpp | |
parent | 3bbfee3cd336c60674d337ace3410f09d4eabf6f (diff) |
glsl: add support for caching shaders with xfb qualifiers
For now this disables the shader cache when transform feedback is
enabled via the GL API as we don't currently allow for it when
generating the sha for the shader.
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler/glsl/linker.cpp')
-rw-r--r-- | src/compiler/glsl/linker.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 80d83141f9a..7aaaee265fb 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -4621,7 +4621,19 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) return; } - if (shader_cache_read_program_metadata(ctx, prog)) + /* If transform feedback used on the program then compile all shaders. */ + bool skip_cache = false; + if (prog->TransformFeedback.NumVarying > 0) { + for (unsigned i = 0; i < prog->NumShaders; i++) { + if (prog->Shaders[i]->ir) { + continue; + } + _mesa_glsl_compile_shader(ctx, prog->Shaders[i], false, false, true); + } + skip_cache = true; + } + + if (!skip_cache && shader_cache_read_program_metadata(ctx, prog)) return; void *mem_ctx = ralloc_context(NULL); // temporary linker context |