Archived

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

DrawPrimitive Calls

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

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)

SetTexture(FirstTexture)
DrawPrimitive(All triangles with texture 1)
SetTexture(SecondTexture)
DrawPrimitive(All triangles with texture 2)
etc.

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