diff options
author | Eric Anholt <eric@anholt.net> | 2010-03-08 16:08:33 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-03-16 12:14:57 -0700 |
commit | 009392f50db7ae0f6ef1fcbff268d5b833852074 (patch) | |
tree | fec7946db38ec8ac692b4e355feaf87f42312006 | |
parent | 1254d3d315497636a2445533372dd3d1fa6f96dc (diff) |
i965: Fix up VP constbuf leak on program delete.
(cherry picked from commit 7f6d2754d586545ab6c970acffdd897294879039)
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_program.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c index c78f7b38ae..1fd957b3ad 100644 --- a/src/mesa/drivers/dri/i965/brw_program.c +++ b/src/mesa/drivers/dri/i965/brw_program.c @@ -95,9 +95,17 @@ static void brwDeleteProgram( GLcontext *ctx, struct gl_program *prog ) { if (prog->Target == GL_FRAGMENT_PROGRAM_ARB) { - struct gl_fragment_program *fprog = (struct gl_fragment_program *) prog; - struct brw_fragment_program *brw_fprog = brw_fragment_program(fprog); - dri_bo_unreference(brw_fprog->const_buffer); + struct gl_fragment_program *fp = (struct gl_fragment_program *) prog; + struct brw_fragment_program *brw_fp = brw_fragment_program(fp); + + dri_bo_unreference(brw_fp->const_buffer); + } + + if (prog->Target == GL_VERTEX_PROGRAM_ARB) { + struct gl_vertex_program *vp = (struct gl_vertex_program *) prog; + struct brw_vertex_program *brw_vp = brw_vertex_program(vp); + + dri_bo_unreference(brw_vp->const_buffer); } _mesa_delete_program( ctx, prog ); |