Drawing Primitives (penalty or no penalty)

Started by
3 comments, last by DrunkenHyena 19 years, 3 months ago
Ok people I know all about Vertex Buffer and Index buffers, I know all about locking and all about the penalties involved however!! Now I cant seem to get a good sentence to explain this so an example may help: Create a device… Create a static Vertex buffer (length 100) Create a static Index buffer (Length 300) Set the device to use the vertex buffer Set the device to use the index buffer. Draw a set in index primitives (First 80) Draw a set in index primitives (Last 20) Ok so is there a penalty for the second Draw?? Even tho I am not changing any device setting?? Thanks
Advertisement
There's no state change happening, so there shouldn't be any performance hit beyond that of the actual rendering. As always, this is subject to the quality of the drivers in question.
I wouldn't say there is a penalty, but drawing them all at once will be more efficient in general.
Stay Casual,KenDrunken Hyena
Normally I would draw them all at once but it’s more like

Draw basic stuff
If Something Then
Draw some more
Else
Don’t bother
End If

So I am planning to stick the (more stuff) in the same vertex and index buffer just so I don’t have to make any device changes. Plus the (more stuff) is very small so I don’t really want to send a tiny VB or IB over the AGP when I could have just stuck it to the end of the last one I sent.
Premature optimization is evil.
Stay Casual,KenDrunken Hyena

This topic is closed to new replies.

Advertisement