iDevGames Forums
Apple client storage? - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Apple client storage? (/thread-2503.html)



Apple client storage? - Wowbagger - Jul 28, 2008 10:24 PM

I understand that using GL_UNPACK_CLIENT_STORAGE_APPLE is supposed to eliminate the need for OpenGL to keep an internal copy of texture data, but how much optimization does that really give? With it turned on, I've been having some headaches with either memory leaks or somehow losing the pointer to the allocated memory (getting "pointer being freed was not allocated" errors when trying to free the texture data). With it off, I've just freed the data after loading the texture, which seems to work fine. Is it really worth it to use the Apple client storage extension?


Apple client storage? - arekkusu - Jul 29, 2008 08:59 PM

In essence, using this extension can eliminate a memcpy every time you touch a texture.

If your app touches textures a lot (like streaming video) then this is pretty critical.

If your app creates static textures once on startup, then it's not critical, but still good. Immediately freeing your copy of the texture is best if you don't use this extension, but there are still two copies resident in system memory until you delete. Generally that's fine, but if you're manipulating a dozen HDTV-sized textures, maybe not.

In summary, using less memory is always good. Skipping operations is always good.

The TextureRange sample lets you toggle client storage (and other parameters) to compare performance.


Apple client storage? - Wowbagger - Jul 30, 2008 02:35 PM

Thanks for the info. It seems like my app, a 2D game using static textures for sprite frames, doesn't really benefit that much from it -- most of the performance boost seems to come from the Texture Range extension. Plus, I never use glTexSubImage2D() in my code, so client storage doesn't seem like it would have much of an effect.

However, I have another question, just for future reference. If I recall correctly, I think Quartz Extreme double buffers windows automatically or something like that. Would the client storage extension have different effects in windowed and full screen mode?


Apple client storage? - OneSadCookie - Jul 30, 2008 02:57 PM

No, it has nothing to do with either the window server or double buffering.


Apple client storage? - Wowbagger - Jul 30, 2008 04:33 PM

Alright, thank you very much!