Monday, August 13, 2007

GAINING SOME PERFORMANCE ON XNA GSE

Man! I really need to get Shawn' slides ... very useful info and tips to program game using XNA GSE, both for Windows and the 360. He covered many areas, like graphics, math, threading and profilin tools.

Hereunder you will find some bullets:

  • Graphics: Shawn mentioned things like the spritebatch, then shaders, materials and effects, and finally renderstates. Some conclusions: use the GPU the most you can, don't forget to set SpriteSetMode, undesrtand the 360 system's calls and avoid the use of states blocks.
  • Math: is incredible how one can gain some performance by passing structs by reference and inline some computation. About the latter, constructs can be manually inlined (an example was provided). Those of us who have experienced .NET Framework 3 and 3.5 do know that the way this is handled in those versions of the .NET framework is quite handy.
  • Threading: a must! To take advantage of this feature on the 360 one have to understand how the cores and threads per core are organized as well as the fact that one must manually assign threads to the 360's cores (this is not done automatically for you). Also take due note that the Content Manager is not thread-safe and input handling is not threadable on windows (meaning, it has to run on the main thread, always).
  • Profiling Tools: there is not much help on the 360 to identify bottlenecks, thus, profile on windows and do some inference (of course, remember the way the compact framework deals with the GC and generations).

There were more points to mention about Shawn's presentation plus plenty of smart questions, but you'll have to watch the webcast later to get all of them ... ;)

Phew! ... a 30 minutes brake. Thanks so much! I need some rest ...

No comments:

Post a Comment

Any thoughts? Post them here ...