glsl: don't reference shader prog data during cache fallback
authorTimothy Arceri <timothy.arceri@collabora.com>
Sun, 20 Nov 2016 06:48:27 +0000 (17:48 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 17 Feb 2017 00:18:43 +0000 (11:18 +1100)
We already have a reference.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/compiler/glsl/linker.cpp
src/mesa/main/shaderobj.c

index 7aaaee265fb4704c103fbb6f8da3daee48fac56e..d8b8a183db6fd9d7194d17eb5d4f6e4a6ba5ed6f 100644 (file)
@@ -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;
index 222efc12c4e6260bea330ad918d53032619c76d9..2ca6544272630dda477182e5583a993de38a9365 100644 (file)
@@ -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);
 }