Weird CVA Problem

I’ve discovered some weird behavior coming from the combined use of glLock/UnlockArraysEXT and glDrawElements.

First of all, let me point out that this is happening on a Voodoo 3 on an XP machine (it’s the only video card I have available at work), and I understand these drivers aren’t even supported or anything, but I’m just wondering if anyone else has encountered this and has any better solutions.

What’s happening is when I use glLockArraysEXT to lock my arrays, and then use glDrawElements, my program crashes out with an access violation.

It does NOT crash if:

  • I call glDrawElements without calling glLockArraysEXT first.
  • I replace the GL_TRIANGLES in the glDrawElements call with GL_POINTS.
  • When I loop through the indexes manually and do glArrayElement for each one (with GL_TRIANGLES).

Here’s the really weird thing: I noticed that it seems to have something to do with calling glClear. If I re-enable my arrays (glEnableClientState) after each time I clear the buffers, it doesn’t crash. I don’t see that as a very elegant solution, though.

Any information would be helpful.

Nathan Ostgard

In case anyone else has this problem, I found that setting a maximum of 3034 vertexes in my array seems to prevent it from crashing.

There’s probably a “fast path” in the drivers which bombs out if you give it too many vertices at the same time. Or if you give it bad data (i e, you try to lock fewer vertices than you then actually use).

Yeah, that’s what it looks like. It has to be bombing because of the number of vertexes… I know I’m not using more than I’m locking, and it stops working as soon as I increase the allowable amount to 3035.

It’s such a weird number, though…