[Mesa-dev] [PATCH 46/77] glsl,i965: disable shader cache for SSO

Timothy Arceri timothy.arceri at collabora.com
Mon Oct 3 06:05:05 UTC 2016


Caching SSO requires us to be a little more careful so disable
it for now.
---
 src/compiler/glsl/linker.cpp                 | 7 ++++++-
 src/mesa/drivers/dri/i965/brw_shader_cache.c | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index fac591f..a32b3cd 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -4633,7 +4633,12 @@ 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) {
+   if (prog->TransformFeedback.NumVarying > 0 || prog->SeparateShader) {
+      /* TODO: we need to use the original transform feedback and SSO values
+       * the shader was compiled with. If they have changed after linking
+       * but before a cache fallback we could end up with the wrong result.
+       */
+      assert(!is_cache_fallback);
       for (unsigned i = 0; i < prog->NumShaders; i++) {
          if (prog->Shaders[i]->ir) {
             continue;
diff --git a/src/mesa/drivers/dri/i965/brw_shader_cache.c b/src/mesa/drivers/dri/i965/brw_shader_cache.c
index bd9306b..ea050df 100644
--- a/src/mesa/drivers/dri/i965/brw_shader_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_shader_cache.c
@@ -346,7 +346,7 @@ upload_cached_program(struct brw_context *brw, gl_shader_stage stage)
     * enabled via the API. However the shader cache does support transform
     * feedback when enabled via in shader xfb qualifiers.
     */
-   if (prog->TransformFeedback.NumVarying > 0)
+   if (prog->TransformFeedback.NumVarying > 0 || prog->SeparateShader)
       return;
 
    if (!read_and_upload(brw, cache, &binary, prog, stage))
-- 
2.7.4



More information about the mesa-dev mailing list