# Should all primitives be GL_TRIANGLES in order to create large, unified batches?

Optimizing modern OpenGL relies on aggressive batching, which is done by calls like glMultiDrawElementsIndirect. Although glMultiDrawElementsIndirect can render a large number of different meshes, it makes the assumption that all these meshes are made of the same primitives (eg. GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_POINTS).

In order to most efficiently batch rendering, is it wise to force everything to be GL_TRIANGLES (while ignoring possible optimizations with GL_TRIANGLE_STRIP or GL_TRIANGLE_FAN) in order to make it possible to group more meshes together?

This though comes from reading the Approaching Zero Driver Overhead slides, which suggests to draw everything (or, presumably, as much as possible) in a single glMultiDrawElementsIndirect call.

• That depends on so many factors, it could vary from driver to driver, hardware to hardware, scene to scene.. The only way to know for sure is profiling. – bogglez Jun 22 '14 at 12:13
• GL_TRIANGLE_STRIP and GL_TRIANGLE_FAN are counter-productive if you are trying to group meshes together. You have to insert degenerate triangles or primitive restart indices in order to do that. In reality, the primary benefit of strips (cache efficiency) can be achieved just by using an indexed list of triangles in that order. Of course if you used strip order verbatim you would have winding issues, it is not the vertex order that you need to duplicate but the triangle order. – Andon M. Coleman Jun 22 '14 at 13:07

You don't need that fancy glMultiDrawElementsIndirect, you can just use glDrawArraysInstanced.
• The inspiration for using glMultiDrawElementsIndirect comes from the Approaching Zero Driver Overhead slides, which suggest submitting everything in a single multi-draw. glDrawArraysInstanced will allow instancing, but does not allow submitting multiple arbitrary (different) draw calls at the same time. – Nicolas Louis Guillemot Jun 22 '14 at 20:40