The first step in using PIX is to capture some data from your game. This is done via the PC Connection view, which is the first thing you will see when launching PIX:
To take a PIX capture:
- Launch or attach to a target process. When launching a new UWP or Win32 application, you can choose whether to Launch For GPU Capture. This instructs PIX to insert necessary instrumentation while the game is starting up. When attaching to an already running process, it is not possible to take GPU captures. On newer versions of Windows (October 2018 Update onwards), you will be able to select the API to capture:
- Default – use this to capture applications that only call D3D12 APIs
- D3D12 (Force11on12) – use this to capture D3D11 or mixed D3D11/D3D12 applications.
- D3D12 (Ignore D3D11) – use this to capture mixed D3D11/D3D12 applications with all D3D11 APIs ignored
- Optionally expand the Options for your chosen capture type to adjust details of what will be captured.
- Click the icon to the left of your chosen capture type to collect the data. When the target is launched for GPU capture, you can also take captures by pressing the PrintScreen key while the game has focus.
All the different capture types can be saved as PIX capture files, which have a .wpix (formerly .pix3) extension. If you take more than one GPU capture in a row while connected to the same process, these will all be saved into a single .wpix file.
Some games use one or more launcher executables, which display a splash screen or menu before creating a different process that hosts the actual game. PIX GPU captures are able to follow through this tree of processes, but other capture types only record data from the specific process that they launched or attached to, so if your game uses multiple processes you will need to bypass any launchers and tell PIX how to directly start the main game executable instead.
It is also possible to programmatically control when a GPU capture should be taken from inside your game code.