1
\$\begingroup\$

In a more performance-sensitive environment than a desktop CPU/GPU (namely a mobile device) is there really a point in determining whether or not to skip drawing non-visible objects vs reducing the number of draw calls?

I'm working with a scenario of an environment model that has ~10,000 triangles. I could split it up into 30 or so separate mesh such that less than half of those would be visible at any given point. However, would ~15 draw calls be more efficient than vs one draw call for all 10,000 triangles?

\$\endgroup\$
  • 1
    \$\begingroup\$ How should we know, you didn't even say what platform you are targeting? Even so you have to test it yourself. \$\endgroup\$ – János Turánszki May 19 '14 at 18:18
  • \$\begingroup\$ @JánosTuránszki - there's a "directx11" tag on the question. Mention of mobile devices makes it obvious: it's Windows Phone. \$\endgroup\$ – Maximus Minimus May 19 '14 at 21:44
  • \$\begingroup\$ @JimmyShelter It could be a Windows tablet device. \$\endgroup\$ – János Turánszki May 19 '14 at 22:12
1
\$\begingroup\$

Why is this a versus question? One of those things usually follows from the other. Also, 15 draw calls are not terribly expensive. If you are in a scenario where you would be able to collapse those 15 draw calls into 1 then you obviously do not have (m)any state changes between the draw calls. The states you do have to change are probably just vertex buffer states, and those are very cheap compared to things like changing render targets.

In modern graphics APIs it is the states you change between draw calls (particularly the validation that follows) that make them expensive. In D3D9 on Windows XP, each draw call lead to a kernel-mode switch irrespective of the states changed and that added a fixed amount of time to each draw call that is no longer relevant. D3D10 / Windows Vista (WDDM) addressed this problem by creating a user-mode component to the Direct3D driver to more efficiently handle command batching and also by reducing the amount of validation by shifting much of it to resource creation time.

You will probably have to profile your solution to come up with any definitive answer, but draw calls themselves are not the enemy.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.