Sign in to follow this  
Malder1

Strange numbers in log file for vsync D3D fullscreen when FPS becomes low

Recommended Posts

Malder1    122
Please explain me how video card works in vertically synchronized D3D fullscreen mode when application can't prepare next frame and FPS become low: Usually my log file contains such time interval between frames (for 100 Hz refresh rate): 10 ms. 10 ms. 10 ms. 10 ms. and etc. If some frame renders too long I see jerk on the screen and my log file shows: 10 ms. 10 ms. 23 ms. 5 ms. 5 ms. 10 ms. 10 ms. and etc. But if we use vsync fullscreen mode how these numbers are possible? I thought it should be 20 ms. or 30 ms., but not 23 ms. And next two frames were rendered to quickly - only 5 ms.! Or it's a wrong values because I use QueryPerformanceCounter or TimeGetTime.

Share this post


Link to post
Share on other sites
LeGreg    754
Are you cpu limited or gpu limited ?

If you're not sure try to increase the resolution to see if your frame rate drops accordingly (let's first assume you're not limited by the vertex processing, or other parts of the 3d engine..).

If you are CPU limited, what you're calculating is maybe the time between two presents. Present is not blocking unless you've reached your limit of concurrent frames running. Typically it's below 3 but it's definitely above one.
But if for some reason your CPU lags behind your GPU, it will have no reason to wait at present, and will return almost immediately from the present call(it will just flush the commands so that the driver actually sees them).

What you may be seeing is that your cpu load is inconsistent between frames, one single frame took significantly longer than another typical frame leading to your push buffer running out of commands, then it will take time for your cpu to saturate this buffer again, and during this time the present will return immediately leading you to a false conclusion on how long the frame did take.

All this is purely a theory based on the very few details you provided of course ;)

LeGreg

Share this post


Link to post
Share on other sites
Malder1    122
Thanks, I forgot about this moment with immediate returning from Present function.

Our application is video card limited. Without vsync it may renders about 200 FPS.

Please can you advice me some good article about organization of rendering loop for vsync'ed fullscreen mode?

It seems that double-buffering can be fiction in some cases. In fact video card may use own additional buffers.

Share this post


Link to post
Share on other sites
Malder1    122
This problem on the PC of our customer was successfully solved with installing of latest ATI drivers for his ATI Radeon 9600XT 256 MB.

It's already second case with ATI cards where new drivers helped.

We use only base features of video card and don't use pixel shaders.

I'm glad that ATI solved this problem, but how many PCs still with old drivers.
It's sad that we depend on quality of drivers and particular configurations where similar problem may again occur.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this