profiling and debugging your game with pix on xbox 360 · profiling and debugging your game with...
TRANSCRIPT
![Page 1: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/1.jpg)
Profiling and Debugging Your Game with PIX on Xbox 360
Bruce [email protected]
Microsoft, Game Technology Group, Reading
![Page 2: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/2.jpg)
Tools Matter• Greater developer efficiency• Better results: faster, better looking• Educational• Great tools make the job more fun
• Agenda:– Why is PIX a vital tool?– What can it tell you?– Demos!
Performance Investigator for XboxPerformance Investigator for Xbox, Windows, and Xbox 360Performance and Debugging Investigator for Xbox, Windows, and Xbox 360
![Page 3: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/3.jpg)
Why PIX?
• Optimizing– Knowledge is power– Running tests is tedious– Analyzing the results is hard
![Page 4: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/4.jpg)
Why PIX?
• Optimizing– Knowledge is power– Running tests is tedious– Analyzing the results is hard
• Debugging• Understanding the software and hardware
![Page 5: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/5.jpg)
Inside PIX for Xbox 360
• Many profilers in one– System Monitor– Timing Captures– GPU Captures– CPU Trace Captures
• Timing and GPU captures use an instrumented version of D3D– Only mildly intrusive
• System Monitor and CPU Trace Captures work on full release builds
![Page 6: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/6.jpg)
Inside PIX for Windows
• Many profilers in one– Timing information– Full-frame capture– Direct3D call log– Direct3D call stream recording
• Works on full release versions of your games
![Page 7: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/7.jpg)
Default Xbox 360 System Monitor
![Page 8: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/8.jpg)
Tricked Out System Monitor
![Page 9: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/9.jpg)
Adding Custom Counters: Xbox 360
• Call PIXAddNamedCounter once per frame
PIXAddNamedCounter( m_nPhysObj, "Physics Objects" );
• Available in all build configurations, including release
![Page 10: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/10.jpg)
Timing Capture: Timelines
![Page 11: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/11.jpg)
Timing Capture: Events
![Page 12: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/12.jpg)
Adding Event Names: Xbox 360
• Wrap code to be measured in PIXBeginNamedEventand PIXEndNamedEvent.
PIXBeginNamedEvent( 0xFFFFFFFF, "Draw Text: %s",message );
...PIXEndNamedEvent();
• Requires instrumented version of D3D
![Page 13: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/13.jpg)
Adding Event Names: Windows
• Wrap code to be measured in PIXBeginNamedEventand PIXEndNamedEvent.
D3DPERF_BeginEvent( 0xFFFFFFFF, "Draw Hero" );...D3DPERF_EndEvent();
• Requires instrumented version of D3D
![Page 14: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/14.jpg)
GPU Capture: Shader View
![Page 15: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/15.jpg)
PIX for Windows Demo
• A live demo occurs at this point. This demo will show many types of capture and analysis and will be narrated in a witty manner.
• Please wait...
![Page 16: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/16.jpg)
Shader Debugging
![Page 17: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/17.jpg)
HLSL Shader Debugging!
![Page 18: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/18.jpg)
Shaders Tab: Xbox 360
• Pixel Shader• These performance estimates are based upon a static analysis of the shader. Use the "Analysis" tab for a more accurate dynamic analysis.
Cycles/64 pixel vector: ALU 9, vertex 0, texture 4, sequencer 8, interpolator 32
![Page 19: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/19.jpg)
Analysis Tab: Xbox 360Bottleneck SummarySimulation Time: 155370 *************************Shading: 151555
ALU: 19244VS ALU: 4 PS ALU: 19240 ***
Control Flow: 86586VS CF: 6 PS CF: 86580 **************
Texture Fetch: 57720Bilinear/Point: 57720 *********
...Vertex Fetch: 4
Vertices: 4 Vfetch_fulls: 2
Shader Stalls: 64969Vertex Cache: 0 Texture Cache: 64969 **********
...Rasterization and Fill: 124775
Scan and Interpolate: 115440Quads: 115440 *******************Interpolation: 115440 *******************Tiles: 14620 **
![Page 20: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/20.jpg)
Analysis Tab: Xbox 360GeneralMeasured Time: 296Indices: 36Primitives: 12Transformed Vertices: 30Vertex Vectors: 1Quads: 0Tiles: 6Pixel Vectors: 0Non-pipelined Busy: 1033Primitive Type: TRILISTIdeal Fill: 2Max VS Threads: 9Max PS Threads: 30VS Clauses: 2PS Clauses: 1Warning: low vertex thread count due to high GPR usage may hurt performance. Performance simulation may be inaccurate.
![Page 21: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/21.jpg)
Warnings Tab: Xbox 360
![Page 22: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/22.jpg)
Summary
• Tools matter• Learn the available tools• Modify your code and configurations to use PIX
– It's easy
![Page 23: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/23.jpg)
Resources
• PIX for Windowshttp://msdn.microsoft.com/DirectX/
• PIX for Xbox 360https://xds.xbox.com/xbox360/nav.aspx?Page=xdks
oftware/xdkdownload.htm• Live PIX for Windows (August 2005 version)
demo:http://channel9.msdn.com/ShowPost.aspx?PostID=1
09622
![Page 24: Profiling and Debugging Your Game with PIX on Xbox 360 · Profiling and Debugging Your Game with PIX on Xbox 360 Bruce Dawson bdawson@microsoft.com Microsoft, Game Technology Group,](https://reader034.vdocument.in/reader034/viewer/2022042914/5f4df5b5ba6d3f79bc0af136/html5/thumbnails/24.jpg)
Questions?
• Don't forget your evaluation forms