Archived

This topic is now archived and is closed to further replies.

glDrawElements vs glDrawArrays

This topic is 5045 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If you''re using index arrays (with VBO) they''re probably around the same speed. If not, then DrawElements requires an array of indices to be tossed across the AGP bus each frame can contribute greatly to the saturation of AGP bandwidth, which results in a performance hit. DrawArrays requires only a few integers to be passed across the bus and therefore has less of an impact on bandwidth. Of course, there are cases where DrawArrays simply cannot be used.

Share this post


Link to post
Share on other sites
DrawArrays obviously can''t be used with index arrays as it doesn''t take any indices. In general, DrawElements is faster unless you don''t have any shared vertices at all, then DrawArrays is faster. This has to do with the vertex cache among other things.

DrawRangeElements is generally better than DrawElemnts although the difference is smaller when you use VBO''s. If you use standard vertex arrays, DrawRangeElements should be much faster.

Share this post


Link to post
Share on other sites