Gets timing and other information about frames that have been already displayed in real-time.
HRESULT DXGIXGetFrameStatistics(
UINT NumberFramesRequested,
DXGIX_FRAME_STATISTICS *pStats
)
NumberFramesRequested
Type: UINTÂ
[in] How many frames to obtain statistics for.
pStats
Type: DXGIX_FRAME_STATISTICSÂ *
[out] An array of frame statistics, as a pointer to an array of DXGIX_FRAME_STATISTICS structures. The array will contain at least NumberFramesRequested elements. The statistics are returned in temporal order; that is, element 0 will contain statistics for the most recent frame that was queued or presented, element 1 will contain statistics for the frame prior to that, and so on.
Type: HRESULTÂ
This function returns one of the Direct3D 11 return codes.
This function obtains timing and other information about frames that have been already displayed in real-time. This information is useful for the application because it allows the application to vary the content of frames rendered in the future to match the latency between calls to DXGIXPresentArray and when the presented frame is actually displayed out for viewing. DXGIXGetFrameStatistics also allows the application to know whether it is queuing more frames than the rate at which they can be displayed or if it is not generating frames quickly enough.
The history buffer in the runtime currently holds only enough space for the past 17 queued and displayed frames.
For queued, but not displayed frames, in the DXGIX_FRAME_STATISTICS structure, only CPUTimePresentCalled, CPUTimeAddedToQueue and QueueLengthAddedToQueue will contain actual, valid data. The elements that correspond to queued but not displayed frames will have VSyncCount set to zero. For example, if currently 4 frames are queued and 13 have been displayed, if NumberFramesRequested is 16, the first 4 elements will have VSyncCount set to zero and the last 12 elements will have VSyncCount set to the actual non-zero data that is returned.
Header: Declared in d3d11_x.h.
Library: Use d3d11_x.lib.