[Mesa-dev] [PATCH 48/77] i965: don't precompile or rebuild resource list on cache fallback

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


---
 src/mesa/drivers/dri/i965/brw_link.cpp | 22 ++++++++++++----------
 src/mesa/main/shaderobj.c              |  2 +-
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index aa92321..9acbaa3 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -287,19 +287,21 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg,
       }
    }
 
-   if (brw->precompile && !brw_shader_precompile(ctx, shProg))
-      return false;
+   if (!is_cache_fallback) {
+      if (brw->precompile && !brw_shader_precompile(ctx, shProg))
+         return false;
 
-   build_program_resource_list(ctx, shProg);
+      build_program_resource_list(ctx, shProg);
 
-   for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders); stage++) {
-      struct gl_linked_shader *shader = shProg->_LinkedShaders[stage];
-      if (!shader)
-         continue;
+      for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders); stage++) {
+         struct gl_linked_shader *shader = shProg->_LinkedShaders[stage];
+         if (!shader)
+            continue;
 
-      /* The GLSL IR won't be needed anymore. */
-      ralloc_free(shader->ir);
-      shader->ir = NULL;
+         /* The GLSL IR won't be needed anymore. */
+         ralloc_free(shader->ir);
+         shader->ir = NULL;
+      }
    }
 
    return true;
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 0d40953..109e79f 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -331,7 +331,7 @@ _mesa_clear_shader_program_data(struct gl_shader_program *shProg,
       shProg->NumAtomicBuffers = 0;
    }
 
-   if (shProg->ProgramResourceList) {
+   if (shProg->ProgramResourceList && !is_cache_fallback) {
       ralloc_free(shProg->ProgramResourceList);
       shProg->ProgramResourceList = NULL;
       shProg->NumProgramResourceList = 0;
-- 
2.7.4



More information about the mesa-dev mailing list