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

Timothy Arceri timothy.arceri at collabora.com
Wed Jul 13 02:47:45 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 7b5bdd3..831b113 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -4514,7 +4514,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 83c360c..e78e5fe 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. However we should be able to use cached shaders when the xfb_*
     * qualifiers were used to enable transform feedback.
     */
-   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