Sponsored By

Sponsored Feature: What's New in PIX for Windows

In this Microsoft-sponsored article, part of <a href="http://www.gamasutra.com/xna">the Gamasutra XNA microsite</a>, the team behind graphics debugging tool PIX explains the improvements in the June 2008 release, also revealing a sneak peek at upcoming additions to the tool.

July 22, 2008

7 Min Read

Author: by XNA Professional Game Platform Tools Team

[In this Microsoft-sponsored article, part of the Gamasutra XNA microsite, the team behind graphics debugging tool PIX explains the improvements in the June 2008 release, also revealing a sneak peek at upcoming additions to the tool.]

PIX for Windows® is a comprehensive graphics debugging/optimization tool that records detailed information about an application's use of Direct3D®. PIX collects data for a single rendered frame or a continuous stream of rendered frames. It can include logs of Direct3D calls made by the application, performance counter data, screenshots, and much more.

With PIX, you can step through the function calls and shader instructions executed by your application and see exactly how the final frame image is constructed. This is a powerful way both to track down bugs and to identify inefficient usage of Direct3D.

This article focuses on the new features and improvements that were made in the June 2008 release of PIX for Windows, which you can find in the DirectX SDK, and gives a sneak peek at what is to come in future versions.


Figure 1. PIX for Windows (click for full size)

Advanced Draw Call Support

The June 2008 version of PIX improves support for draw calls in a number of key areas. The Render view, Mesh view, Pixel History, and Shader Debugger have all been updated to support Direct3D 9's hardware instancing and Direct3D 10's DrawIndexedInstanced, DrawInstanced, and DrawAuto functions.

When viewing instanced geometry in the Mesh view, note that the Post-Vertex Shader tab, Post-Geometry Shader tab, and the Viewport pane now display the vertices and primitives for all instances generated by the original draw call.

Analyzing a particular pixel using the Pixel History or Shader Debugger allows you to drill down to each instance rendered by the instanced draw calls.


Figure 2. Render view support for draw instancing (click for full size)

Predicated draw calls were introduced in Direct3D 10 as a means to skip draw calls on the GPU, without needing feedback from the CPU. For instance, you could conditionally draw some complex object based on whether a lower resolution model of that object, such as its bounding box, is visible. The occlusion test for whether the simple object is visible or not, and the conditional drawing of the complex object, both happen on the GPU without having to deal with the complex threading issues of communication between GPU and CPU. This predication mechanism has been used effectively in professional titles as a simple and powerful way to do scene graph culling on the GPU.

PIX now supports Direct3D 10's ID3D10Predicate objects during capture and when viewing geometry in the Mesh view.

Improved Performance

One of the most common ways to use PIX is in single-frame capture mode. In this mode, the user launches the target program from PIX, navigates to an area where there is a rendering glitch or performance problem, then triggers a capture of a single frame for analysis. With previous versions of PIX, the target program would run noticeably slower while in this mode. This overhead has been drastically reduced in the June 2008 version of PIX, making it much easier to get to the frame of interest. In addition, PIX's overall memory footprint has been reduced, which boosts performance and decreases the likelihood of a memory failure.


Figure 3. A single-frame capture (click for full size)

Additional Direct3D 10 and Direct3D 10.1 Information

PIX now supports a viewer for DXGI swap chain objects, so you can easily examine all the settings for your swap chain. In Direct3D 10.1, the device, blend state, and shader resource view objects have additional fields that are not in the Direct3D 10.0 versions. PIX's viewers for these objects now display this extra information.


Figure 4. Direct3D 10 - Swap chain Information (click for full size)


Figure 5. Direct3D 10 and Direct3D 10.1 - Device Information (click for full size)


Figure 6. Direct3D 10.1 - Shader Resource View Information (click for full size)


Figure 7. Direct3D 10 and Direct3D 10.1 - Blend State Information (click for full size)

System Configuration Information

While analyzing the target program, PIX collects performance and event data into a "run" (.PIXRun) file. PIX now also collects the system configuration information and stores it in that same run file. This makes it much easier, when looking at a run file, to determine if the configuration of the system on which the run file was recorded matches the capabilities or configuration of the system upon which the run file is being analyzed or played back.


Figure 8. System configuration Information (click for full size)

Improved Error Handling

Extensive error reporting was added throughout PIX to provide detailed information about problems when recording or playing back a run file. This information is useful in identifying differences between systems when playing back the same run file on different hardware.

What's Next

Here's what to expect in upcoming releases of PIX for Windows.

Draw call timing for single-frame captures

PIX will calculate GPU-side timing information for Direct3D 9 and Direct3D 10 draw calls when performing single-frame captures or during playback.

Improved 32/64-bit support

PIX will have improved 64-bit support and cross-platform compatibility. We have fixed some issues with captures of 64-bit applications. Run files can be played back on either platform regardless of whether the original application was 32-bit or 64-bit. By using the 64-bit version of PIX to analyze your application, you can take advantage of the larger address-space available on 64-bit Windows and reduce the chance of running out of memory.

Improved application support

PIX will have improved support for applications that call both Direct3D 9 and Direct3D 10. It will also be able to safely capture data from multithreaded applications.

Output Messages tab

A new Output Messages tab will be available to better expose debug output from the Render, Mesh, and Shader views. You will be able to filter messages by view and sort them by event ID, timestamp, and type, as well as copy them to the clipboard.

Render tab

As you move through the draw calls in a run file, the Render view continues to display the back buffer on Present calls, but for other calls it now displays the currently-bound render target. Also, the status bar will show the surface format information. In addition, pencil icons appear on all the tabs of surfaces or textures that are currently bound to the device as render targets.

Buffer Data view

The performance of the Buffer Data view will be significantly improved. Large buffers are no longer painfully slow to examine.

Summary

PIX for Windows is an incredibly useful tool for analyzing Direct3D applications. The new improvements to PIX in June 2008 make it even more valuable for identifying performance bottlenecks and deeply understanding how Direct3D is behaving in the context of your application.

The PIX for Windows team has made huge strides in improving the performance of PIX, adding new support for Direct3D 10, and making it a robust tool for everyday usage. Expect continuing improvements to PIX in the near future.

Related Articles

GarageGames: A PIX debugging session

Channel 9: Mike Burrows - PIX, graphics performance analysis

Community

Microsoft Discussion Groups: DirectX Graphics

Read more about:

Features
Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like