Sign in to follow this  
Quat

Timing a Frame

Recommended Posts

Does calling Present() flush the command buffer?

I have a non game d3d app and draw in WM_PAINT. I want to measure how long it takes to draw the frame. However, it seems Present() returns immediately and I am getting nonsense values when I measure the time from the start of the frame to after Present() is called.

Share this post


Link to post
Share on other sites
D3D will buffer up to three frames worth of draw calls. This means if you're CPU bound Present() can always return immediately. If you're GPU bound then Present() will start blocking after D3D has got 3 frames of data in it's buffer.

Timing from the start of one frame, to the start of the next frame is probably the best way of getting a frame time, but you need to render several frames and average them to get sensible results.

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