I believe you'll have to precompress the textures. When you upload an uncompressed texture to a ST3C opengl texture the driver needs to compress it and it take a lot of time. You can either use a program to compress your textures offline and store them in ST3C format so that the driver will only have to copy the data in VRAM, or you can upload uncompressed textures and then force their use in a hidden first frame to insure that they are correctly compressed by the driver, then all the other frames shouldn't have any compression penalty.
I'm using S3TC textures, loaded with glCompressedTexImage2D. Ideally, I'll like to load them to the GL_TEXTURE_RECTANGLE_EXT target - a number of my other textures are rectangular, so it simplifies things if I can assume everything I'm drawing is rectangular...
However, I'm seeing a big performance hit the first time each S3TC rect. texture is drawn to the screen, which doesn't seem to exist if I use GL_TEXTURE_2D textures. According to Shark, a lot of time is being spent in glgProcessColor, from this call chain:
0.0% 28.7% GLEngine glBegin_Exec
0.0% 28.6% ATIRadeon9700GLDriver gldUpdateDispatch
0.0% 28.0% ATIRadeon9700GLDriver gldPageoffBuffer
0.0% 28.0% ATIRadeon9700GLDriver gldGetTextureLevel
0.0% 28.0% ATIRadeon9700GLDriver gldGetTextureLevel
25.7% 25.7% libGLImage.dylib glgProcessColor (GLDPixelMode const*, GLGOperation const*, unsigned long)
Is there anything that I can do about this, or am I stuck with 2D textures?
Cheers,
Jon