Why is the draw call expensive?

There are a lot of ways to optimize the number of rendering calls. For example, it can be a batching or a texture atlas. It is much more profitable to give everything possible to the GPU at a time than to send it in pieces. But why? Will the final amount of work required change from this?

Author: Stoned Code, 2016-10-25

1 answers

In fact, you load vertex buffers, textures, and so on to the video card. Then you make a drawing call. And the fewer of them, the faster the whole thing works.

Why? It's simple. If earlier (take legacy OpenGL glBegin...) it was normal to send everything over the bus every frame, now everything is stored on the video card and the load on the bus is tried to be reduced as much as possible, simply because now video cards and processors count much faster than data flies over the bus between them. And how it is known that while the data on the bus is flying, the processor is forced to practically stand idle due to the speed of the bus, and the video card is also idle until it receives the data.

An analogy can be drawn with pipes and containers. The capacity has increased, but the pipe remains the same.

By the way, on embedded platforms and game consoles, the CPU and gpu share the same memory, so in this case, you can not worry too much about drawcalls

 2
Author: selya, 2016-10-25 16:39:17