This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Rasterizer thoughts


Rasterizer thoughts

Postby Johan » May 16, 2002 @ 11:55am

User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby Kzinti » May 16, 2002 @ 5:24pm

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Johan » May 23, 2002 @ 11:18pm

User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby Kzinti » May 24, 2002 @ 6:22pm

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Johan » May 25, 2002 @ 10:47am

User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby Kzinti » May 25, 2002 @ 7:59pm

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Johan » May 28, 2002 @ 1:06am

Hi! I'm back again. :)

I have now checked multiple cases of C to ASM code (using both EVC and VSNET) and came to the conclusion that the compiler is pretty smart.

Both my suggestions for improval above were totally irrelevant. The compiler will always output optimized code in these cases.

Also, I actually managed to get templates to work in my own implementation (despite all the different options in every blit function). It was a really smart move you did by passing a struct containing the operator() as a parameter. If I haven't seen your solution with structs I would never have finished my own solution this fast. Right now I have three operators: SourceColor (source bitmap/colorfill), PixelVerifications (check mask or always copy) and PixelOperations (copy/alpha/alphafast). I also made a bunch of others such as coordinate transforms (fixed point etc). Basically I was able to cut back all code to only one loop for each operation, which at compile time expands to up to 12 different combinations. Studying the ASM output the compiler actually does a 1:1 job of compiling the expanded templates as compared to expanding all loops in code.

I'll post my template findings in a new post when I have cleaned up the design a bit. I will also look into double pixel processing (something which is currently not done and should improve performance considerably in all operations).

By the way. Check out this screen shot. With the new optimized "templated" code I managed to squeeze over 140 alpha blended sprites in my demo (170 sprites without opacity). :) Kind of cool, and not really possible to achieve without using templates (without templates the only choice I guess is to (1) add IF statements to the inner loop resulting in less performance, or (2) expand all possible loops, which in my case were 12 different ones)...

<img src="http://www.gapidraw.com/demo_alpha.jpg">

/Johan
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby Kzinti » May 29, 2002 @ 7:31am

Glad you could learn a few things from my design =)

I am looking forward to read about your findings using templates.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Return to PocketFrog & PocketHAL


Sort


Forum Description

SDKs for fast and robust device-independent access to Pocket PC display hardware.

Moderators:

sponge, Kzinti

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron