Module: Mesa Branch: master Commit: 6d830940f78109db44293d41e74d9ec0a47da49b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6d830940f78109db44293d41e74d9ec0a47da49b
Author: Jordan Justen <jordan.l.jus...@intel.com> Date: Tue Mar 13 10:44:39 2018 -0700 glsl/shader_cache: Allow shader cache usage with transform feedback Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105444 Suggested-by: Timothy Arceri <tarc...@itsqueeze.com> Signed-off-by: Jordan Justen <jordan.l.jus...@intel.com> Reviewed-by: Tapani Pälli <tapani.pa...@intel.com> Reviewed-by: Timothy Arceri <tarc...@itsqueeze.com> --- src/compiler/glsl/linker.cpp | 11 +---------- src/compiler/glsl/shader_cache.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 1444b68cb0..af09b7d03e 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -4773,16 +4773,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) } #ifdef ENABLE_SHADER_CACHE - /* 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++) { - _mesa_glsl_compile_shader(ctx, prog->Shaders[i], false, false, true); - } - skip_cache = true; - } - - if (!skip_cache && shader_cache_read_program_metadata(ctx, prog)) + if (shader_cache_read_program_metadata(ctx, prog)) return; #endif diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index bf884af790..e43ed7aa67 100644 --- a/src/compiler/glsl/shader_cache.cpp +++ b/src/compiler/glsl/shader_cache.cpp @@ -160,6 +160,12 @@ shader_cache_read_program_metadata(struct gl_context *ctx, prog->FragDataBindings->iterate(create_binding_str, &buf); ralloc_strcat(&buf, "fbi: "); prog->FragDataIndexBindings->iterate(create_binding_str, &buf); + ralloc_asprintf_append(&buf, "tf: %d ", prog->TransformFeedback.BufferMode); + for (unsigned int i = 0; i < prog->TransformFeedback.NumVarying; i++) { + ralloc_asprintf_append(&buf, "%s:%d ", + prog->TransformFeedback.VaryingNames[i], + prog->TransformFeedback.BufferStride[i]); + } /* SSO has an effect on the linked program so include this when generating * the sha also. _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit