Fixed the TextureObject's + GLBufferObject reassignment to a new set.
Disabled the unref after apply for a Texture classes when the texture pool is enabled
This commit is contained in:
@@ -174,16 +174,10 @@ void GLBufferObject::compileBuffer()
|
||||
osg::notify(osg::NOTICE)<<"newTotalSize="<<newTotalSize<<", _profile._size="<<_profile._size<<std::endl;
|
||||
|
||||
_profile._size = newTotalSize;
|
||||
|
||||
if (_set)
|
||||
{
|
||||
// remove self from original set
|
||||
_set->remove(this);
|
||||
|
||||
// get the new set for the new profile
|
||||
_set = _set->getParent()->getGLBufferObjectSet(_profile);
|
||||
|
||||
// register self with new set.
|
||||
_set->addToBack(this);
|
||||
_set->moveToSet(this, _set->getParent()->getGLBufferObjectSet(_profile));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -882,6 +876,23 @@ void GLBufferObjectSet::remove(GLBufferObject* to)
|
||||
}
|
||||
|
||||
|
||||
void GLBufferObjectSet::moveToSet(GLBufferObject* to, GLBufferObjectSet* set)
|
||||
{
|
||||
if (set==this) return;
|
||||
if (!set) return;
|
||||
|
||||
// remove 'to' from original set
|
||||
--_numOfGLBufferObjects;
|
||||
remove(to);
|
||||
|
||||
// register 'to' with new set.
|
||||
to->_set = set;
|
||||
++set->_numOfGLBufferObjects;
|
||||
set->addToBack(to);
|
||||
}
|
||||
|
||||
|
||||
|
||||
GLBufferObjectManager::GLBufferObjectManager(unsigned int contextID):
|
||||
_contextID(contextID),
|
||||
_numActiveGLBufferObjects(0),
|
||||
|
||||
Reference in New Issue
Block a user