Jump to content
  • Advertisement
Sign in to follow this  
Aqua Costa

CPU-GPU sync

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

Can someone explain how are the CPU and GPU synchronized at the end of each frame? Because since FPS are calculated by how long does the CPU take to run the whole frame is there some kind of synchronization in the Present() method of the ID3D11Device?

Thanks

Share this post


Link to post
Share on other sites
Advertisement
Yes. The CPU can run a couple frames ahead, and Present will effectively be asynchronous, buffering these frames. But if it gets any further ahead, Present will block.

Share this post


Link to post
Share on other sites
In DX11 you can query or set the max latency with IDXGIDevice1::GetMaximumFrameLatency and IDXGIDevice1::SetMaximumFrameLatency. This number represents the maximum amount of frames that the CPU will get ahead before the driver blocks and waits for the GPU to catch up.

If you're the other way around where the CPU is running slower than the GPU, then the GPU will periodically run out of pending commands and have to wait for the CPU/Driver to issue more.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!