My program is a 2d game which involves much 2d blit operation.
At first ,I wrote it using SDL ,and run it on omap3530.
it works well when there is few blit.
When there are a lot of 2d blit operation , the performance can't
There are about 2M bytes png files and update the screen 24 frames
I found the cpu occupation is about 99.7% and program runs very
In order to improve the performance. I tried SGX. From my
experiment , the performance is ok.
But using SGX has a problem. SGX only support 16-bit Framebuffer
Operation. and the picture is not perfect.
I want to use SDL, but how to implement the blit operation using
Is there any clues about how to implement 2d blit operation using
Any idea is welcome.
Thanks for your time.
I would say that using the SGX is the way to go.
Keep all your source data at 24bit as I'm sure one day the SGX will
The NEON is more for accelerating maths and I imagine you are fill
rate limited which will be limited by memory access times rather than
the CPU performance, the SGX can help with this if you use opaque
polys whenever possible.
Out of interest what res are you running at? How many blits per frame
are we talking min & max?
I've now had a lot of experience getting a game running on the
Beagleboard using the SGX and I've managed to get a game with a fairly
detailed ground mesh, animated skeletons, particles, physics, AI,
complicated game logic engine running at at least 30fps with many
optimisations to go. Trust me, it has plenty of power, truly amazing
for such a small device.
the fill rate with the system dma, dsp, or arm+neon should be faster than with the sgx due to the clock speed of the sgx. the sgx is great for 3d ops, but not so much for blts. you might get some ideas from the neon optimized libpixman, but i think if you aren’t using the dsp, you could off load the blts in parallel with other ops.
The idea is that you use the SGX to do blits by rendering textured polygons. The tile based deferred rendering can significantly reduce the amount of fill rate (the degree of which will greatly depend on your scene).
A general good rule of thumb for doing 2d games is that if there is 3d hardware on the platform then you should use it.
Thanks for Mark and Jason 's comments.
My game’s logic is simple.
There are backgound and some cartoons like people,house ,etc.
background and cartoons are moving.
Every frame , modify cartoon’s postion. and update screen.
So fps should be more than 24 in order to get coherent scene.
the pseudocode is like below:
Regulate_sys_time(24); // set 24 fps
My test shows if we use SDL, Loading png costs a lot of time ,which is about several seconds.
So does SDL blit operation.
The more png file , the slower the game run.
Is there any function to replace SDL_blit function in SGX?
If there is , rewriting my programe will get easy.
How could I make use of dsp of omap3530?
Is there any document/wiki about using dsp under Angstrom?
By the way, since libpixman has been neon-optimized, if can I use libpixman API to replace SDL blit operation directlly?