Reports statistics about a frame.
typedef struct _DXGIX_FRAME_STATISTICS {
// CPU time line
UINT64 CPUTimePresentCalled;
UINT64 CPUTimeAddedToQueue;
UINT32 QueueLengthAddedToQueue;
//
// GPU time line
UINT64 CPUTimeFrameComplete;
UINT64 GPUTimeFrameComplete;
UINT64 GPUCountTitleUsed;
UINT64 GPUCountSystemUsed;
//
// Display time line
UINT64 CPUTimeVSync;
UINT64 GPUTimeVSync;
UINT64 CPUTimeFlip;
UINT64 GPUTimeFlip;
UINT64 VSyncCount;
FLOAT PercentScanned;
//
VOID * Cookie[2];
} DXGIX_FRAME_STATISTICS;
CPUTimePresentCalled
The runtime calls QueryPerformanceCounter at the time DXGIXPresentArray is called by the application and records the value in this member. This value can be used in conjunction with the CPUTimeAddedToQueue member to know how long the runtime needed to wait before the frame could be queued to the present queue. A long wait typically indicates that the application has reached the queuing limit imposed by the runtime, which is equal to the number of buffers in the swapchain (that is, if the swapchain has two buffers, the third Present will wait until the first Present is displayed).
CPUTimeAddedToQueue
The runtime calls QueryPerformanceCounter at the time the frame is added to the internal present queue, and records the returned value in this parameter.
QueueLengthAddedToQueue
How backed-up or empty the present queue was when DXGIXPresentArray was called. This member records the time after the wait (if any), not before the wait.
CPUTimeFrameComplete
The runtime calls QueryPerformanceCounter at the time the GPU completes rendering the frame that is to be presented, and interrupts the CPU for this purpose.
GPUTimeFrameComplete
This is the same as the CPUTimeFrameComplete member, except that the value recorded is the GPU clock at the time frame rendering completed.
GPUCountTitleUsed
Reports the number of GPU clocks within a given frame that were used by the title.
GPUCountSystemUsed
Reports the number of GPU clocks within a given frame that were used by the system for SRA or NUI workloads.
CPUTimeVSync
The runtime calls QueryPerformanceCounter at the time the VSync interrupt was received by the CPU, and records the value in this field.
GPUTimeVSync
This is the same as CPUTimeVSync, except that the value recorded is the GPU clock at the start of the VSync, or more precisely, at the start of the vertical blanking interval.
CPUTimeFlip
The runtime calls QueryPerformanceCounter at the time the frame is displayed out for viewing; that is, when it is “flipped” and records the value in the CPUTimeFlip member.
GPUTimeFlip
This is the same as CPUTimeFlip, except that the value recorded is the GPU clock at the time the flip occurs.
VSyncCount
This is a monotonically increasing number that indicates the VSync number at which the flip occurred.
PercentScanned
What percent of the frame was scanned (if any) when the driver flipped to the current frame.
Cookie
An optional per-plane pointer supplied by the application when it calls DXGIXPresentArray. Can be used to correlate application-side data to a particular frame.
This structure is returned by DXGIXGetFrameStatistics and by the equivalent function pointer, PFN_DXGIX_GET_FRAME_STATISTICS.
The exact frequency of the CPU for “CPUTime” members is obtained by calling QueryPerformanceFrequency call.
The exact frequency of the GPU timestamp counter for “GPUTime” members is defined by the #define D3D11X_XBOX_GPU_TIMESTAMP_FREQUENCY.
The CPU Timeline data is valid immediately after Present is called. When CPUTimeFrameComplete or GPUTimeFrameComplete becomes non zero, the GPU timeline is valid. When CPUTimeVsync or GPUTimeVsync become non-zero, the display timeline data is valid.
Header: Declared in d3d11_x.h.