Jump to content
  • Advertisement
Sign in to follow this  
Quat

Timing a Frame

This topic is 2789 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!