Jump to content
  • Advertisement


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


DrawPrimitive Calls

This topic is 6112 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

Can I call DrawPrimitive a thousand times without incurring a performance penalty?

Share this post

Link to post
Share on other sites
Yes, but on the 1001st time, it will crash your computer...

But seriously... Calling DrawPrimitive 100 times takes longer than calling it once and so on... Ideally, you want to push as many primitives out in a single call as possible. Like so (for single textured triangle lists)

DrawPrimitive(All triangles with texture 1)
DrawPrimitive(All triangles with texture 2)

You also want to sort by vertex shader, etc. Draw as much as possible per call and minimize the number of state switches (texture, shader, stream, etc.) you do.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!