i965: Make shader_time store names/ids instead of referencing shaders.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 15 Apr 2015 09:16:47 +0000 (02:16 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 17 Apr 2015 19:07:35 +0000 (12:07 -0700)
commitcd9058fae3eddaa0e88cd3557684700852f86a5a
tree2669ce38fa7eaf7e1e5ccf0fcfb913870bdb1cb0
parenteb6e770889536e44da0947b64955e9a923ba98f6
i965: Make shader_time store names/ids instead of referencing shaders.

Jason noticed that shader_time was bumping the reference count on the
gl_shader_program and gl_program structures, in code called during
compilation.

Not only were these never unreferenced, but it meant fragment shaders
might be referenced twice (SIMD8 and SIMD16)...or only once.

We don't actually need the programs.  We just need their numeric ID and
their language (GLSL/ARB/FF) or KHR_debug label.  If there's a label, we
have to strdup it since the underlying program could be deleted.

To be fair, we're not exactly cleaning that up either, but we at least
ralloc it out of the shader_time arrays, so if we ever bother cleaning
those up, they'll go away properly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_program.c