Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

BeanDog

D3DDevice9->Present(0,0,0,0) takes 45ms

This topic is 5646 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

The framerate in my very low-polygon game seemed quite unstable, so I profiled my game loop quickly. Not too surprisingly, the render took the longest. Then I profiled more closely, and found out that on frames that seemed jerky, the call that took 99% of the render time was Device->Present(0,0,0,0)! One frame the Present call took a reasonable amount of time: Present: 0.001107 Total Render: 0.004923 The next frame it took forever: Present: 0.045918 Total Render: 0.050405 And about every 5th frame or so Present(0,0,0,0) just took about 45-50ms. Generally it takes 15-25ms. Anyone have any idea why? I''m running a TNT2 with the brand-new NVIDIA drivers. These are my present params: D3DPRESENT_PARAMETERS d3dpp; ZeroMemory( &d3dpp, sizeof(d3dpp) ); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.BackBufferFormat = D3DFMT_UNKNOWN; d3dpp.EnableAutoDepthStencil = TRUE; d3dpp.AutoDepthStencilFormat = D3DFMT_D16; d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; Changing the SwapEffect and PresentationInterval have almost no effect. I''m stumped! Commercial games have no such difficulty on my system. ~BenDilts( void );

Share this post


Link to post
Share on other sites
Advertisement
What happens if you use the swap effect: D3DSWAPEFFECT_FLIP along with setting the back buffer format?



p_D3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &dDM );

dPP.BackBufferFormat = dDM.Format;



What does it do in fullscreen?

[edited by - JoeyBlow2 on January 30, 2003 9:38:09 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
maybe try
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;

Share this post


Link to post
Share on other sites

  • 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!