add DrawIndirectBufferObject as State variable in order to minimize call to glBindBuffer(GL_DRAW_INDIRECT_BUFFER,X)
TODO: Promote PrimitiveSetIndirect's VBO to target explicited DIBO (in order to benefit from BOSet queue management)
This commit is contained in:
@@ -591,6 +591,27 @@ class OSG_EXPORT State : public Referenced
|
||||
}
|
||||
|
||||
|
||||
inline void bindDrawIndirectBufferObject(osg::GLBufferObject* ibo)
|
||||
{
|
||||
if (ibo->isDirty())
|
||||
{
|
||||
ibo->compileBuffer();
|
||||
_currentDIBO = ibo;
|
||||
}
|
||||
else if (ibo != _currentDIBO)
|
||||
{
|
||||
_glBindBuffer(GL_DRAW_INDIRECT_BUFFER, ibo->getGLObjectID());
|
||||
_currentDIBO = ibo;
|
||||
}
|
||||
}
|
||||
|
||||
inline void unbindDrawIndirectBufferObject()
|
||||
{
|
||||
if (!_currentDIBO) return;
|
||||
_glBindBuffer(GL_DRAW_INDIRECT_BUFFER,0);
|
||||
_currentDIBO = 0;
|
||||
}
|
||||
|
||||
void setCurrentVertexArrayObject(GLuint vao) { _currentVAO = vao; }
|
||||
GLuint getCurrentVertexArrayObject() const { return _currentVAO; }
|
||||
|
||||
@@ -1259,6 +1280,7 @@ class OSG_EXPORT State : public Referenced
|
||||
unsigned int _currentActiveTextureUnit;
|
||||
unsigned int _currentClientActiveTextureUnit;
|
||||
GLBufferObject* _currentPBO;
|
||||
GLBufferObject* _currentDIBO;
|
||||
GLuint _currentVAO;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user