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

Timothy Arceri timothy.arceri at collabora.com
Sat Sep 24 05:25:31 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 2f1be1f..df864d9 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -4636,7 +4636,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 d571d4a..070aee0 100644
--- a/src/mesa/drivers/dri/i965/brw_shader_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_shader_cache.c
@@ -312,7 +312,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;
 
    brw_vs_populate_key(brw, &vs_key);
-- 
2.7.4



More information about the mesa-dev mailing list