PIX win is the direct3d file attached to the DirectX SDK.ProgramThe debugging and analysis tool is used for d3d applications. If the developer of d3d needs to collect and analyze the call and execution information of the application to the 3dapi, this tool is a good choice. For example, you need to know whether the background rendering target, depth buffer, and template buffer are correctly rendered during a rendering process, alternatively, you can use this tool to debug whether a d3d object is correctly released at a frame. Of course, this tool cannot be used in OpenGL programs. I used this tool in the optimization of a product. I found no introduction to this tool except the msdn documentation after searching, here we will give a brief introduction from the user's point of view, hoping to share d3d program optimization experience with friends who have used and will use this tool.
1. tool interface
Reference: msdn pix documentation
Figure 1 create an experiment in the PIX
Create an experiment using the PIX. After running the experiment, extract the call of the d3d application and generate a call record file. It is often used to create an experiment, specify a shortcut key, capture the API call when the key is triggered, and then set to automatically save it to the experiment running file (*. pixrun), and the experiment settings can be saved as a small experiment file (*. pixexp ). The interface is displayed when the program exits or when the lab record is opened. It is the main interface diagram borrowed from Wikipedia, which shows the recording result of the program.
Figure 2 pix debugging and Analysis page
The four views in Figure 2 show the timeline, Object List, event list, rendering target, and object view views respectively. In the event, you can switch the recorded frame and expand the tree list to see the call status, parameters, and returned values of the d3d/d3dx function in this frame. The blue is the address, which represents an object pointer. You can click it to display it on the right. When you select a frame, some objects in the object view become alive, which means this object is available in this frame. You can double-click it to view it. The figure shows the 2,727th function calls in a frame, which is a settexture call.
The rendering and object view lists the attributes of an object. You can set filtering and sorting on the top. Each column shows the time when the object was released (the first frame ), reference Counter, resolution, and other information. It should be noted that only when a frame is selected in the event list and the render window in the object viewer in the lower right corner is opened can the object become available. When the object is available, double-click the object in the object list or double-click the pointer in the event list to display it in a new window. A bug may exist in the version I used. If 2nd objects are displayed, they will crash. Therefore, an object may need to view the tag before opening the next object. In Figure 2, the view in the lower-right corner shows a surface.
2. Experiment Content Overview
To use the PIX to test the application, you need to create an experiment. In this experiment, you need to set the path and running parameters of the application, and select the project to be tested, after selecting all the test parameters, you can start the test. These test parameters can be saved as a script file and can be tested repeatedly later.
Location of this tool:
Microsoft DirectX SDK (June 2006) \ utilities \ bin \ x86 \ pixwin.exe
The complete documentation of this tool is located at the following position of the help document:
DirectX software development kit \ directxtools \ pix
If you open the help document and search for it, you can enter the PIX to quickly locate the document and start the tool from the Start Menu.
This article aims to introduce the use of this tool from the perspective of users rather than Ms.
Items that can be tested or documented include:
(1) Each frame calls the d3d/d3dx function and its parameters. A single frame or a frame can be recorded multiple times;
(2). Capture the screen;
(3 ). the counter of each frame is displayed on the screen in a curve, including the number of triangles for submitting DP, dip, dup, duip, setrenderstate, settexture, and other requests, statistics items can be set flexibly;
(4) device modification;
(5). Intercept draw calls;
(6) Save the device status to a file;
(7) record the API call data, including texture, vertex, and index data. During re-painting, you can view all submitted textures and complete texture data;
(8 ). save the experiment record and save all the data processed in the experiment to a file. Of course, if you keep a complete record of all frames, the file may be large. Generally, only the key points are recorded. The experiment records can be separated from the original EXE and resource usage. If you need to analyze the experiment records later, you only need this file.
After saving the experiment data, you can view it repeatedly, including the saved frames.
With these test items, you can check whether your application has submitted the correct state and release the texture that is no longer used. If a texture is available at a frame, when the rendering window in the tool is still activated, this texture will be available. You can view various data (vertex, index, shader programs displayed in disassembly form) surface (texture, surface, etc ).