Crash in glMultiDrawElements

Member
Posts: 114
Joined: 2005.03
Post: #1
I have a rather strange problem at the moment. According to documentation
Code:
glMultiDrawElements(GL_TRIANGLE_STRIP, image->stripElementCounts, GL_UNSIGNED_INT, image->stripElements, image->numTriangleStrips);
should be equivalent to
Code:
for (i = 0; i < image->numTriangleStrips; ++i)
    glDrawElements(GL_TRIANGLE_STRIP, image->stripElementCounts[i], GL_UNSIGNED_INT, image->stripElements[i]);

However, I noticed a slight difference: The second one draws as it should, while the first one doesn't draw correctly and, when adding more indices to the triangle strip, crashes with EXC_BAD_ACCESS. This is, by the way, always the case, not only with GL_TRIANGLE_STRIP. I am using normal vertex arrays, allocated in the heap, if that is relevant (I had crashes earlier when using vertex arrays on the stack instead of VBOs).

An example screenshot (the yellow line is the triangle strip I want to render. At the moment, the image never has more than one triangle strip, though I want to change this in the future):

[Image: glmultidrawelementscrash.png]

The upper part shows with glMultiDrawElements, the lower with a loop and glDrawElements.

Does anyone know what causes this and how to avoid it?

System: Mac OS X 10.4.10, G4, Radeon 9200
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
OpenGL.org is full of posts saying MultiDrawElements is broken. File a bug and move on.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  glMultiDrawElements(); Volte 0 2,611 Sep 10, 2005 08:02 AM
Last Post: Volte