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.
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.
This tutorial adds a frame captures to the Triangle application described in Simple Triangle.
Microsoft::WRL::ComPtr<ID3D11DeviceContextX> m_perf;
For D3D12x apps:
Microsoft::WRL::ComPtr<ID3D12DeviceContextX> m_perf;
m_d3dContext.As(&m_perf);
HRESULT hr = m_perf->PIXGpuCaptureNextFrame(0, L"D:\\TriangleCap.pix3");
xbcp xD:\TriangleCap.pix3 /x/title c:\GPUCaptures
c:\GPUCaptures\TriangleCap.pix3 file in PIX.