PIX GPU Captures

Your code can capture GPU timing data, by calling the PIX GPU Capture methods. The GPU capture methods capture the same data as using Capture Next Frame from within PIX. The methods provide code level control over the frame to be captured or when the captures start and end.

Methods for GPU capture

There are three methods in the ID3D11DeviceContextX, and ID3D12DeviceContextX, interfaces. Information is captured to a log file on the console. The file has the “.pix3” extension, and needs to be copied to the development PC for analysis.

Tutorial for GPU capture methods

This tutorial adds a frame captures to the Triangle application described in Simple Triangle.

  1. Write the simple triangle app described in Simple Triangle, if you have not done so already.
  2. Ensure that the app is prepared for PIX profiling.
  3. Add the following line, declaring the interface, to the private section of the game class, in game.h:
    For D3D11x apps:
    Microsoft::WRL::ComPtr<ID3D11DeviceContextX>  m_perf;  
    

    For D3D12x apps:

    Microsoft::WRL::ComPtr<ID3D12DeviceContextX>  m_perf;  
    
  4. Initialize the m_perf object by adding the following line to the end of the CreateDevice method in game.cpp.
    m_d3dContext.As(&m_perf);  
    
  5. Add the following line to the Tick method, to capture the next frame.
    HRESULT hr = m_perf->PIXGpuCaptureNextFrame(0, L"D:\\TriangleCap.pix3");  
    
  6. Open the Xbox One XDK Command Prompt window and use the remote tools to copy the data file to a suitable folder on the development PC.
    xbcp xD:\TriangleCap.pix3 /x/title c:\GPUCaptures  
    
  7. Open the c:\GPUCaptures\TriangleCap.pix3 file in PIX.

See also

Using PIX for GPU performance

PIX

PIXBeginEvent

PIXEndEvent

PIXSetMarker