Present() use too much time

Started by
4 comments, last by ChenA 6 years, 9 months ago

recently, i profile my game use the gpu query.

i use the method from mjp's blog.

everything is fine, except that the present() use too much time, 6-10ms.

even my game is gpu bound, this is too much, i don't use vsync.

why present() use so much time?

Thanks.

hehe.
Advertisement

Why is present so slow?

Quote

Well - it isn't! On its own, Present does very little except tell the GPU that the current frame is done, and it should display that to the screen. It might also do a few blits and clears, but those are very quick operations on today's cards.

The reason you're seeing Present on your profile is that Present is also when the CPU and GPU "sync up" with each other. They are two separate units operating asynchronously in parallel (well, ideally :-), and you need to be aware that at certain times, one may need to wait for the other. Obviously the GPU can't get ahead of the CPU (because the CPU generates commands for the GPU), but it is fairly easy to give the GPU so much work to do that you can generate rendering commands with the CPU faster than the GPU can complete those commands.

Read the rest of the post linked above for more info.  It's really good stuff that might seem non-obvious sometimes.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

How much GPU time do you use per frame?

18 minutes ago, mhagain said:

Why is present so slow?

Read the rest of the post linked above for more info.  It's really good stuff that might seem non-obvious sometimes.

thanks for your reply.

in your reference article, the present() use too much time is because that it's cpu time.

the cpu wait gpu when application is gpu bound.

i profile the gpu time, not the cpu time, it's not a same question.

 

Just now, Hodgman said:

How much GPU time do you use per frame?

about 40ms.

hehe.

any suggestion to debug this?

have some tools can debug this?

Thanks.

hehe.

This topic is closed to new replies.

Advertisement