glLockArraysEXT related crash

Started by
4 comments, last by simbobx 21 years, 6 months ago
I decided to compile up and test a piece of sample code from a certain book you''ll probably most be aware of. It was demonstrating vertexarray stuff, but when compiled up and run, it crashed out in an ATI dll (obviously goes without saying this machine has an ati card in it). (for those that care, it''s an Unhandled Exception in ATIOGLXX.DLL - presumably the ATI ogl extensions dll? - access violation). After a bit of debugging/digging/code tweaking, I traced it to a call to glLockArraysEXT. Now .. the code allocated vertex, colour and texcoord arrays of size 1024 x 3 and indexarray of size 1024 x 6. The call to glLockArraysEXT(0, 1024 * 6); failed. Tweaking this down to glLockArraysEXT(0, 1024 * 3); worked (and everything ran fine). So I went searching for an explanation .. what should the param be? http://oss.sgi.com/projects/ogl-sample/registry/EXT/compiled_vertex_array.txt Just says that the parameters are ''first'' and ''count'' .. but count of what, in an indexed vertex-array context? If the vertex array is of size N and the index array of size M .. what should the 2nd parameter here be, to lock the whole array? - and if the answer is ''M'', are the ATI drivers screwed? Apologies for the novel Ta for any help.
Advertisement
Er .. okay, well to reply to my own thread .. looks like there''s something ''weird'' going on which may or may not have anything to do with the subject

Tried running my compiled up version on a 2nd machine (nVidia card in it) .. crash. (everything .. including my ''thought good'' build). Nuts.

Tried a few things .. the original exe (off the Book''s accompanying CD) works on that machine but none of my compiled vers.

My own versions work on my dev machine but *only* in the MSVC ide .. ''run'' or ''start debug'' and then only with the ''fix'' described earlier. They won''t run direct from explorer nor from the cmdline.

Dunno what''s going on but dunno how ogl related it might be, now.


pants.
the drivers are ok the problem lies in your code so look closely.
99x out of 100 the problem is u havent allocated enuf valid memory or the pointers aint pointing to valid memory (same thing).
i havent used lockarrays for a while but i believe
it takes the number of vertices as the second value.

hmm didnt see this in your post before
>>Now .. the code allocated vertex, colour and texcoord arrays of size 1024 x 3 and indexarray of size 1024 x 6.The call to glLockArraysEXT(0, 1024 * 6); failed.<<

1024x3 texcoords == 1024x3 vertices thus thats the correct number using x6 will crash

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html

Cheers for the reply.

I suspected when I first saw the code that this might be the prob, but wasn''t sure.

Interestingly, trying it with the nVidia card/drivers it works which is probably how it got into the sample code unnoticed.

quote:Original post by simbobx
Interestingly, trying it with the nVidia card/drivers it works which is probably how it got into the sample code unnoticed.


i hope not, i havent used lockarrays for a while but usually it would crash on my nvidia card which is the result u want, better a crash now when u can fix it , then it issiduously(sp) corrupting memory which can lead to real MF errors to track down



http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html

Well .. while tinkering just to prove that it did work on the nVidia drivers, I found something even more strange.

I does work on the nVidia drivers .. what''s more, if I choose values carefully, I can get the ATI drivers to accept rubbish too.

ATI:
glLockArraysEXT(0, MAP_X * MAP_Z * 3); // correct and works
glLockArraysEXT(0, MAP_X * MAP_Z * 4); // wrong? and fails glLockArraysEXT(0, MAP_X * MAP_Z * 5); // wrong? and fails
glLockArraysEXT(0, MAP_X * MAP_Z * 6); // wrong? and fails - this was the given example
glLockArraysEXT(0, MAP_X * MAP_Z * 7); // wrong and works
glLockArraysEXT(0, MAP_X * MAP_Z * 8); // wrong and works
glLockArraysEXT(0, MAP_X * MAP_Z * 9); // wrong and works

/me shrugs.
I made a point of checking that both drivers were really calling glLockArraysEXT, too, not just skipping it or something. glGetError returns NO_ERROR, too.

This topic is closed to new replies.

Advertisement