mesa: rework how we free gl_shader_program_data
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 7 Nov 2017 23:57:21 +0000 (10:57 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 9 Nov 2017 01:07:48 +0000 (12:07 +1100)
commit6a72eba755fea15a0d97abb913a6315d9d32e274
treedbbc8d83ec3c919e77aad495d2a79edaa45d75e4
parent9c33533586476693a197b7179552d140d54f23f2
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
src/mesa/main/shaderobj.c
src/mesa/main/shaderobj.h
src/mesa/program/ir_to_mesa.cpp