I’m recently working some hours more on the engine (LAIN) for the iPhone version of one of our upcoming games, FALLEN. One problem that arouse is that internal functions for images loading from the iPhone OS are both not thread safe with OpenGL ES (for example if you are loading in the background an image with glTexImage2D while you are rendering chances are that there is a pthread crash coming especially if the file is large). Moreover there is another terrible problem… they are SLOW. In the end I made my custom loaders for a set of data formats and had improvements both in speed and control over the creation process. To set up an efficient loader for formats like JPG or PNG or PCX wasn’t complex since I had them already for the other versions of the engine on other platforms (like PC tool and DS), but that’s really strange how some operations end up being slower than they should.. I think that some code must be done in asm (especially the DCT calculation and the AANSCALE decompression). The worst feeling that I have is that I don’t have a fast memory to access to store the quantization table inside. Due to the zigzag filter that means a lot of casual access right now to memory that yes enters the cache, but probably is getting out soon as the plane decompression proceeds. Honestly I would like to know if there is a way to control what’s inside the cache more efficently and have more info on that, but Apple is not providing too much of that low level info that for a programmer like me is really frustrating. I’ll see what I can get in the next week of work, since there is a lot of time to spend on other elements of the engine as well. But a good note for myself is to check in the next days a coherent way to better manage the code. On DS i had my D/I TCM that was helping
… that made a lot of difference. I felt bad it was a little short in resources ( DTCM is small and is eaten by the STACK that lies inside it) but at least having a KB or 2 of damn quick and controlled memory was sweet
CtU.
Very nice blog.
I did not understand one or two lines of this post.. but I don’t care.
=P