Direct3D 11 Present makes up 98% of FPS ?

Started by
4 comments, last by 21st Century Moose 10 years, 6 months ago

Hey guys I have a problem in my renderer right now. I don't know why but I have a very slow fps rate when rendering a mesh.I loaded the sponza mesh with only 190k verts and have about 200 fps ( HD6970 and Eightcore CPU).. Well my profiler says me that the present function makes up 98% of the rendering. Stuff like Draw Index/Vertexbuffers, shader linkage and so one only take < 1 - 1 % ,but the present function 98%!! This isn't normal I think.

Can you help me with that why this is so ??

Advertisement

The present function will be doing nothing on the CPU, except waiting for the GPU to finish rendering your mesh. Your GPU is taking about 5ms to render it.

Once you add some work to the CPU (the game), you'll find that work is happening in parallel to the GPU, so you'll effectively get that 'present' time back.

Okay but this is very slow isn't it ?? I have the cascade shadow demo from the smaple browser and have there about 400 fps with shadows and light, a very big scene and textures. And here is only a little mesh with 1 texture which takes so long ....

Okay but this is very slow isn't it ?? I have the cascade shadow demo from the smaple browser and have there about 400 fps with shadows and light, a very big scene and textures. And here is only a little mesh with 1 texture which takes so long ....

No, because it's proportional. If you are just issuing a call to render a single mesh, that is very, very fast. Present may be slower, but it only seems so expensive because it's it's slower than doing a very fast thing.

For a real world comparison, this is similar to saying that a donut at 50 cents is expensive because a stick of gum only costs 5 cents. The donut is not expensive, they gum is just insanely cheap.

Measure in milliseconds, not in frames per second

Another key mistake you're making here is measuring CPU time and assuming that those measurements are in any way whatsoever representative of what's going on on the GPU. They're not. Your various Set/Draw/etc commands don't actually do much at all - they just add a command and it's parameters to your driver's internal command buffer and will normally then return immediately. Hence the fact that you're seeing them not taking much time on the CPU - that's a correct reading. A Draw command (unless it needs to flush the buffer for any reason) will behave like this irrespective of how much geometry you're drawing.

If you want to profile GPU time then use a correct methodology for profiling GPU time; measuring CPU time is not the way to do it.

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

This topic is closed to new replies.

Advertisement