[osg-users] VBO Bug with 3.6.1 and Normal Arrays

Robert Osfield robert.osfield at gmail.com
Wed Jun 13 10:28:34 PDT 2018


Hi All,

I've started investigating what is happening in the VertexArrayState
that is passing the array data to OpenGL.  When things are all set up
correctly w.r.t VBO assignment to the Arrays we get:

VertexArrayState::setArray(VertexArrayDispatch, new_array=0x1092250
vbo=0x7f583c09d210
VertexArrayState::setArray(NormalArrayDispatch, new_array=0x1092310
vbo=0x7f583c09d210
VertexArrayState::setArray(VertexArrayDispatch, new_array=0x1092b60
vbo=0x7f583c09f320
VertexArrayState::setArray(NormalArrayDispatch, new_array=0x1092c80
vbo=0x7f583c09f320

But for the late setBinding() usage case we have:

ertexArrayState::setArray(VertexArrayDispatch, new_array=0x870250
vbo=0x7f0e4809d210
VertexArrayState::setArray(NormalArrayDispatch, new_array=0x870310 vbo=0
Warning: detected OpenGL error 'invalid operation' at after
drawable.compileGLObjects() call in
GLObjectsVisitor::apply(osg::Drawable& drawable)
VertexArrayState::setArray(VertexArrayDispatch, new_array=0x870b60
vbo=0x7f0e4809f400
VertexArrayState::setArray(NormalArrayDispatch, new_array=0x870c80
vbo=0x7f0e4809f400

Note the vbo=0 followed by the OpenGL error, and later by a crash.

Commenting out the geom->setUserVertexArrayObjects(true) in the
main.cpp test program so that only VBO's and direct array calls are
done the GL error disappears and no crash.  So it's Vertex Array
Objects to is the problem area.  I vague recollection that VAO's
requires VBO's, but it's been a while since I added the VAO support so
not 100% sure.

More investigation is required...

Robert.


More information about the osg-users mailing list