Implemented lighter weight setting of the CurrentVertexArrayState and introduced GlobalVertexArrayState.
This commit is contained in:
@@ -629,18 +629,12 @@ void Drawable::draw(RenderInfo& renderInfo) const
|
||||
_vertexArrayStateList[contextID] = vas = setUpVertexArrayState(renderInfo, true);
|
||||
}
|
||||
|
||||
//state.pushVAO(localVAO);
|
||||
osg::ref_ptr<VertexArrayState> previous_vas = state.getCurrentVertexArrayState();
|
||||
|
||||
state.setCurrentVertexArrayState(vas);
|
||||
State::SetCurrentVertexArrayStateProxy setVASProxy(state, vas);
|
||||
|
||||
vas->bindVertexArrayObject();
|
||||
|
||||
drawInner(renderInfo);
|
||||
|
||||
// state.popVAO();
|
||||
state.setCurrentVertexArrayState(previous_vas);
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -140,8 +140,7 @@ State::State():
|
||||
_gpuTimestamp = 0;
|
||||
_timestampBits = 0;
|
||||
|
||||
|
||||
|
||||
_currentVertexArrayState = 0;
|
||||
}
|
||||
|
||||
State::~State()
|
||||
@@ -986,8 +985,9 @@ void State::initializeExtensionProcs()
|
||||
GLExtensions::Set(_contextID, _glExtensions.get());
|
||||
|
||||
#ifdef USE_VERTEXARRAYSTATE
|
||||
_currentVertexArrayState = new VertexArrayState(_glExtensions.get());
|
||||
_currentVertexArrayState->assignAllDispatchers();
|
||||
_globalVertexArrayState = new VertexArrayState(_glExtensions.get());
|
||||
_globalVertexArrayState->assignAllDispatchers();
|
||||
setCurrentToGloabalVertexArrayState();
|
||||
#endif
|
||||
|
||||
setGLExtensionFuncPtr(_glClientActiveTexture,"glClientActiveTexture","glClientActiveTextureARB");
|
||||
|
||||
@@ -345,6 +345,7 @@ VertexArrayState::VertexArrayState(osg::GLExtensions* ext):
|
||||
{
|
||||
}
|
||||
|
||||
#if 0
|
||||
osg::GLBufferObject* VertexArrayState::getGLBufferObject(osg::Array* array)
|
||||
{
|
||||
if (_ext->isBufferObjectSupported && array->getBufferObject())
|
||||
@@ -356,6 +357,7 @@ osg::GLBufferObject* VertexArrayState::getGLBufferObject(osg::Array* array)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void VertexArrayState::generateVretexArrayObject()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user