[Mesa-dev] [PATCH 27/37] glsl: don't reference shader prog data during cache fallback

Timothy Arceri t_arceri at yahoo.com.au
Mon Jan 23 23:13:06 UTC 2017


From: Timothy Arceri <timothy.arceri at collabora.com>

We already have a reference.
---
 src/compiler/glsl/linker.cpp | 3 ++-
 src/mesa/main/shaderobj.c    | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index fa9e154..d34ec97 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -2197,7 +2197,8 @@ link_intrastage_shaders(void *mem_ctx,
       return NULL;
    }
 
-   _mesa_reference_shader_program_data(ctx, &gl_prog->sh.data, prog->data);
+   if (!prog->data->cache_fallback)
+      _mesa_reference_shader_program_data(ctx, &gl_prog->sh.data, prog->data);
 
    /* Don't use _mesa_reference_program() just take ownership */
    linked->Program = gl_prog;
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 6ddccd2..a8d3f5a 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -433,7 +433,8 @@ _mesa_delete_shader_program(struct gl_context *ctx,
                             struct gl_shader_program *shProg)
 {
    _mesa_free_shader_program_data(ctx, shProg);
-   _mesa_reference_shader_program_data(ctx, &shProg->data, NULL);
+   if (!shProg->data->cache_fallback)
+      _mesa_reference_shader_program_data(ctx, &shProg->data, NULL);
    ralloc_free(shProg);
 }
 
-- 
2.9.3



More information about the mesa-dev mailing list