View Full Version : glTexImage3D reload/refresh
03-19-2012, 06:01 PM
I have malloc-ed data in a buffer. I run glTexImage3D and supply the data as a parameter. Everything works fine. I make changes to the data. I rerun glTexImage3D. Everything works fine and I can see the changes that were made on the screen. The problem is that this is a rather slow process. Rerunning glTexImage3D to reload/refresh the data in malloc-ed memory takes time. Is there any faster way of doing this?
03-19-2012, 08:55 PM
You should use glTexSubImage3D for uploading new data to an already existing texture. You can pick pixel transfer parameters (http://www.opengl.org/wiki/Pixel_Transfer) that your implementation won't have to convert. And you can use pixel buffers to make the transfer asynchronous (http://www.opengl.org/wiki/Pixel_Buffer_Object), but this will only be "faster" if you have something you could be doing while the transfer is going on.
03-20-2012, 03:56 AM
I suggest that you use a format that is directly supported by the GPU. Example, all cards support B8G8R8A8 (GL_BGRA).
03-20-2012, 12:52 PM
I tried glTexSubImage3D and I tried glCopyTexSubImage3D and stopwatch showed pretty much the same benchmark timing as when I just ran glTexImage3D over again. It didn't seem to speed things up.
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.