We already have a reference.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
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;
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);
}