glTexSubImage2D on Radeon card

Hi all,

I’ve done a simple test-program where I only use the glTexSubImage2D function : the results are quite similar on ATI and NVidia cards (with the latest drivers).

But in our entire project, this function seems to take a very long time on Radeon 9800 in comparison with a GeForceFX 5600.
In fact, the taken time is really visible on screen by a brutal cut in the movement of my objects.

Do you know if there is a special thing to do (or not to do) in order to use efficiently this function on Radeon Cards ?

thanks for your help,


[This message has been edited by Pacôme (edited 03-13-2004).]

There’s probably some stuff you can do to improve performance with format options, getting memory in the AGP aperture and making sure the subloads are aligned and unstrided (contiguous).

You’ll need to post more details on what you do currently.

True, my question needs more details.

The code (simplified) in order to load any 2D textures in Bilinear mode is :

  1. glBindTexture(GL_TEXTURE_2D, texID);
  3. glTexImage2D(GL_TEXTURE_2D, 0, 4, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, bitmap_buffer);

And, when I want to replace a part of one texture, I only do :

  1. glBindTexture(GL_TEXTURE_2D, texID);
  2. glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, new_buffer);

When I test this code in a simple program, there is no difference between ATI Radeon and GeForceFX cards. Same behaviour.

But when I use THE SAME code in the complete program, the behaviour is completely different : the Radeon Card take a loooong time to execute the glTexSubImage2D function. Very strange.

Has anyone had the same problem ?
Is there a special trick to avoid or to do ?



Try it with out the generate mipmap extension.

Absolutely, the problem comes from the GL_GENERATE_MIPMAP_SGIS extension.

So, I have to use the old method for mipmap generation on ATI Radeon.

Thanks for your help


Actually using that extension will slow you down on any hardware, not only on Radeons.

Enabling automatic mipmap generation does mean the gfx-card has to do a lot more work, than just to copy that stuff.

It sounds as if you don´t understand what that extension really does. Enabling it will generate mipmaps EVERY TIME you change the texture. If you don´t need this, than don´t use it. If you need it, then don´t complain about a slowdown.


In comparison with the classical gluBuild2DMipmaps, the GL_GENERATE_MIPMAP_SGIS extension don’t take a lot more time on GeForceFX.

It’s only on Radeon cards that you can notice the difference between these two methods.

(and for the story, I understand very well the extensions but I don’t know all the drivers capabilities ; three years ago I had a similar problem with a wrapping extension which was not clearly coded in the ATI drivers )


[This message has been edited by Pacôme (edited 03-15-2004).]