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

Started by
2 comments, last by BeanDog 21 years, 2 months ago
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 );
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]
The same thing happens in fullscreen, regardless of swapeffect and backbuffer format.



~BenDilts( void );
maybe try
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;

This topic is closed to new replies.

Advertisement