- 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:
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.
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.