glTexImage2D() & memory understanding...
A quick query - when you pass the pointer to pixel data to the last parameter of glTexImage2D(), OpenGL creates it's own internal reference to the pixel data? So, as you're effectively now keeping two copies of the pixel data, you're able to just pass the pixel data pointer to free()?
Mark Bishop
Correct, unless you're using the GL_CLIENT_STORAGE_APPLE extension. (Perhaps someone more knowledgeable (Keith?) wants to explain further?)
Alex Diener
Alex Diener
Thanks, that's all I needed to know; I'm not/won't be using GL_CLIENT_STORAGE_APPLE as I'm trying for cross-platform niceness.
Mark Bishop
It's a 70% texture upload speedup. Worth using if you animate any textures.
client storage typically isn't difficult to slot into cross-platform code, so it might well still be worthwhile doing.
Without client storage, there are typically three copies of your texture, one in application memory (which you can free at will), one in driver memory, and one in VRAM. With APPLE_client_storage, you can cut that down to two (you become responsible for the driver copy), and with APPLE_texture_range you can sometimes cut it down to one (if the texture is better off in AGP memory).
Without client storage, there are typically three copies of your texture, one in application memory (which you can free at will), one in driver memory, and one in VRAM. With APPLE_client_storage, you can cut that down to two (you become responsible for the driver copy), and with APPLE_texture_range you can sometimes cut it down to one (if the texture is better off in AGP memory).
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Understanding multisampled FBOs | Coyote | 12 | 7,063 |
Nov 27, 2009 01:01 AM Last Post: arekkusu |
|
| Understanding glColorMaterial | PhysicsGuy | 3 | 4,322 |
Nov 25, 2008 06:25 PM Last Post: PhysicsGuy |
|
| how to use Glubuild2DMipmaps, GlTexImage2D and glTexParameter | 007gamer | 1 | 3,830 |
Jan 31, 2007 04:36 AM Last Post: OneSadCookie |
|
| Minor issue with understanding | ExitToShell | 15 | 5,741 |
Jul 13, 2005 10:22 AM Last Post: MattDiamond |
|
| glTexImage2D bug? | Skorche | 1 | 2,680 |
Apr 12, 2005 01:28 AM Last Post: OneSadCookie |
|

