Thomas
Thomas

Reputation: 6196

Better to do 2 draw calls or 1 draw calls in this scenario?

I have a bunch of triangles and a bunch of a quads. They will be in the same VBO.

I can do 2 draw calls, one for triangles and one for qauds.

Or I can do 1 draw call, and turn the quads into 2 triangles.

In both cases, I plan on doing DrawElementsInstanced, and instance a base triangle or a base quad and triangle, and the VBO only stores per instance triangle data or per instance quad and triangle data (for the 2 draw call approach).

Generally which would be the best approach here?

Upvotes: 0

Views: 74

Answers (1)

starmole
starmole

Reputation: 5068

In the general case I would always recommend (indexed) triangles only.

Some drivers will have to do CPU work for quads. Always sticking to triangles will also keep your code simpler and cleaner.

Avoiding quads on the back end might also prevent hard to understand problems with interpolation or triangulation later on.

Avoiding extra draw calls is also always desirable.

Upvotes: 1

Related Questions