the memory is used almost doubled. Because of the metadata!

you know the memory is used almost doubled. Because of the metadata!



I tested Xcode5,iOS 6,iPhonn4s. Opengles2



I’m working on the optimization of our game(launching soon).

I used pvr format(ARGB8888) in my game UI.

pvr format(ARGB8888) has Meta data always 15byte by PVRTexTool



in PVRTTextureLoadFromPointer API.

for (PVRTuint32 uiFace=0; uiFace<psTempHeader->u32NumFaces; ++uiFace)<br />
{<br />
glCompressedTexImage2D(...<br />
glTexImage2D(...<br />
}<br />

```<br />
<br />
<br />
if 1024x1024(ARGB8888)<br />
uiMipLevel == 0 about 4MB Increase in memory usage.<br />
uiMIPLevel == 1 about 5MB Increase in memory usage.<br />
uiMIPLevel == 2 about 1MB Increase in memory usage.<br />
...<br />
so totally about 10MB Increase in memory usage per 1024x1024(ARGB8888)<br />
<br />
The solution is Edit->Align texture data->Align 4byte boundary by PVRTexTool. (if you did, totally about 5.6MB Increase in memory usage )<br />
I solved the batch execution too many textures .(make an utility)<br />
Most of metadata size is not aligned 4byte.<br />
This happens to be in any format.(pvrtc,pvrtcII,rgbxxxx,etc..)<br />
Most people do not know will be used.<br />
so metadata default size must be aligne 4 or 8byte.<br />
<br />
Thanks Regards,<br />

Hi,



When you say there’s an increase in memory usage - are you referring to a temporary cost of moving data around when the MIP-Map levels aren’t aligned? This is going to happen with NPOT textures as well, so the Meta Data alignment won’t solve it for everyone.



FYI, the 15bytes of meta data are from the axis alignment of the texture. If you uncheck “vertical flip” when compressing your texture (and there’s not already meta data in the image) then no meta data will be added. That option adds the meta data to indicate that it should be effectively displayed upside-down.



We’re working on a new version of the SDK tools as well - this will solve the issue by allocating the texture memory into a separate buffer to the meta data, allowing alignment to occur naturally.



Thanks,

Tobias