PDA

View Full Version : glDrawElements and count parameter over or under



Mars_999
12-02-2007, 10:57 PM
What will happen if I have

glDrawElements count parameter set to say 1024 and the VBO for vertices say has less than the count parameter calls for? I have some patches that don't end up with a nice 32x32 square and I am sending in that amount for the count, so I am concerned with the patches that aren't 32x32. Those non 32x32 patches will have less than 32x32 vertices.

Jan
12-03-2007, 03:38 AM
Worst case: It crashes.

It is your responsibility to give correct information to the driver.

Jan.

Humus
12-03-2007, 06:17 PM
Indeed, a crash might happen, but a more likely problem is geometry corruption, random triangles etc. Don't make invalid call, by the old principle: crap in -> crap out.