mesa: rework how we free gl_shader_program_data

When I introduced gl_shader_program_data one of the intentions was to
fix a bug where a failed linking attempt freed data required by a
currently active program. However I seem to have failed to finish
hooking up the final steps required to have the data hang around.

Here we create a fresh instance of gl_shader_program_data every
time we link. gl_program has a reference to gl_shader_program_data
so it will be freed once the program is no longer active.

Cc: "17.2 17.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Neil Roberts <nroberts@igalia.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102177
This commit is contained in:
Timothy Arceri
2017-11-08 10:57:21 +11:00
parent 9c33533586
commit 6a72eba755
3 changed files with 18 additions and 42 deletions

View File

@@ -3067,6 +3067,8 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
_mesa_clear_shader_program_data(ctx, prog);
prog->data = _mesa_create_shader_program_data();
prog->data->LinkStatus = linking_success;
for (i = 0; i < prog->NumShaders; i++) {