Low frame rate in empty loop

Started by
4 comments, last by hughiecoles 14 years, 4 months ago
My app is only getting ~60 fps, even when I take all the rendering out of it. I thought it might be because I had a P4 processor, but I recently put in an E7500 ( 2.93Ghz x 2) and it didn't improve. All thats in my loop is clear(), and present() plus the FPS function. This is C++/directX. This seems really abnormal.
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried
Advertisement
the first step into solving slow down problems is to identify what part of your code is responsible. This can be measured easily with a good profiling tool.

And of course to get an answer you should paste your code here so we can see the problem as well and recommend solutions.
You have vertical synchronization turned on. 60Hz is typical frequency of LCD monitors. Turn off vertical synchronization (or v-sync as it is sometimes called) from either graphics card settings utility or programmatically: see http://www.gamedev.net/community/forums/topic.asp?topic_id=317721 for the latter. Then measure FPS again.
Make sure the PresentationInterval member of your D3DPRESENT_PARAMETERS struct passed to CreateDevice() is set to D3DPRESENT_INTERVAL_IMMEDIATE, not D3DPRESENT_INTERVAL_DEFAULT. Otherwise you'll be locked to the monitors refresh rate.
Shall I add, there is no point in rendering faster than the screen refresh rate.
If your monitor is at 60hz, then there's no point in rendering faster than 60fps.

Note however, on logic side (assuming your loop is logic-rendering decoupled) you can run at higher fps if you need more responsiveness, but rendering would be still at ~60fps.

Cheers
Dark Sylinc
ahh, thank you very much for the help, I figured that V-Sync wouldn't be affecting it since I wasn't rendering anything, but now I see that it limits the Present function.

Thanks again.
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried

This topic is closed to new replies.

Advertisement