From: Timothy Arceri Date: Sun, 20 Nov 2016 06:48:27 +0000 (+1100) Subject: glsl: don't reference shader prog data during cache fallback X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0e9991f957e296f46cfff40a94ffba0adf2a58e1;p=mesa.git glsl: don't reference shader prog data during cache fallback We already have a reference. Reviewed-by: Nicolai Hähnle --- diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 7aaaee265fb..d8b8a183db6 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 222efc12c4e..2ca65442726 100644 --- a/src/mesa/main/shaderobj.c +++ b/src/mesa/main/shaderobj.c @@ -430,7 +430,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); }