PDA

View Full Version : Anyone using generic attributes with VBO successfully?



Pop N Fresh
12-13-2006, 10:33 PM
It seems the combination of VBOs, GLSL, glDrawElements and generic attributes causes an exception under 10.4.8 on my MacBook Pro (ATI X1600).

My code works fine on windows and changing to gl{Vertex|Normal|Color|etc.}Pointer gets rid of the crash. Anyone got this combination working or have I possibly ran into a driver bug?

OneSadCookie
12-14-2006, 12:30 AM
Does sound likely it's a driver bug... File a bug report -- http://bugreport.apple.com/

johnburkey
12-14-2006, 06:05 PM
I've used the generic stuff with no problem, along with VBOs, PBOs, FBOs, GLSL on the MacBook Pro.

Check to make sure you aren't giving it to much or to little data. (you may be asking it to draw more data than you actually have, for example, and on windows, it may be merrily rendering with uninitialized data.

I use this, for example: (im using the JOGL java bindings)

gl.glVertexAttribPointerARB(attributeIndex,2, GL.GL_UNSIGNED_BYTE,false, 0, offsetZero);

Pop N Fresh
12-14-2006, 09:15 PM
Just did a quick test, changing glDrawElements so it only draws the first triangle in the buffer and I still get the same crash. I do have it working with glDrawArrays in a different part of my code. Hmm...

I'll try reducing to the simplest possible case and see what happens. Either it will work and then I can start adding to it until I figure out what i'm doing wrong or it won't and i'll have a nice test case to add to by bug report.

Thanks for the help.

Komat
12-14-2006, 10:36 PM
Do you have something bound to the generic attribute 0?

According to the OGL specification there must be stream bound to generic attribute 0 or to vertex pointer, otherwise the rendering should not happen. There should be no crash if that is not true however it is possible that the driver does not handle such situation correctly.

Pop N Fresh
12-20-2006, 08:42 PM
Yeah, I have an attribute bound to 0. For now i've just put a in a fallback path that doesn't use VBO. It only seems to be the specific combination of generic attributes, VBOs and glDrawElements that gives me a crash. Change any one of them and it works fine.

Hopefully i'll have time in the next couple days to make a minimal test and send in a bug report.

H.Stony
02-14-2007, 12:52 PM
have almost the same prob with dynamic VBO, generic attribtutes and glDrawElements.

i dont get a crash but a software fallback for vertexshader.

however i
have submitted bug report but nothing changed till now.

nib
02-23-2007, 08:49 AM
I've got vbo's working in os 10.4.8. ( hopefully ... it draw nice and seems faster in some situations. :)

Though, I was making display lists before with glVertex calls. Now, if vbo is present, I've replaced those calls with glDrawArrays and vbo. I use GL_TEXTURE_COORD_ARRAY where I was using glMultiTexCoord before. Though, if the sizes of the arrays I stored were different the program blew up.

Other boards have stated that display lists on ati video cards are not optimized. But on a mac, Apple writes the drivers.(99% sure of that ... I suppose if its a card from the store then its an ati/nvidia mac driver?) So, the question is are display list optimized.(?) But when I added the vbo/display list combo it appeared to help with some background models that had high vertex counts. Though, it think I use more memory initially loading my models in.

Turned on texture compression too. Seemed to help with some virtual memory swaps when my program initially runs.

I saw this article and thought it would be helpful...

http://developer.apple.com/graphicsimaging/opengl/optimizingdata.html

Pop N Fresh
03-15-2007, 01:29 AM
Seems fixed in the OS X 10.4.9 update.

Thank you to any Apple OpenGL engineers who may be reading this.