A few weeks ago I recommended to use NPOT (Non Power Of Two) textures due to a bug on iOS that was allocating 33% more memory for POT textures.
But these past days I have been doing more research on this an apparently iOS is allocating up to 99% more memory for NPOT textures.
These are the tests that I did:
2048x2048 + RGBA texture: 21.34 Mb (instead of 16Mb... 33% POT mipmap bug).
2047x2047 + RGBA texture: 31.99 Mb ( instead of 16Mb. 99% more )
1025x1025 + RGBA texture: 7.26 Mb ( instead of 4Mb. 81% more )
1536x1536 + RGBA texture: 15.75 Mb (instead of 9 Mb. 75% more )
I measured everything with Instruments + VM Tracker and paying attention to the dirty memory.
Before recommending everybody to stay away of NPOT textures, I would appreciate if you could do some tests with your game and confirm whether or not this is a bug.
How to test it:
1. Run your game with Instruments + Allocations
2. Once Instruments is running, switch to VM Tracker
3. Once one of your NPOT textures is loaded/displayed, take an snapshot and see the "Dirty" memory.
Repeat the same exact steps but using POT textures instead.
Please, report on this thread the "dirty" values both for POT and NPOT textures.
If you are using cocos2d v2.0, then NPOT textures are enabled by default.
If you are using cocos2d v1.0, then you have to enable NPOT textures on the ccConfig.h file:
#define CC_TEXTURE_NPOT_SUPPORT 1 // <-- enable NPOT for cocos2d v1.x
Thanks.
PS:
I opened a post at the Apple forum:
https://devforums.apple.com/thread/147591