A new kind of fraps

BrightCandle

Diamond Member
Mar 15, 2007
4,762
0
76
I am quite interested in microstutter and various factors of performance within frames. One thing I am quite interested in is the slowing down of frame production to the frame rate by the graphics card on the DirectX present call.

I have written some custom software capable of doing this, which hooks into a program in a similar way to fraps but instruments to a finer level of detail. On a very simple D3D9 program running within a Window (so Vsync is on) on a 120Hz monitor I am seeing the following timing points at the beginning of a trace:

Code:
beforePresent	afterPresent	Backpressure
0.26                     4.85                  4.59
4.88                   10.58                  5.7
10.6                   18.46                  7.86
18.47                  26.63                  8.16
26.64                  35.12                  8.48
35.13                  43.29                  8.16
43.3                    51.63                 8.33
51.64                  60.12                  8.48

Basically what is happening is that the Present call made to DirectX is dependent on the GPU and its drivers. If there is space for the frame on a GPU or on a queue into the GPU then the frame should be accepted without much delay and the present call should return immediately. By looking at the time before the call and after we can see how much time the present call actually took and what regulation the GPU and its drivers was doing to the games thread.

The backpressure is just afterPresent - beforePresent. As you can see this program is initially producing frames quite rapidly, faster than the GPU can cope but within 3 frames the program is slowed by the back pressure to ~ 8ms. Now because this program is vsynced its interesting to even see that the program can produce more frames than 120hz, so those initial frames are being queued in the context queue. This is a program that could likely produce 1000s of frames per second if not regulated by vsync so don't read too much into its performance, I'll add some games soon enough.

I thought the concept might be interesting to some of you.
 

BrightCandle

Diamond Member
Mar 15, 2007
4,762
0
76
This tool starts to offer us insight into the simulation stutter, whereas FCAT looks at the frame stuttering as it comes out. You need both.
 

Black Octagon

Golden Member
Dec 10, 2012
1,410
2
81
Interesting. I don't suppose you have any way to do this in DirectX full-screen so that comparisons can be made with Vsync off?
 

BrightCandle

Diamond Member
Mar 15, 2007
4,762
0
76
Of course it will work with fullscreen apps. Its being tested on a simple program to have less factors involved so I could get the concept tested earlier.
 

bystander36

Diamond Member
Apr 1, 2013
5,154
132
106
I wonder how well this would work with multi-GPU setups. Can you tell which card is presenting which frame? If so, that would be a great method to measure frames delivery.
 

BrightCandle

Diamond Member
Mar 15, 2007
4,762
0
76


Backpressure verses frame time, still in a sample program. Interestingly all the stutter introduced into the game is caused by the GPU and its drivers, not by the game itself.