Textures using system memory instead of video memory
I thought textures were supposed to consume video memory, not system memory, but am finding that every texture I allocate its consuming system memory.
Using Windows Mobile, HTC Diamond device - dynamically attaching to it's libgles_cm.dll. I think it's ES 1.1. Device has 16bit display.
The remote heap viewer tool shows an allocation of w x h x 16bit (plus a few bytes extra probably for header etc) for each texture I use in my app. It is not the original bitmap - I free that from memory immediately after calling glTexImage2D and I've watched the heap as that happens to make sure it's not hanging around.
So it must be opengl that is allocating the memory.
My code uses:
- glGenTextures to create a handle
- glBindTexture to address it
- glTexParameteri to ensure mipmaps are not enabled (didn't make a difference though and I think they are disabled by default anyhow)
- glTexImage2D to set the pixel data (once off - doesn't happen every frame)
I was really wanting to design the app so that textures were offloaded to video memory and kept the process memory usage to a minimum. There must be a way to do this surely. The only thing I can find is in the full opengl there is the ability to suggest textures need to reside in video or system memory, but this is not part of ES.
Can anyone provide a suggestion on how to do this? Even if opengl needs to keep a copy of all textures in system memory - that's fine - but is it possible to get it to store it outside the app's process?