synkro
0xdeadbeef
As I was recently coding a simple particle system, I was wondering what is the best way to keep the blitter busy. I just went with a traditional approach:
CODE
<update all particles>
<draw all particles>
Because of the asynchronous nature of the blitting I am doubting this approach. The idea is, while the blitter is busy drawing one particle you could update the next one. This might be the better approach:
CODE
...
<update particle>
<draw particle>
<update particle>
<draw particle>
...
But you can also argue that the average game loop update and render calls are already interleaved enough.
CODE
<update backgroud>
<draw bakcground>
<update layer 1>
<draw layer 1>
...
<update particles>
<draw particles>
In YOUR experience, what granularity seems to be more beneficial? Did anyone actually try to profile both? As I am a lazy bum I am asking YOU. The deciding factor for me is the length of the blitter queue. After how many blitting request doe the blitter discard blit requests? Is this a fixed number or does it depend on the number of pixels to blit?
CODE
<update all particles>
<draw all particles>
Because of the asynchronous nature of the blitting I am doubting this approach. The idea is, while the blitter is busy drawing one particle you could update the next one. This might be the better approach:
CODE
...
<update particle>
<draw particle>
<update particle>
<draw particle>
...
But you can also argue that the average game loop update and render calls are already interleaved enough.
CODE
<update backgroud>
<draw bakcground>
<update layer 1>
<draw layer 1>
...
<update particles>
<draw particles>
In YOUR experience, what granularity seems to be more beneficial? Did anyone actually try to profile both? As I am a lazy bum I am asking YOU. The deciding factor for me is the length of the blitter queue. After how many blitting request doe the blitter discard blit requests? Is this a fixed number or does it depend on the number of pixels to blit?