View Single Post
  #7  
Old 06-02-2012, 04:55 AM
Hezzy002 Hezzy002 is offline
Registered User
Join Date: Jul 2011
Posts: 247
Hezzy002 is a jewel in the roughHezzy002 is a jewel in the rough
You shouldn't use too many layers, it can get expensive from a rendering perspective. Graal allocates a buffer to render to for each layer, because when you don't move, tiles are not rendered as polygons, but as a pixel buffer. When you move, the pixel buffer is shifted and only the edges redrawn.

While this technique sounds like a good idea, there's a few drawbacks. It saves rendering time, but is expensive on VRAM. When VRAM budgets are exceeded, Graal is forced to perform deallocations. Deallocations are quick, but loading the images back into memory is slow and runs on the same thread in Graal, so it blocks. Since you're taking up parts of VRAM with the buffer each tile layer draws to, Graal, especially on mobile devices, is going to be forced to deallocate images frequently, which isn't so bad, but it means that it's going to have to reload them from file way more frequently now, which can take several seconds of freezing on an iDevice.

Now the real kicker is that allocating 7 buffers for 7 layers on a touch device will cost 7 MB of VRAM. Now, when I says VRAM, it's a slot of 24 MB in RAM reserved for video. Exceeding that budget will force the VRAM sector to move memory around between the other sectors, causing significant performance hits.

This applies super hard on lower end devices. And be thankful that Graal doesn't run at retina resolutions. If it did, it would cost 49 MB for 7 layers.
Reply With Quote