i965: Make shader_time store names/ids instead of referencing shaders

Graphics / Mesa 3D Graphics Library / Mesa - Kenneth Graunke [whitecape.org] - 17 April 2015 14:07 UTC

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.

cd9058f i965: Make shader_time store names/ids instead of referencing shaders.
src/mesa/drivers/dri/i965/brw_context.h | 4 +--
src/mesa/drivers/dri/i965/brw_program.c | 52 ++++++++++---------------------
2 files changed, 19 insertions(+), 37 deletions(-)

Upstream: cgit.freedesktop.org


  • Share