texturetop - Texture Profiling
One of the big determinants of OpenGL performance is texture usage; if an application starts using more textures than fit into the graphics card memory, performance can drop dramatically.
texturetop is something I cooked up to allow easily getting a view of the texture usage of a client using the open-source Mesa/DRI implementation of libGL. It consists of two pieces; a patch for Mesa that provides a generic texture profiling hook and a small text mode client along the lines of the classic 'top' that uses the profiling hook.
The way that the texture profiling hook works is that if an environment variable LIBGL_PROFILE_SERVER is set, a separate thread is created that connects to the specified profiling server and waits for commands for the server. The only command at the current time (other than startup/shutdown) is a request for changes to the current state since the last update.
Some small driver modifications are needed to hook up to this profiling infrastructure. In the current version of the patch, only the Savage driver is modified, so it probably won't do anything for your video card without a little work.
The information that texturetop displays is:
- Number and size of available texture heaps (Card, AGP, etc.)
- For each texture
- Width and height of the texture
- Bytes used in main client memory
- Current heap for the texture, if any
- Time texture has been in that heap
- Bytes used in that heap