I have just been reworking my rendering pipeline. There is an issue I had noticed cropping up during this work but now its become constant and I cant figure out the cause.

Every call to DrawIndexed is costing 0.1ms - 0.2ms in CPU time. Even when there's no state change to explain it. I can just duplicate the call to DrawIndexed call 5 times in a row in the code (to eliminate the chance something else in the loop is impacting it) and all calls will have the same cost when looking in NVIDIA NSight (see below).

I have had frames where I will draw 100 times from the same vertex buffer with different offsets (each being a chunk of the map) and its the same. You can see in this trace there is a few without any state changes showing this behavior.

If I instead render the whole buffer at once the CPU usage is the same but the GPU barely changes, which makes sense, there is so few triangles there's almost nothing to do.

I've tried changing just about everything I can think of to try to tease out what's going on but nothing seems to to impact it.

Any ideas would be greatly appreciated.

I should just mention I am running a pretty high end system 9900k, 3090.

Screenshot of NSight


1 Answer 1


Micro-timing of Direct3D calls is not an accurate way of measuring the CPU overhead of the API. There's a number of work queues involved to minimize kernel mode transitions.

Take a look at Microsoft Docs. It's a old article, but it's still relevant.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .