Added lazy state updating for vertex array object binding/unbinding

This commit is contained in:
Robert Osfield
2017-03-13 11:44:34 +00:00
parent a6453ad877
commit ffbc1167de
6 changed files with 26 additions and 9 deletions

View File

@@ -861,10 +861,12 @@ void SharedGeometry::compileGLObjects(osg::RenderInfo& renderInfo) const
osg::State::SetCurrentVertexArrayStateProxy setVASProxy(state, vas);
vas->bindVertexArrayObject();
state.bindVertexArrayObject(vas);
if (vbo_glBufferObject) vas->bindVertexBufferObject(vbo_glBufferObject);
if (ebo_glBufferObject) vas->bindElementBufferObject(ebo_glBufferObject);
state.unbindVertexArrayObject();
}
}