《微软出品简洁色块型PPT.pptx》由会员分享,可在线阅读,更多相关《微软出品简洁色块型PPT.pptx(33页珍藏版)》请在三一文库上搜索。
1、Building a High Performance 3D Games for Windows Phone Adam Schaeffer Microsoft Corporation SESSION CODE: WPH308 Consistent sets of hardware capabilities defined by Microsoft Windows Phone 7 Hardware Resolution Touch Input CPU / GPU RAM Hardware keyboard is optional The CPU The Evolution Of Programm
2、ing Low level control Straight to the metal Raw performance tuning High level abstraction Rely on compiler and runtime Developer productivity Why C# r0x0rz Powerful and expressive Type safety reduces hard-to-track-down bugs Reflection Initializer syntax Great tooling (IntelliSense) Similar enough to
3、 C that learning and porting are easy Blazingly fast compiles C# .NET on Windows Usually within a few percent of native performance Awesome generational garbage collection Performance shootout: Raymond Chen vs. Rico Mariani http:/ .NET on Xbox 360 360 Significant delta between managed and native .NE
4、T Compact Framework Simplistic mark-and-sweep garbage collection Xbox is not a general purpose computer Unforgiving in-order CPU architecture Requires custom VMX instructions for optimal math perf Security architecture poses challenges for jitted code .NET on Windows Phone 7 In between Windows and X
5、box 360 .NET Compact Framework Keep an eye on garbage collection! ARMv7 CPU More forgiving toward jitted code ARM jitter is more mature than PPC Ways To Call Code Instance method Interface Delegate / event Reflection Virtual method Choose Your Own Address C+ allows independent choice of .NET types d
6、ictate their allocation and usage semantics Data type The memory in which a type lives (placement new) How a type instance is referenced (T, T*, T A Balancing Act Pixel Cost Prefer cheaper effects Minimize overdraw Many known algorithms: Distance, frustum, BSP, sort front to back Implement “overdraw
7、 x-ray mode” Draw untextured with additive blending Brighter areas indicate overdraw A Balancing Act Number of Pixels 800x480 is 25% more pixels than Xbox 1 Great for text Too many pixels for intensive games 800x480 = 384,000 pixels 600x360 = 216,000 pixels (56%) Dedicated hardware scaler Does not c
8、onsume any GPU Higher quality than bilinear upsampling Scaler Demo XNA Framework API Cheat Sheet AvoidPrefer RenderTargetUsage.PreserveContentsRenderTargetUsage.DiscardContents device.BlendState = new BlendState .;/ At startup static BlendState myState = new BlendState .; / Per frame Device.BlendSta
9、te = myState; VertexBuffer.SetData(.)device.DrawUserPrimitives(.); / or DynamicVertexBuffer.SetData(., SetDataOptions.NoOverwrite); Summary Great performance comes from great knowledge Understand Actions Value types vs. reference types Garbage collection C# compiler magic (foreach, iterator methods,
10、 closures) Cost of the different graphical effect options Use CLR Profiler and .NET Reflector Render smaller than display resolution, rely on scaler 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or t
11、rademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. JUNE 7-10, 2010 | NEW ORLEANS, LA Required Slide
链接地址:https://www.31doc.com/p-4294921.html