Hello,
I use "current cvs" from 2003-12-17 (dri - Mesa-newtree) on an Ati Mobility M7 LW. When dri is enabled (OpenGL renderer string: Mesa DRI Radeon 20030328 AGP 4xTCL) I get a memory leak when I load and unload a texture.
Attached an example program. Put it in Mesa-newtree progs/tests and add an entry in the good make file. Then, run it and look at the memory usage. Each time you type 'r' in the window, the texture is reloaded 100 times and here this program use 6M more memory (each time).
This problem does not happen if LIBGL_ALWAYS_INDIRECT=1. This problem does not happen with XFree-4.4.0-rc1.
Olivier,
Can you try applying the attached patch to src/mesa/drivers/dri/radeon/radeon_tex.c
It's not convenient for me to test.
If this works, the change may need to be applied to the other drivers too.
With Mesa 5.1 and later, it's the driver's responsibility to do all memory deallocation related to glDeleteTextures. Previously, core Mesa freed the Mesa bits.
-Brian
Index: radeon_tex.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/radeon/radeon_tex.c,v
retrieving revision 1.4
diff -c -r1.4 radeon_tex.c
*** radeon_tex.c 5 Jan 2004 02:40:28 -0000 1.4
--- radeon_tex.c 9 Jan 2004 18:49:29 -0000
***************
*** 693,698 ****
--- 693,701 ----
driDestroyTextureObject( t );
}
+
+ /* Free mipmap images and the texture object itself */
+ _mesa_delete_texture_object(ctx, texObj);
}
/* Need:
