forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Julia set demo

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS3 Linux Development
View previous topic :: View next topic  
Author Message
ralferoo



Joined: 03 Mar 2007
Posts: 122

PostPosted: Mon Mar 05, 2007 5:07 am    Post subject: Julia set demo Reply with quote

Well, I never figured out how to get DMA working with libspe2 (see my other post), but the first day's hacking has been quite productive.

I've written an hand-optimised assembler Julia set demo, and it gets some quite impressive results. On a demo designed to avoid much black, I get the following results:
Code:

stats-1080i.txt:Average framecount over 1700 frames: 90.9 FPS
stats-1080p.txt:Average framecount over 1700 frames: 90.8 FPS
stats-480i.txt:Average framecount over 1700 frames: 469.3 FPS
stats-480p.txt:Average framecount over 1700 frames: 469.3 FPS
stats-576i.txt:Average framecount over 1700 frames: 393.9 FPS
stats-720p.txt:Average framecount over 1700 frames: 199.3 FPS

and the results from a demo over areas with lots of black bits is pretty good too!

For those that are interested, the inner loop uses SIMD vectors and actually calculates 16 pixels at once. I've also unrolled the inner loop three times for good measure!

I've created a page at http://ranulf.net/ps3/ for the demo sourcecode and will keep it up-to-date with any other demos I write in the future.

The best demo to run is
Code:
make test
although
Code:
make time
shows performance at near optimal places and
Code:
make stats.txt
determines speed at various resolutions. Please make sure your monitor is off at this point if it can't handle all resolutions (note that I also test against PAL 576i as that's what I'm developing with!)

Apologies that the webpage looks pretty ugly - my webserver crashed a couple of weeks ago and I haven't bothered to restore all the old site... :(
Back to top
View user's profile Send private message Visit poster's website
ralferoo



Joined: 03 Mar 2007
Posts: 122

PostPosted: Mon Mar 05, 2007 5:14 pm    Post subject: Re: Julia set demo Reply with quote

ralferoo wrote:
Well, I never figured out how to get DMA working with libspe2 (see my other post), but the first day's hacking has been quite productive.

I should probably explain that that comment means that I'm using libspe rather than doing this without DMA... Just in case... :)
Back to top
View user's profile Send private message Visit poster's website
Arwin



Joined: 12 Jul 2005
Posts: 426

PostPosted: Fri Mar 09, 2007 11:25 pm    Post subject: Reply with quote

Could you post a screenshot for those not yet in possession of a PS3?
Back to top
View user's profile Send private message
ralferoo



Joined: 03 Mar 2007
Posts: 122

PostPosted: Sat Mar 10, 2007 7:08 pm    Post subject: Reply with quote

Arwin wrote:
Could you post a screenshot for those not yet in possession of a PS3?
As I've not written anything to save the screen from the PS3 yet, the best I can offer is a low-res camera shot of the program running on an old PAL TV. Doesn't do it any justice, but if you really want it... http://www.ranulf.net/ps3/pictures.php
Back to top
View user's profile Send private message Visit poster's website
ralferoo



Joined: 03 Mar 2007
Posts: 122

PostPosted: Sat Mar 10, 2007 7:19 pm    Post subject: Reply with quote

So, I was reading article 4 in the IBM series on SPE programming and I realised that my attempt at unrolling was almost futile as I'd unrolled to avoid branching rather than taking into account the processor pipeline.

So, I reordered the instructions in the main loop and got over 1.5x speed improvement.

The new results are:
Code:
stats-1080i.txt:Average framecount over 1700 frames: 155.0 FPS
stats-1080p.txt:Average framecount over 1700 frames: 154.9 FPS
stats-480i.txt:Average framecount over 1700 frames: 791.5 FPS
stats-480p.txt:Average framecount over 1700 frames: 793.1 FPS
stats-576i.txt:Average framecount over 1700 frames: 664.0 FPS
stats-720p.txt:Average framecount over 1700 frames: 341.0 FPS

Not bad, especially as I know there are other areas that can be easily improved - e.g. the SPU always initiates DMA then waits for it to complete before continuing rather than having DMA running in the background.

I've uploaded the new version to my site http://www.ranulf.net/ps3 and this new code includes some experimentation with controller - the right stick pans around the image, the left stick changes the julia constant and right triggers zoom in and out and circle quits.

It's obvious that IEEE floats aren't good enough once the user is in control of the zooming; I'll be looking at rewriting using fixed precision or IEEE doubles.
Back to top
View user's profile Send private message Visit poster's website
ralferoo



Joined: 03 Mar 2007
Posts: 122

PostPosted: Mon Mar 12, 2007 4:51 am    Post subject: Reply with quote

ralferoo wrote:
Arwin wrote:
Could you post a screenshot for those not yet in possession of a PS3?
... the best I can offer is a low-res camera shot of the program running on an old PAL TV. http://www.ranulf.net/ps3/pictures.php
I've added a photo of a 720p projector image to the bottom of that page. It's a bit better but still not brilliant!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS3 Linux Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group