diff --git a/include/osg/BufferObject b/include/osg/BufferObject index 9a7aa9211..a3643bf72 100644 --- a/include/osg/BufferObject +++ b/include/osg/BufferObject @@ -17,6 +17,10 @@ #include #include #include +#include + +#include +#include #ifndef GL_ARB_vertex_buffer_object @@ -102,12 +106,73 @@ class State; class BufferData; class BufferObject; +class BufferObjectProfile +{ + public: + BufferObjectProfile(): + _target(0), + _usage(0), + _size(0) {} + + BufferObjectProfile(GLenum target, GLenum usage, unsigned int size): + _target(target), + _usage(usage), + _size(size) {} + + BufferObjectProfile(const BufferObjectProfile& bpo): + _target(bpo._target), + _usage(bpo._usage), + _size(bpo._size) {} + + bool operator < (const BufferObjectProfile& rhs) const + { + if (_target < rhs._target) return true; + else if (_target > rhs._target) return false; + if (_usage < rhs._usage) return true; + else if (_usage > rhs._usage) return false; + return _size < rhs._size; + } + + bool operator == (const BufferObjectProfile& rhs) const + { + return (_target == rhs._target) && + (_usage == rhs._usage) && + (_size == rhs._size); + } + + void setProfile(GLenum target, GLenum usage, unsigned int size) + { + _target = target; + _usage = usage; + _size = size; + } + + BufferObjectProfile& operator = (const BufferObjectProfile& rhs) + { + _target = rhs._target; + _usage = rhs._usage; + _size = rhs._size; + return *this; + } + + GLenum _target; + GLenum _usage; + GLenum _size; +}; + +// forward declare +class GLBufferObjectSet; +class GLBufferObjectManager; + class OSG_EXPORT GLBufferObject : public Referenced { public: GLBufferObject(unsigned int contextID, BufferObject* bufferObject=0); + void setProfile(const BufferObjectProfile& profile) { _profile = profile; } + const BufferObjectProfile& getProfile() const { return _profile; } + void setBufferObject(BufferObject* bufferObject); BufferObject* getBufferObject() { return _bufferObject; } @@ -143,14 +208,11 @@ class OSG_EXPORT GLBufferObject : public Referenced inline GLuint getGLObjectID() const { return _glObjectID; } inline GLsizeiptrARB getOffset(unsigned int i) const { return _bufferEntries[i].offset; } - inline void bindBuffer() const - { - _extensions->glBindBuffer(_target,_glObjectID); - } + void bindBuffer(); - inline void unbindBuffer() const + inline void unbindBuffer() { - _extensions->glBindBuffer(_target,0); + _extensions->glBindBuffer(_profile._target,0); } inline bool isDirty() const { return _dirty; } @@ -176,15 +238,10 @@ class OSG_EXPORT GLBufferObject : public Referenced * by contextID.*/ static void deleteBufferObject(unsigned int contextID,GLuint globj); - /** flush all the cached display list which need to be deleted - * in the OpenGL context related to contextID.*/ - static void flushDeletedBufferObjects(unsigned int contextID,double /*currentTime*/, double& availableTime); - - /** dicard all the cached display list which need to be deleted - * in the OpenGL context related to contextID. - * Note, unlike flush no OpenGL calls are made, instead the handles are all removed. - * this call is useful for when an OpenGL context has been destroyed. */ - static void discardDeletedBufferObjects(unsigned int contextID); + static void flushAllDeletedBufferObjects(unsigned int contextID); + static void discardAllDeletedBufferObjects(unsigned int contextID); + static void flushDeletedBufferObjects(unsigned int contextID,double currentTime, double& availbleTime); + static void releaseGLBufferObject(unsigned int contextID, GLBufferObject* to); /** Extensions class which encapsulates the querying of extensions and * associated function pointers, and provide convenience wrappers to @@ -264,23 +321,153 @@ class OSG_EXPORT GLBufferObject : public Referenced unsigned int _contextID; GLuint _glObjectID; - GLenum _target; - GLenum _usage; + BufferObjectProfile _profile; + unsigned int _allocatedSize; bool _dirty; - mutable unsigned int _totalSize; - typedef std::vector BufferEntries; BufferEntries _bufferEntries; BufferObject* _bufferObject; + public: + + GLBufferObjectSet* _set; + GLBufferObject* _previous; + GLBufferObject* _next; + unsigned int _frameLastUsed; + public: Extensions* _extensions; }; +typedef std::list< ref_ptr > GLBufferObjectList; + +class OSG_EXPORT GLBufferObjectSet : public Referenced +{ + public: + GLBufferObjectSet(GLBufferObjectManager* parent, const BufferObjectProfile& profile); + + void handlePendingOrphandedGLBufferObjects(); + void flushAllDeletedGLBufferObjects(); + void discardAllDeletedGLBufferObjects(); + void flushDeletedGLBufferObjects(double currentTime, double& availableTime); + + GLBufferObject* takeFromOrphans(BufferObject* bufferObject); + GLBufferObject* takeOrGenerate(BufferObject* bufferObject); + + void moveToBack(GLBufferObject* to); + void addToBack(GLBufferObject* to); + void orphan(GLBufferObject* to); + void remove(GLBufferObject* to); + + unsigned int size() const { return _profile._size * _numOfGLBufferObjects; } + + bool makeSpace(unsigned int& size); + + bool checkConsistency() const; + + GLBufferObjectManager* getParent() { return _parent; } + + + protected: + + virtual ~GLBufferObjectSet(); + + OpenThreads::Mutex _mutex; + + GLBufferObjectManager* _parent; + unsigned int _contextID; + BufferObjectProfile _profile; + unsigned int _numOfGLBufferObjects; + GLBufferObjectList _orphanedGLBufferObjects; + GLBufferObjectList _pendingOrphanedGLBufferObjects; + + GLBufferObject* _head; + GLBufferObject* _tail; +}; + +class OSG_EXPORT GLBufferObjectManager : public osg::Referenced +{ + public: + GLBufferObjectManager(unsigned int contextID); + + unsigned int getContextID() const { return _contextID; } + + + void setNumberActiveGLBufferObjects(unsigned int size) { _numActiveGLBufferObjects = size; } + unsigned int& getNumberActiveGLBufferObjects() { return _numActiveGLBufferObjects; } + unsigned int getNumberActiveGLBufferObjects() const { return _numActiveGLBufferObjects; } + + void setNumberOrphanedGLBufferObjects(unsigned int size) { _numOrphanedGLBufferObjects = size; } + unsigned int& getNumberOrphanedGLBufferObjects() { return _numOrphanedGLBufferObjects; } + unsigned int getNumberOrphanedGLBufferObjects() const { return _numOrphanedGLBufferObjects; } + + void setCurrGLBufferObjectPoolSize(unsigned int size) { _currGLBufferObjectPoolSize = size; } + unsigned int& getCurrGLBufferObjectPoolSize() { return _currGLBufferObjectPoolSize; } + unsigned int getCurrGLBufferObjectPoolSize() const { return _currGLBufferObjectPoolSize; } + + void setMaxGLBufferObjectPoolSize(unsigned int size); + unsigned int getMaxGLBufferObjectPoolSize() const { return _maxGLBufferObjectPoolSize; } + + bool hasSpace(unsigned int size) const { return (_currGLBufferObjectPoolSize+size)<=_maxGLBufferObjectPoolSize; } + bool makeSpace(unsigned int size); + + GLBufferObject* generateGLBufferObject(const osg::BufferObject* bufferObject); + + void handlePendingOrphandedGLBufferObjects(); + void flushAllDeletedGLBufferObjects(); + void discardAllDeletedGLBufferObjects(); + void flushDeletedGLBufferObjects(double currentTime, double& availableTime); + void releaseGLBufferObject(GLBufferObject* to); + + GLBufferObjectSet* getGLBufferObjectSet(const BufferObjectProfile& profile); + + void newFrame(osg::FrameStamp* fs); + void resetStats(); + void reportStats(); + + unsigned int& getFrameNumber() { return _frameNumber; } + unsigned int& getNumberFrames() { return _numFrames; } + + unsigned int& getNumberDeleted() { return _numDeleted; } + double& getDeleteTime() { return _deleteTime; } + + unsigned int& getNumberGenerated() { return _numGenerated; } + double& getGenerateTime() { return _generateTime; } + + unsigned int& getNumberApplied() { return _numApplied; } + double& getApplyTime() { return _applyTime; } + + static osg::ref_ptr& getGLBufferObjectManager(unsigned int contextID); + + protected: + + typedef std::map< BufferObjectProfile, osg::ref_ptr > GLBufferObjectSetMap; + unsigned int _contextID; + unsigned int _numActiveGLBufferObjects; + unsigned int _numOrphanedGLBufferObjects; + unsigned int _currGLBufferObjectPoolSize; + unsigned int _maxGLBufferObjectPoolSize; + GLBufferObjectSetMap _glBufferObjectSetMap; + + unsigned int _frameNumber; + + unsigned int _numFrames; + unsigned int _numDeleted; + double _deleteTime; + + unsigned int _numGenerated; + double _generateTime; + + unsigned int _numApplied; + double _applyTime; + +}; + + class OSG_EXPORT BufferObject : public Object { public: @@ -294,18 +481,21 @@ class OSG_EXPORT BufferObject : public Object virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "BufferObject"; } - void setTarget(GLenum target) { _target = target; } - GLenum getTarget() const { return _target; } + void setTarget(GLenum target) { _profile._target = target; } + GLenum getTarget() const { return _profile._target; } /** Set what type of usage the buffer object will have. Options are: * GL_STREAM_DRAW, GL_STREAM_READ, GL_STREAM_COPY, * GL_STATIC_DRAW, GL_STATIC_READ, GL_STATIC_COPY, * GL_DYNAMIC_DRAW, GL_DYNAMIC_READ, or GL_DYNAMIC_COPY. */ - void setUsage(GLenum usage) { _usage = usage; } + void setUsage(GLenum usage) { _profile._usage = usage; } /** Get the type of usage the buffer object has been set up for.*/ - GLenum getUsage() const { return _usage; } + GLenum getUsage() const { return _profile._usage; } + + BufferObjectProfile& getProfile() { return _profile; } + const BufferObjectProfile& getProfile() const { return _profile; } void dirty(); @@ -327,6 +517,8 @@ class OSG_EXPORT BufferObject : public Object unsigned int getNumBufferData() const { return _bufferDataList.size(); } + void setGLBufferObject(unsigned int contextID, GLBufferObject* glbo) { _glBufferObjects[contextID] = glbo; } + GLBufferObject* getGLBufferObject(unsigned int contextID) const { return _glBufferObjects[contextID].get(); } GLBufferObject* getOrCreateGLBufferObject(unsigned int contextID) const @@ -335,6 +527,8 @@ class OSG_EXPORT BufferObject : public Object return _glBufferObjects[contextID].get(); } + unsigned int computeRequiredBufferSize() const; + protected: ~BufferObject(); @@ -342,8 +536,8 @@ class OSG_EXPORT BufferObject : public Object typedef std::vector< BufferData* > BufferDataList; typedef osg::buffered_object< osg::ref_ptr > GLBufferObjects; - GLenum _target; - GLenum _usage; + BufferObjectProfile _profile; + BufferDataList _bufferDataList; mutable GLBufferObjects _glBufferObjects; @@ -487,10 +681,10 @@ class OSG_EXPORT PixelDataBufferObject : public BufferObject META_Object(osg, PixelDataBufferObject); //! Set new size of the buffer object. This will reallocate the memory on the next compile - inline void setDataSize(unsigned int size) { _dataSize = size; dirty(); } + inline void setDataSize(unsigned int size) { _profile._size = size; dirty(); } //! Get data size of the used buffer - inline unsigned int getDataSize() const { return _dataSize; } + inline unsigned int getDataSize() const { return _profile._size; } //! Compile the buffer (reallocate the memory if buffer is dirty) virtual void compileBuffer(State& state) const; @@ -525,8 +719,6 @@ class OSG_EXPORT PixelDataBufferObject : public BufferObject virtual ~PixelDataBufferObject(); - unsigned int _dataSize; - typedef osg::buffered_value ModeList; mutable ModeList _mode; diff --git a/include/osg/DisplaySettings b/include/osg/DisplaySettings index 6b655e793..ddaa451a3 100644 --- a/include/osg/DisplaySettings +++ b/include/osg/DisplaySettings @@ -203,11 +203,8 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced void setMaxTexturePoolSize(unsigned int size) { _maxTexturePoolSize = size; } unsigned int getMaxTexturePoolSize() const { return _maxTexturePoolSize; } - void setMaxVBOPoolSize(unsigned int size) { _maxVBOPoolSize = size; } - unsigned int getMaxVBOPoolSize() const { return _maxVBOPoolSize; } - - void setMaxFBOPoolSize(unsigned int size) { _maxFBOPoolSize = size; } - unsigned int getMaxFBOPoolSize() const { return _maxFBOPoolSize; } + void setMaxBufferObjectPoolSize(unsigned int size) { _maxBufferObjectPoolSize = size; } + unsigned int getMaxBufferObjectPoolSize() const { return _maxBufferObjectPoolSize; } protected: @@ -251,8 +248,7 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced std::string _application; unsigned int _maxTexturePoolSize; - unsigned int _maxVBOPoolSize; - unsigned int _maxFBOPoolSize; + unsigned int _maxBufferObjectPoolSize; }; } diff --git a/include/osg/State b/include/osg/State index e3457f512..8f8d34619 100644 --- a/include/osg/State +++ b/include/osg/State @@ -411,7 +411,7 @@ class OSG_EXPORT State : public Referenced, public Observer { if (vbo == _currentVBO) return; if (vbo->isDirty()) vbo->compileBuffer(); - else _glBindBuffer(GL_ARRAY_BUFFER_ARB,vbo->getGLObjectID()); + else vbo->bindBuffer(); _currentVBO = vbo; } @@ -429,7 +429,7 @@ class OSG_EXPORT State : public Referenced, public Observer { if (ebo == _currentEBO) return; if (ebo->isDirty()) ebo->compileBuffer(); - else _glBindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB,ebo->getGLObjectID()); + else ebo->bindBuffer(); _currentEBO = ebo; } @@ -448,7 +448,7 @@ class OSG_EXPORT State : public Referenced, public Observer if (pbo == _currentPBO) return; if (pbo->isDirty()) pbo->compileBuffer(); - else _glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB,pbo->getGLObjectID()); + else pbo->bindBuffer(); _currentPBO = pbo; } @@ -1040,12 +1040,8 @@ class OSG_EXPORT State : public Referenced, public Observer void setMaxTexturePoolSize(unsigned int size); unsigned int getMaxTexturePoolSize() const { return _maxTexturePoolSize; } - void setMaxVBOPoolSize(unsigned int size); - unsigned int getMaxVBOPoolSize() const { return _maxVBOPoolSize; } - - void setMaxFBOPoolSize(unsigned int size); - unsigned int getMaxFBOPoolSize() const { return _maxFBOPoolSize; } - + void setMaxBufferObjectPoolSize(unsigned int size); + unsigned int getMaxBufferObjectPoolSize() const { return _maxBufferObjectPoolSize; } enum CheckForGLErrors @@ -1233,8 +1229,7 @@ class OSG_EXPORT State : public Referenced, public Observer StateSetStack _stateStateStack; unsigned int _maxTexturePoolSize; - unsigned int _maxVBOPoolSize; - unsigned int _maxFBOPoolSize; + unsigned int _maxBufferObjectPoolSize; struct EnabledArrayPair diff --git a/include/osg/Texture b/include/osg/Texture index 49580f967..90e051873 100644 --- a/include/osg/Texture +++ b/include/osg/Texture @@ -1000,7 +1000,7 @@ class OSG_EXPORT Texture : public osg::StateAttribute typedef std::list< ref_ptr > TextureObjectList; - class TextureObjectSet : public Referenced + class OSG_EXPORT TextureObjectSet : public Referenced { public: TextureObjectSet(TextureObjectManager* parent, const TextureProfile& profile); diff --git a/src/osg/BufferObject.cpp b/src/osg/BufferObject.cpp index c4753d23c..d6acf478e 100644 --- a/src/osg/BufferObject.cpp +++ b/src/osg/BufferObject.cpp @@ -37,6 +37,8 @@ typedef osg::buffered_object DeletedBufferObjectCache; static OpenThreads::Mutex s_mutex_deletedBufferObjectCache; static DeletedBufferObjectCache s_deletedBufferObjectCache; +unsigned int s_minimumNumberOfGLBufferObjectsToRetainInCache = 1000; + ////////////////////////////////////////////////////////////////////////////////////////////////////// // // GLBufferObject @@ -44,11 +46,13 @@ static DeletedBufferObjectCache s_deletedBufferObjectCache; GLBufferObject::GLBufferObject(unsigned int contextID, BufferObject* bufferObject): _contextID(contextID), _glObjectID(0), - _target(0), - _usage(0), + _profile(0,0,0), + _allocatedSize(0), _dirty(true), - _totalSize(0), _bufferObject(0), + _set(0), + _previous(0), + _next(0), _extensions(0) { assign(bufferObject); @@ -58,8 +62,17 @@ GLBufferObject::GLBufferObject(unsigned int contextID, BufferObject* bufferObjec GLBufferObject::~GLBufferObject() { - if (_glObjectID!=0) GLBufferObject::deleteBufferObject(_contextID, _glObjectID); +} +void GLBufferObject::bindBuffer() +{ + _extensions->glBindBuffer(_profile._target,_glObjectID); + if (_set) _set->moveToBack(this); +} + +void GLBufferObject::setBufferObject(BufferObject* bufferObject) +{ + assign(bufferObject); } void GLBufferObject::assign(BufferObject* bufferObject) @@ -68,10 +81,7 @@ void GLBufferObject::assign(BufferObject* bufferObject) if (_bufferObject) { - _target = bufferObject->getTarget(); - _usage = bufferObject->getUsage(); - - _totalSize = 0; + _profile = bufferObject->getProfile(); _dirty = true; @@ -79,10 +89,7 @@ void GLBufferObject::assign(BufferObject* bufferObject) } else { - _target = 0; - _usage = 0; - - _totalSize = 0; + _profile.setProfile(0,0,0); // clear all previous entries; _bufferEntries.clear(); @@ -101,8 +108,6 @@ void GLBufferObject::compileBuffer() _bufferEntries.reserve(_bufferObject->getNumBufferData()); - _totalSize = 0; - bool compileAll = false; bool offsetChanged = false; @@ -155,18 +160,38 @@ void GLBufferObject::compileBuffer() } } + if (i<_bufferEntries.size()) { // triming end of bufferEntries as the source data is has less entries than the originally held. _bufferEntries.erase(_bufferEntries.begin()+i, _bufferEntries.end()); } - _extensions->glBindBuffer(_target, _glObjectID); + _extensions->glBindBuffer(_profile._target, _glObjectID); - if (newTotalSize != _totalSize) + if (newTotalSize > _profile._size) { - _totalSize = newTotalSize; - _extensions->glBufferData(_target, _totalSize, NULL, _usage); + osg::notify(osg::NOTICE)<<"newTotalSize="<getContextID()), + _profile(profile), + _numOfGLBufferObjects(0), + _head(0), + _tail(0) +{ + osg::notify(osg::NOTICE)<<"GLBufferObjectSet::GLBufferObjectSet _profile._size="<<_profile._size<_next) + { + if ((to->_next)->_previous != to) + { + osg::notify(osg::NOTICE)<<"Error (to->_next)->_previous != to "<_next)->_previous != to "; + } + } + else + { + if (_tail != to) + { + osg::notify(osg::NOTICE)<<"Error _trail != to"<_next; + } + + unsigned int totalNumber = numInList + _orphanedGLBufferObjects.size(); + if (totalNumber != _numOfGLBufferObjects) + { + osg::notify(osg::NOTICE)<<"Error numInList + _orphanedGLBufferObjects.size() != _numOfGLBufferObjects"<get(); + + _orphanedGLBufferObjects.push_back(to); + + remove(to); + +#if 0 + osg::notify(osg::NOTICE)<<" HPOTO after _head = "<<_head<_previous = "<_previous<_next = "<_next<getNumberOrphanedGLBufferObjects() += numOrphaned; + _parent->getNumberActiveGLBufferObjects() -= numOrphaned; + + _pendingOrphanedGLBufferObjects.clear(); + + checkConsistency(); +} + +void GLBufferObjectSet::flushAllDeletedGLBufferObjects() +{ + for(GLBufferObjectList::iterator itr = _orphanedGLBufferObjects.begin(); + itr != _orphanedGLBufferObjects.end(); + ++itr) + { + + (*itr)->deleteGLObject(); + + osg::notify(osg::NOTICE)<<"Deleting textureobject id="<<(*itr)->getGLObjectID()<getCurrGLBufferObjectPoolSize() -= numDeleted*_profile._size; + _parent->getNumberOrphanedGLBufferObjects() -= numDeleted; + _parent->getNumberDeleted() += numDeleted; + + _orphanedGLBufferObjects.clear(); +} + +void GLBufferObjectSet::discardAllDeletedGLBufferObjects() +{ + unsigned int numDiscarded = _orphanedGLBufferObjects.size(); + + _numOfGLBufferObjects -= numDiscarded; + + // update the GLBufferObjectManager's running total of current pool size + _parent->setCurrGLBufferObjectPoolSize( _parent->getCurrGLBufferObjectPoolSize() - numDiscarded*_profile._size ); + + // update the number of active and orphaned TextureOjects + _parent->getNumberOrphanedGLBufferObjects() -= 1; + _parent->getNumberActiveGLBufferObjects() += 1; + _parent->getNumberDeleted() += 1; + + + // just clear the list as there is nothing else we can do with them when discarding them + _orphanedGLBufferObjects.clear(); +} + +void GLBufferObjectSet::flushDeletedGLBufferObjects(double currentTime, double& availableTime) +{ + // if nothing to delete return + if (_orphanedGLBufferObjects.empty()) return; + + // if no time available don't try to flush objects. + if (availableTime<=0.0) return; + + // if we don't have too many orphaned texture objects then don't bother deleting them, as we can potentially reuse them later. + if (_parent->getNumberOrphanedGLBufferObjects()<=s_minimumNumberOfGLBufferObjectsToRetainInCache) return; + + unsigned int numDeleted = 0; + unsigned int maxNumObjectsToDelete = _parent->getNumberOrphanedGLBufferObjects()-s_minimumNumberOfGLBufferObjectsToRetainInCache; + if (maxNumObjectsToDelete>4) maxNumObjectsToDelete = 4; + + ElapsedTime timer; + + GLBufferObjectList::iterator itr = _orphanedGLBufferObjects.begin(); + for(; + itr != _orphanedGLBufferObjects.end() && timer.elapsedTime()setBufferObject(bufferObject); + glbo->setProfile(_profile); + + return glbo.release(); + } + + // + GLBufferObject* glbo = new GLBufferObject(_contextID, const_cast(bufferObject)); + glbo->setProfile(_profile); + glbo->_set = this; + ++_numOfGLBufferObjects; + + // update the current texture pool size + _parent->getCurrGLBufferObjectPoolSize() += _profile._size; + _parent->getNumberActiveGLBufferObjects() += 1; + + addToBack(glbo); + + // osg::notify(osg::NOTICE)<<"Created new GLBufferObject, _numOfGLBufferObjects "<<_numOfGLBufferObjects<_previous = "<_previous<_next = "<_next<_frameLastUsed = _parent->getFrameNumber(); + + // nothing to do if we are already tail + if (to==_tail) return; + + // if no tail exists then assign 'to' as tail and head + if (_tail==0) + { + osg::notify(osg::NOTICE)<<"Error ***************** Should not get here !!!!!!!!!"<_next==0) + { + osg::notify(osg::NOTICE)<<"Error ***************** Should not get here either !!!!!!!!!"<_previous) + { + (to->_previous)->_next = to->_next; + } + else + { + // 'to' is the head, so moving it to the back will mean we need a new head + if (to->_next) + { + _head = to->_next; + } + } + + (to->_next)->_previous = to->_previous; + + _tail->_next = to; + + to->_previous = _tail; + to->_next = 0; + + _tail = to; + +#if 0 + osg::notify(osg::NOTICE)<<" m2B after _head = "<<_head<_previous = "<_previous<_next = "<_next<_previous = "<_previous<_next = "<_next<_previous !=0 || to->_next !=0) + { + moveToBack(to); + } + else + { + to->_frameLastUsed = _parent->getFrameNumber(); + + if (_tail) _tail->_next = to; + to->_previous = _tail; + + if (!_head) _head = to; + _tail = to; + } +#if 0 + osg::notify(osg::NOTICE)<<" a2B after _head = "<<_head<_previous = "<_previous<_next = "<_next< lock(_mutex); + + // disconnect from original texture + to->setBufferObject(0); + + // add orphan 'to' to the pending list of orphans, these will then be + // handled in the handlePendingOrphandedGLBufferObjects() where the TO's + // will be removed from the active list, and then placed in the orhpanGLBufferObject + // list. This double buffered approach to handling orphaned TO's is used + // to avoid having to mutex the process of appling active TO's. + _pendingOrphanedGLBufferObjects.push_back(to); + +#if 0 + osg::notify(osg::NOTICE)<<"GLBufferObjectSet::orphan("<getFrameNumber(); + else ++_frameNumber; + + ++_numFrames; +} + +void GLBufferObjectManager::reportStats() +{ + double numFrames(_numFrames==0 ? 1.0 : _numFrames); + osg::notify(osg::NOTICE)<<"GLBufferObjectMananger::reportStats()"<& GLBufferObjectManager::getGLBufferObjectManager(unsigned int contextID) +{ + typedef osg::buffered_object< ref_ptr > GLBufferObjectManagerBuffer; + static GLBufferObjectManagerBuffer s_GLBufferObjectManager; + if (!s_GLBufferObjectManager[contextID]) s_GLBufferObjectManager[contextID] = new GLBufferObjectManager(contextID); + return s_GLBufferObjectManager[contextID]; +} + +GLBufferObject* GLBufferObject::createGLBufferObject(unsigned int contextID, const BufferObject* bufferObject) +{ + return GLBufferObjectManager::getGLBufferObjectManager(contextID)->generateGLBufferObject(bufferObject); +} + +void GLBufferObject::flushAllDeletedBufferObjects(unsigned int contextID) +{ + GLBufferObjectManager::getGLBufferObjectManager(contextID)->flushAllDeletedGLBufferObjects(); +} + +void GLBufferObject::discardAllDeletedBufferObjects(unsigned int contextID) +{ + GLBufferObjectManager::getGLBufferObjectManager(contextID)->discardAllDeletedGLBufferObjects(); +} + +void GLBufferObject::flushDeletedBufferObjects(unsigned int contextID,double currentTime, double& availbleTime) +{ + GLBufferObjectManager::getGLBufferObjectManager(contextID)->flushDeletedGLBufferObjects(currentTime, availbleTime); +} + +void GLBufferObject::releaseGLBufferObject(unsigned int contextID, GLBufferObject* to) +{ + GLBufferObjectManager::getGLBufferObjectManager(contextID)->releaseGLBufferObject(to); +} + + ////////////////////////////////////////////////////////////////////////////////////////////////////// // // BufferObject // -BufferObject::BufferObject(): - _target(0), - _usage(0) +BufferObject::BufferObject() { } @@ -441,6 +1081,7 @@ BufferObject::~BufferObject() releaseGLObjects(0); } + void BufferObject::setBufferData(unsigned int index, BufferData* bd) { if (index>=_bufferDataList.size()) _bufferDataList.resize(index+1); @@ -464,11 +1105,23 @@ void BufferObject::releaseGLObjects(State* state) const { if (state) { - _glBufferObjects[state->getContextID()] = 0; + unsigned int contextID = state->getContextID(); + if (_glBufferObjects[contextID].valid()) + { + GLBufferObject::releaseGLBufferObject(contextID, _glBufferObjects[contextID].get()); + _glBufferObjects[contextID] = 0; + } } else { - _glBufferObjects.clear(); + for(unsigned int i=0; i<_glBufferObjects.size();++i) + { + if (_glBufferObjects[i].valid()) + { + GLBufferObject::releaseGLBufferObject(i, _glBufferObjects[i].get()); + _glBufferObjects[i] = 0; + } + } } } @@ -528,6 +1181,19 @@ void BufferObject::removeBufferData(BufferData* bd) removeBufferData(bd->getBufferIndex()); } +unsigned int BufferObject::computeRequiredBufferSize() const +{ + unsigned int newTotalSize = 0; + for(BufferDataList::const_iterator itr = _bufferDataList.begin(); + itr != _bufferDataList.end(); + ++itr) + { + BufferData* bd = *itr; + newTotalSize += bd->getTotalDataSize(); + } + return newTotalSize; +} + ////////////////////////////////////////////////////////////////////////////////////////////////////// // // BufferData @@ -556,8 +1222,8 @@ void BufferData::setBufferObject(BufferObject* bufferObject) // VertexBufferObject::VertexBufferObject() { - _target = GL_ARRAY_BUFFER_ARB; - _usage = GL_STATIC_DRAW_ARB; + setTarget(GL_ARRAY_BUFFER_ARB); + setUsage(GL_STATIC_DRAW_ARB); // _usage = GL_DYNAMIC_DRAW_ARB; // _usage = GL_STREAM_DRAW_ARB; } @@ -595,177 +1261,6 @@ const Array* VertexBufferObject::getArray(unsigned int i) const { return dynamic_cast(getBufferData(i)); } -#if 0 -void VertexBufferObject::compileBuffer(State& state) const -{ - unsigned int contextID = state.getContextID(); - - _compiledList[contextID] = 1; - - Extensions* extensions = getExtensions(contextID,true); - - // osg::notify(osg::NOTICE)<<"VertexBufferObject::compileBuffer frameNumber="<getFrameNumber()<getTotalDataSize(); - if (bep.first.dataSize == 0) ++numNewArrays; - } - } - - bool copyAll = false; - GLuint& vbo = buffer(contextID); - if (vbo==0) - { - // building for the first time. - - _totalSize = totalSizeRequired; - - // don't generate buffer if size is zero. - if (_totalSize==0) return; - - extensions->glGenBuffers(1, &vbo); - extensions->glBindBuffer(_target, vbo); - extensions->glBufferData(_target, _totalSize, NULL, _usage); - - copyAll = true; - } - else - { - extensions->glBindBuffer(_target, vbo); - - if (_totalSize != totalSizeRequired) - { - // resize vbo. - _totalSize = totalSizeRequired; - extensions->glBufferData(_target, _totalSize, NULL, _usage); - - copyAll = true; - } - } - - typedef std::map > SizePosMap_t; - SizePosMap_t freeList; - if (copyAll == false && numNewArrays > 0) - { - std::map usedList; - for(BufferEntryArrayPairs::const_iterator itr = _bufferEntryArrayPairs.begin(); - itr != _bufferEntryArrayPairs.end(); - ++itr) - { - const BufferEntryArrayPair& bep = *itr; - if (bep.second==NULL) continue; - if (bep.first.dataSize == 0) continue; - usedList[bep.first.offset] = bep.first.dataSize; - } - unsigned int numFreeBlocks = 0; - unsigned int pos=0; - - for (std::map::const_iterator it=usedList.begin(); it!=usedList.end(); ++it) - { - unsigned int start = it->first; - unsigned int length = it->second; - if (pos < start) - { - freeList[start-pos].push_back(pos); - ++numFreeBlocks; - } - pos = start+length; - } - if (pos < totalSizeRequired) - { - freeList[totalSizeRequired-pos].push_back(pos); - ++numFreeBlocks; - } - if (numNewArrays < numFreeBlocks) - { - copyAll = true; // too fragmented, fallback to copyAll - freeList.clear(); - } - } - - -// osg::Timer_t start_tick = osg::Timer::instance()->tick(); - - - void* vboMemory = 0; - -#if 0 - vboMemory = extensions->glMapBuffer(_target, GL_WRITE_ONLY_ARB); -#endif - - unsigned int offset = 0; - for(BufferEntryArrayPairs::const_iterator itr = _bufferEntryArrayPairs.begin(); - itr != _bufferEntryArrayPairs.end(); - ++itr) - { - const BufferEntryArrayPair& bep = *itr; - const Array* de = bep.second; - if (de) - { - const unsigned int arraySize = de->getTotalDataSize(); - if (copyAll || - bep.first.modifiedCount[contextID] != bep.second->getModifiedCount() || - bep.first.dataSize != arraySize) - { - // copy data across - unsigned int newOffset = bep.first.offset; - if (copyAll) - { - newOffset = offset; - offset += arraySize; - } - else if (bep.first.dataSize == 0) - { - SizePosMap_t::iterator findIt = freeList.lower_bound(arraySize); - if (findIt==freeList.end()) - { - osg::notify(osg::FATAL)<<"No suitable Memory in VBO found!"<second.back(); - newOffset = oldOffset; - if (findIt->first > arraySize) // using larger block - { - freeList[findIt->first-arraySize].push_back(oldOffset+arraySize); - } - findIt->second.pop_back(); - if (findIt->second.empty()) - { - freeList.erase(findIt); - } - } - bep.first.dataSize = arraySize; - bep.first.modifiedCount[contextID] = de->getModifiedCount(); - bep.first.offset = newOffset; - de->setVertexBufferObjectOffset((GLvoid*)newOffset); - - // osg::notify(osg::NOTICE)<<" copying vertex buffer data "<getDataPointer(), bep.first.dataSize); - else - extensions->glBufferSubData(_target, bep.first.offset, bep.first.dataSize, de->getDataPointer()); - - } - } - } - - - // Unmap the texture image buffer - if (vboMemory) extensions->glUnmapBuffer(_target); - -// osg::notify(osg::NOTICE)<<"pbo _totalSize="<<_totalSize<delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<getTotalDataSize(); - } - } - - bool copyAll = false; - GLuint& ebo = buffer(contextID); - if (ebo==0) - { - // building for the first time. - - _totalSize = totalSizeRequired; - - // don't generate buffer if size is zero. - if (_totalSize==0) return; - - extensions->glGenBuffers(1, &ebo); - extensions->glBindBuffer(_target, ebo); - extensions->glBufferData(_target, _totalSize, NULL, _usage); - - copyAll = true; - } - else - { - extensions->glBindBuffer(_target, ebo); - - if (_totalSize != totalSizeRequired) - { - // resize EBO. - _totalSize = totalSizeRequired; - extensions->glBufferData(_target, _totalSize, NULL, _usage); - - copyAll = true; - } - } - -// osg::Timer_t start_tick = osg::Timer::instance()->tick(); - - - void* eboMemory = 0; - -#if 0 - eboMemory = extensions->glMapBuffer(_target, GL_WRITE_ONLY_ARB); -#endif - - size_t offset = 0; - for(BufferEntryDrawElementsPairs::const_iterator itr = _bufferEntryDrawElementsPairs.begin(); - itr != _bufferEntryDrawElementsPairs.end(); - ++itr) - { - const BufferEntryDrawElementsPair& bep = *itr; - const DrawElements* de = bep.second; - if (de) - { - if (copyAll || - bep.first.modifiedCount[contextID] != bep.second->getModifiedCount() || - bep.first.dataSize != bep.second->getTotalDataSize()) - { - // copy data across - bep.first.dataSize = bep.second->getTotalDataSize(); - bep.first.modifiedCount[contextID] = de->getModifiedCount(); - if (copyAll) - { - bep.first.offset = offset; - de->setElementBufferObjectOffset((GLvoid*)offset); - offset += bep.first.dataSize; - } - - if (eboMemory) - memcpy((char*)eboMemory + bep.first.offset, de->getDataPointer(), bep.first.dataSize); - else - extensions->glBufferSubData(_target, bep.first.offset, bep.first.dataSize, de->getDataPointer()); - - } - } - } - - - // Unmap the texture image buffer - if (eboMemory) extensions->glUnmapBuffer(_target); - -// osg::notify(osg::NOTICE)<<"pbo _totalSize="<<_totalSize<delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<isDirty()) return; - bo->_extensions->glBindBuffer(_target, bo->getGLObjectID()); - bo->_extensions->glBufferData(_target, _dataSize, NULL, _usage); - bo->_extensions->glBindBuffer(_target, 0); + bo->_extensions->glBindBuffer(_profile._target, bo->getGLObjectID()); + bo->_extensions->glBufferData(_profile._target, _profile._size, NULL, _profile._usage); + bo->_extensions->glBindBuffer(_profile._target, 0); } //-------------------------------------------------------------------------------- @@ -1096,7 +1427,7 @@ void PixelDataBufferObject::unbindBuffer(unsigned int contextID) const extensions->glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB,0); break; default: - extensions->glBindBuffer(_target,0); + extensions->glBindBuffer(_profile._target,0); break; } @@ -1109,7 +1440,4 @@ void PixelDataBufferObject::resizeGLObjectBuffers(unsigned int maxSize) BufferObject::resizeGLObjectBuffers(maxSize); _mode.resize(maxSize); -} - - -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/osg/DisplaySettings.cpp b/src/osg/DisplaySettings.cpp index d8f433ffb..28bcc629a 100644 --- a/src/osg/DisplaySettings.cpp +++ b/src/osg/DisplaySettings.cpp @@ -82,8 +82,7 @@ void DisplaySettings::setDisplaySettings(const DisplaySettings& vs) _application = vs._application; _maxTexturePoolSize = vs._maxTexturePoolSize; - _maxVBOPoolSize = vs._maxVBOPoolSize; - _maxFBOPoolSize = vs._maxFBOPoolSize; + _maxBufferObjectPoolSize = vs._maxBufferObjectPoolSize; } void DisplaySettings::merge(const DisplaySettings& vs) @@ -109,8 +108,7 @@ void DisplaySettings::merge(const DisplaySettings& vs) if (_application.empty()) _application = vs._application; if (vs._maxTexturePoolSize>_maxTexturePoolSize) _maxTexturePoolSize = vs._maxTexturePoolSize; - if (vs._maxVBOPoolSize>_maxVBOPoolSize) _maxVBOPoolSize = vs._maxVBOPoolSize; - if (vs._maxFBOPoolSize>_maxFBOPoolSize) _maxFBOPoolSize = vs._maxFBOPoolSize; + if (vs._maxBufferObjectPoolSize>_maxBufferObjectPoolSize) _maxBufferObjectPoolSize = vs._maxBufferObjectPoolSize; } void DisplaySettings::setDefaults() @@ -157,8 +155,7 @@ void DisplaySettings::setDefaults() _numHttpDatabaseThreadsHint = 1; _maxTexturePoolSize = 0; - _maxVBOPoolSize = 0; - _maxFBOPoolSize = 0; + _maxBufferObjectPoolSize = 0; } void DisplaySettings::setMaxNumberOfGraphicsContexts(unsigned int num) @@ -199,7 +196,7 @@ static ApplicationUsageProxy DisplaySetting_e15(ApplicationUsage::ENVIRONMENTAL_ static ApplicationUsageProxy DisplaySetting_e16(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_NUM_HTTP_DATABASE_THREADS ","Set the hint for the total number of threads dedicated to http requests to set up in the DatabasePager."); static ApplicationUsageProxy DisplaySetting_e17(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_MULTI_SAMPLES ","Set the hint for the number of samples to use when multi-sampling."); static ApplicationUsageProxy DisplaySetting_e18(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_TEXTURE_POOL_SIZE ","Set the hint size of texture pool to manage."); -static ApplicationUsageProxy DisplaySetting_e19(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_VBO_POOL_SIZE ","Set the hint size of vertex buffer object pool to manage."); +static ApplicationUsageProxy DisplaySetting_e19(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_BUFFER_OBJECT_POOL_SIZE ","Set the hint size of vertex buffer object pool to manage."); static ApplicationUsageProxy DisplaySetting_e20(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_FBO_POOL_SIZE ","Set the hint size of frame buffer object pool to manage."); void DisplaySettings::readEnvironmentalVariables() @@ -403,14 +400,9 @@ void DisplaySettings::readEnvironmentalVariables() _maxTexturePoolSize = atoi(ptr); } - if( (ptr = getenv("OSG_VBO_POOL_SIZE")) != 0) + if( (ptr = getenv("OSG_BUFFER_OBJECT_POOL_SIZE")) != 0) { - _maxVBOPoolSize = atoi(ptr); - } - - if( (ptr = getenv("OSG_FBO_POOL_SIZE")) != 0) - { - _maxFBOPoolSize = atoi(ptr); + _maxBufferObjectPoolSize = atoi(ptr); } } @@ -500,8 +492,7 @@ void DisplaySettings::readCommandLine(ArgumentParser& arguments) while(arguments.read("--num-http-threads",_numHttpDatabaseThreadsHint)) {} while(arguments.read("--texture-pool-size",_maxTexturePoolSize)) {} - while(arguments.read("--vbo-pool-size",_maxVBOPoolSize)) {} - while(arguments.read("--fbo-pool-size",_maxFBOPoolSize)) {} + while(arguments.read("--buffer-object-pool-size",_maxBufferObjectPoolSize)) {} } diff --git a/src/osg/GLObjects.cpp b/src/osg/GLObjects.cpp index 16e47821e..89c382380 100644 --- a/src/osg/GLObjects.cpp +++ b/src/osg/GLObjects.cpp @@ -53,7 +53,7 @@ void osg::flushAllDeletedGLObjects(unsigned int contextID) void osg::discardAllDeletedGLObjects(unsigned int contextID) { - osg::GLBufferObject::discardDeletedBufferObjects(contextID); + osg::GLBufferObject::discardAllDeletedBufferObjects(contextID); osg::Drawable::discardAllDeletedDisplayLists(contextID); osg::FragmentProgram::discardDeletedFragmentProgramObjects(contextID); osg::FrameBufferObject::discardDeletedFrameBufferObjects(contextID); diff --git a/src/osg/State.cpp b/src/osg/State.cpp index bb24ec646..1db497a42 100644 --- a/src/osg/State.cpp +++ b/src/osg/State.cpp @@ -89,8 +89,7 @@ State::State(): _glMaxTextureUnits = 1; _maxTexturePoolSize = 0; - _maxVBOPoolSize = 0; - _maxFBOPoolSize = 0; + _maxBufferObjectPoolSize = 0; } State::~State() @@ -232,16 +231,11 @@ void State::setMaxTexturePoolSize(unsigned int size) osg::notify(osg::NOTICE)<<"_maxTexturePoolSize="<<_maxTexturePoolSize<id(); - // osg::notify(osg::NOTICE)<<"Deleting textureobject id="<getDynamicObjectCount()<getMaxTexturePoolSize(); - unsigned int maxVBOPoolSize = osg::DisplaySettings::instance()->getMaxVBOPoolSize(); - unsigned int maxFBOPoolSize = osg::DisplaySettings::instance()->getMaxFBOPoolSize(); + unsigned int maxBufferObjectPoolSize = osg::DisplaySettings::instance()->getMaxBufferObjectPoolSize(); for(Contexts::iterator citr = contexts.begin(); citr != contexts.end(); @@ -552,8 +551,7 @@ void CompositeViewer::realize() // set the pool sizes, 0 the default will result in no GL object pools. gc->getState()->setMaxTexturePoolSize(maxTexturePoolSize); - gc->getState()->setMaxVBOPoolSize(maxVBOPoolSize); - gc->getState()->setMaxFBOPoolSize(maxFBOPoolSize); + gc->getState()->setMaxBufferObjectPoolSize(maxBufferObjectPoolSize); gc->realize(); diff --git a/src/osgViewer/StatsHandler.cpp b/src/osgViewer/StatsHandler.cpp index 7e9e7eaa3..959b04067 100644 --- a/src/osgViewer/StatsHandler.cpp +++ b/src/osgViewer/StatsHandler.cpp @@ -1400,7 +1400,7 @@ void StatsHandler::setUpScene(osgViewer::ViewerBase* viewer) viewStr << "Lights" << std::endl; viewStr << "Bins" << std::endl; viewStr << "Depth" << std::endl; - viewStr << "Matrices" << std::endl; + viewStr << "Materials" << std::endl; viewStr << "Imposters" << std::endl; viewStr << "Drawables" << std::endl; viewStr << "Vertices" << std::endl; diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index 580ea3361..5d5128e8c 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -481,13 +481,9 @@ void Viewer::realize() if (_camera->getDisplaySettings()) maxTexturePoolSize = std::max(maxTexturePoolSize, _camera->getDisplaySettings()->getMaxTexturePoolSize()); if (_displaySettings.valid()) maxTexturePoolSize = std::max(maxTexturePoolSize, _displaySettings->getMaxTexturePoolSize()); - unsigned int maxVBOPoolSize = osg::DisplaySettings::instance()->getMaxVBOPoolSize(); - if (_displaySettings.valid()) maxVBOPoolSize = std::max(maxVBOPoolSize, _displaySettings->getMaxVBOPoolSize()); - if (_camera->getDisplaySettings()) maxVBOPoolSize = std::max(maxVBOPoolSize, _camera->getDisplaySettings()->getMaxVBOPoolSize()); - - unsigned int maxFBOPoolSize = osg::DisplaySettings::instance()->getMaxFBOPoolSize(); - if (_displaySettings.valid()) maxFBOPoolSize = std::max(maxFBOPoolSize, _displaySettings->getMaxFBOPoolSize()); - if (_camera->getDisplaySettings()) maxFBOPoolSize = std::max(maxFBOPoolSize, _camera->getDisplaySettings()->getMaxFBOPoolSize()); + unsigned int maxBufferObjectPoolSize = osg::DisplaySettings::instance()->getMaxBufferObjectPoolSize(); + if (_displaySettings.valid()) maxBufferObjectPoolSize = std::max(maxBufferObjectPoolSize, _displaySettings->getMaxBufferObjectPoolSize()); + if (_camera->getDisplaySettings()) maxBufferObjectPoolSize = std::max(maxBufferObjectPoolSize, _camera->getDisplaySettings()->getMaxBufferObjectPoolSize()); for(Contexts::iterator citr = contexts.begin(); citr != contexts.end(); @@ -497,8 +493,7 @@ void Viewer::realize() // set the pool sizes, 0 the default will result in no GL object pools. gc->getState()->setMaxTexturePoolSize(maxTexturePoolSize); - gc->getState()->setMaxVBOPoolSize(maxVBOPoolSize); - gc->getState()->setMaxFBOPoolSize(maxFBOPoolSize); + gc->getState()->setMaxBufferObjectPoolSize(maxBufferObjectPoolSize); gc->realize(); diff --git a/src/osgWrappers/osg/BufferObject.cpp b/src/osgWrappers/osg/BufferObject.cpp index 88315c714..49d6be653 100644 --- a/src/osgWrappers/osg/BufferObject.cpp +++ b/src/osgWrappers/osg/BufferObject.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -173,6 +174,16 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::BufferObject) __GLenum__getUsage, "Get the type of usage the buffer object has been set up for. ", ""); + I_Method0(osg::BufferObjectProfile &, getProfile, + Properties::NON_VIRTUAL, + __BufferObjectProfile_R1__getProfile, + "", + ""); + I_Method0(const osg::BufferObjectProfile &, getProfile, + Properties::NON_VIRTUAL, + __C5_BufferObjectProfile_R1__getProfile, + "", + ""); I_Method0(void, dirty, Properties::NON_VIRTUAL, __void__dirty, @@ -223,6 +234,11 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::BufferObject) __unsigned_int__getNumBufferData, "", ""); + I_Method2(void, setGLBufferObject, IN, unsigned int, contextID, IN, osg::GLBufferObject *, glbo, + Properties::NON_VIRTUAL, + __void__setGLBufferObject__unsigned_int__GLBufferObject_P1, + "", + ""); I_Method1(osg::GLBufferObject *, getGLBufferObject, IN, unsigned int, contextID, Properties::NON_VIRTUAL, __GLBufferObject_P1__getGLBufferObject__unsigned_int, @@ -233,6 +249,11 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::BufferObject) __GLBufferObject_P1__getOrCreateGLBufferObject__unsigned_int, "", ""); + I_Method0(unsigned int, computeRequiredBufferSize, + Properties::NON_VIRTUAL, + __unsigned_int__computeRequiredBufferSize, + "", + ""); I_ArrayProperty(osg::BufferData *, BufferData, __BufferData_P1__getBufferData__unsigned_int, __void__setBufferData__unsigned_int__BufferData_P1, @@ -240,6 +261,13 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::BufferObject) __unsigned_int__addBufferData__BufferData_P1, 0, __void__removeBufferData__unsigned_int); + I_IndexedProperty(osg::GLBufferObject *, GLBufferObject, + __GLBufferObject_P1__getGLBufferObject__unsigned_int, + __void__setGLBufferObject__unsigned_int__GLBufferObject_P1, + 0); + I_SimpleProperty(osg::BufferObjectProfile &, Profile, + __BufferObjectProfile_R1__getProfile, + 0); I_SimpleProperty(GLenum, Target, __GLenum__getTarget, __void__setTarget__GLenum); @@ -248,6 +276,30 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::BufferObject) __void__setUsage__GLenum); END_REFLECTOR +BEGIN_VALUE_REFLECTOR(osg::BufferObjectProfile) + I_DeclaringFile("osg/BufferObject"); + I_Constructor0(____BufferObjectProfile, + "", + ""); + I_Constructor3(IN, GLenum, target, IN, GLenum, usage, IN, unsigned int, size, + ____BufferObjectProfile__GLenum__GLenum__unsigned_int, + "", + ""); + I_Constructor1(IN, const osg::BufferObjectProfile &, bpo, + Properties::NON_EXPLICIT, + ____BufferObjectProfile__C5_BufferObjectProfile_R1, + "", + ""); + I_Method3(void, setProfile, IN, GLenum, target, IN, GLenum, usage, IN, unsigned int, size, + Properties::NON_VIRTUAL, + __void__setProfile__GLenum__GLenum__unsigned_int, + "", + ""); + I_PublicMemberProperty(GLenum, _target); + I_PublicMemberProperty(GLenum, _usage); + I_PublicMemberProperty(GLenum, _size); +END_REFLECTOR + BEGIN_OBJECT_REFLECTOR(osg::ElementBufferObject) I_DeclaringFile("osg/BufferObject"); I_BaseType(osg::BufferObject); @@ -321,6 +373,16 @@ BEGIN_OBJECT_REFLECTOR(osg::GLBufferObject) ____GLBufferObject__unsigned_int__BufferObject_P1, "", ""); + I_Method1(void, setProfile, IN, const osg::BufferObjectProfile &, profile, + Properties::NON_VIRTUAL, + __void__setProfile__C5_BufferObjectProfile_R1, + "", + ""); + I_Method0(const osg::BufferObjectProfile &, getProfile, + Properties::NON_VIRTUAL, + __C5_BufferObjectProfile_R1__getProfile, + "", + ""); I_Method1(void, setBufferObject, IN, osg::BufferObject *, bufferObject, Properties::NON_VIRTUAL, __void__setBufferObject__BufferObject_P1, @@ -404,14 +466,22 @@ BEGIN_OBJECT_REFLECTOR(osg::GLBufferObject) __void__deleteBufferObject__unsigned_int__GLuint_S, "Use deleteVertexBufferObject instead of glDeleteBuffers to allow OpenGL buffer objects to be cached until they can be deleted by the OpenGL context in which they were created, specified by contextID. ", ""); - I_StaticMethod3(void, flushDeletedBufferObjects, IN, unsigned int, contextID, IN, double, x, IN, double &, availableTime, - __void__flushDeletedBufferObjects__unsigned_int__double__double_R1_S, - "flush all the cached display list which need to be deleted in the OpenGL context related to contextID. ", + I_StaticMethod1(void, flushAllDeletedBufferObjects, IN, unsigned int, contextID, + __void__flushAllDeletedBufferObjects__unsigned_int_S, + "", + ""); + I_StaticMethod1(void, discardAllDeletedBufferObjects, IN, unsigned int, contextID, + __void__discardAllDeletedBufferObjects__unsigned_int_S, + "", + ""); + I_StaticMethod3(void, flushDeletedBufferObjects, IN, unsigned int, contextID, IN, double, currentTime, IN, double &, availbleTime, + __void__flushDeletedBufferObjects__unsigned_int__double__double_R1_S, + "", + ""); + I_StaticMethod2(void, releaseGLBufferObject, IN, unsigned int, contextID, IN, osg::GLBufferObject *, to, + __void__releaseGLBufferObject__unsigned_int__GLBufferObject_P1_S, + "", ""); - I_StaticMethod1(void, discardDeletedBufferObjects, IN, unsigned int, contextID, - __void__discardDeletedBufferObjects__unsigned_int_S, - "dicard all the cached display list which need to be deleted in the OpenGL context related to contextID. ", - "Note, unlike flush no OpenGL calls are made, instead the handles are all removed. this call is useful for when an OpenGL context has been destroyed. "); I_StaticMethod2(osg::GLBufferObject::Extensions *, getExtensions, IN, unsigned int, contextID, IN, bool, createIfNotInitalized, __Extensions_P1__getExtensions__unsigned_int__bool_S, "Function to call to get the extension of a specified context. ", @@ -429,6 +499,13 @@ BEGIN_OBJECT_REFLECTOR(osg::GLBufferObject) I_SimpleProperty(GLuint, GLObjectID, __GLuint__getGLObjectID, 0); + I_SimpleProperty(const osg::BufferObjectProfile &, Profile, + __C5_BufferObjectProfile_R1__getProfile, + __void__setProfile__C5_BufferObjectProfile_R1); + I_PublicMemberProperty(osg::GLBufferObjectSet *, _set); + I_PublicMemberProperty(osg::GLBufferObject *, _previous); + I_PublicMemberProperty(osg::GLBufferObject *, _next); + I_PublicMemberProperty(unsigned int, _frameLastUsed); I_PublicMemberProperty(osg::GLBufferObject::Extensions *, _extensions); END_REFLECTOR @@ -448,6 +525,301 @@ BEGIN_VALUE_REFLECTOR(osg::GLBufferObject::BufferEntry) I_PublicMemberProperty(osg::BufferData *, dataSource); END_REFLECTOR +BEGIN_OBJECT_REFLECTOR(osg::GLBufferObjectManager) + I_DeclaringFile("osg/BufferObject"); + I_BaseType(osg::Referenced); + I_Constructor1(IN, unsigned int, contextID, + Properties::NON_EXPLICIT, + ____GLBufferObjectManager__unsigned_int, + "", + ""); + I_Method0(unsigned int, getContextID, + Properties::NON_VIRTUAL, + __unsigned_int__getContextID, + "", + ""); + I_Method1(void, setNumberActiveGLBufferObjects, IN, unsigned int, size, + Properties::NON_VIRTUAL, + __void__setNumberActiveGLBufferObjects__unsigned_int, + "", + ""); + I_Method0(unsigned int &, getNumberActiveGLBufferObjects, + Properties::NON_VIRTUAL, + __unsigned_int_R1__getNumberActiveGLBufferObjects, + "", + ""); + I_Method0(unsigned int, getNumberActiveGLBufferObjects, + Properties::NON_VIRTUAL, + __unsigned_int__getNumberActiveGLBufferObjects, + "", + ""); + I_Method1(void, setNumberOrphanedGLBufferObjects, IN, unsigned int, size, + Properties::NON_VIRTUAL, + __void__setNumberOrphanedGLBufferObjects__unsigned_int, + "", + ""); + I_Method0(unsigned int &, getNumberOrphanedGLBufferObjects, + Properties::NON_VIRTUAL, + __unsigned_int_R1__getNumberOrphanedGLBufferObjects, + "", + ""); + I_Method0(unsigned int, getNumberOrphanedGLBufferObjects, + Properties::NON_VIRTUAL, + __unsigned_int__getNumberOrphanedGLBufferObjects, + "", + ""); + I_Method1(void, setCurrGLBufferObjectPoolSize, IN, unsigned int, size, + Properties::NON_VIRTUAL, + __void__setCurrGLBufferObjectPoolSize__unsigned_int, + "", + ""); + I_Method0(unsigned int &, getCurrGLBufferObjectPoolSize, + Properties::NON_VIRTUAL, + __unsigned_int_R1__getCurrGLBufferObjectPoolSize, + "", + ""); + I_Method0(unsigned int, getCurrGLBufferObjectPoolSize, + Properties::NON_VIRTUAL, + __unsigned_int__getCurrGLBufferObjectPoolSize, + "", + ""); + I_Method1(void, setMaxGLBufferObjectPoolSize, IN, unsigned int, size, + Properties::NON_VIRTUAL, + __void__setMaxGLBufferObjectPoolSize__unsigned_int, + "", + ""); + I_Method0(unsigned int, getMaxGLBufferObjectPoolSize, + Properties::NON_VIRTUAL, + __unsigned_int__getMaxGLBufferObjectPoolSize, + "", + ""); + I_Method1(bool, hasSpace, IN, unsigned int, size, + Properties::NON_VIRTUAL, + __bool__hasSpace__unsigned_int, + "", + ""); + I_Method1(bool, makeSpace, IN, unsigned int, size, + Properties::NON_VIRTUAL, + __bool__makeSpace__unsigned_int, + "", + ""); + I_Method1(osg::GLBufferObject *, generateGLBufferObject, IN, const osg::BufferObject *, bufferObject, + Properties::NON_VIRTUAL, + __GLBufferObject_P1__generateGLBufferObject__C5_osg_BufferObject_P1, + "", + ""); + I_Method0(void, handlePendingOrphandedGLBufferObjects, + Properties::NON_VIRTUAL, + __void__handlePendingOrphandedGLBufferObjects, + "", + ""); + I_Method0(void, flushAllDeletedGLBufferObjects, + Properties::NON_VIRTUAL, + __void__flushAllDeletedGLBufferObjects, + "", + ""); + I_Method0(void, discardAllDeletedGLBufferObjects, + Properties::NON_VIRTUAL, + __void__discardAllDeletedGLBufferObjects, + "", + ""); + I_Method2(void, flushDeletedGLBufferObjects, IN, double, currentTime, IN, double &, availableTime, + Properties::NON_VIRTUAL, + __void__flushDeletedGLBufferObjects__double__double_R1, + "", + ""); + I_Method1(void, releaseGLBufferObject, IN, osg::GLBufferObject *, to, + Properties::NON_VIRTUAL, + __void__releaseGLBufferObject__GLBufferObject_P1, + "", + ""); + I_Method1(osg::GLBufferObjectSet *, getGLBufferObjectSet, IN, const osg::BufferObjectProfile &, profile, + Properties::NON_VIRTUAL, + __GLBufferObjectSet_P1__getGLBufferObjectSet__C5_BufferObjectProfile_R1, + "", + ""); + I_Method1(void, newFrame, IN, osg::FrameStamp *, fs, + Properties::NON_VIRTUAL, + __void__newFrame__osg_FrameStamp_P1, + "", + ""); + I_Method0(void, resetStats, + Properties::NON_VIRTUAL, + __void__resetStats, + "", + ""); + I_Method0(void, reportStats, + Properties::NON_VIRTUAL, + __void__reportStats, + "", + ""); + I_Method0(unsigned int &, getFrameNumber, + Properties::NON_VIRTUAL, + __unsigned_int_R1__getFrameNumber, + "", + ""); + I_Method0(unsigned int &, getNumberFrames, + Properties::NON_VIRTUAL, + __unsigned_int_R1__getNumberFrames, + "", + ""); + I_Method0(unsigned int &, getNumberDeleted, + Properties::NON_VIRTUAL, + __unsigned_int_R1__getNumberDeleted, + "", + ""); + I_Method0(double &, getDeleteTime, + Properties::NON_VIRTUAL, + __double_R1__getDeleteTime, + "", + ""); + I_Method0(unsigned int &, getNumberGenerated, + Properties::NON_VIRTUAL, + __unsigned_int_R1__getNumberGenerated, + "", + ""); + I_Method0(double &, getGenerateTime, + Properties::NON_VIRTUAL, + __double_R1__getGenerateTime, + "", + ""); + I_Method0(unsigned int &, getNumberApplied, + Properties::NON_VIRTUAL, + __unsigned_int_R1__getNumberApplied, + "", + ""); + I_Method0(double &, getApplyTime, + Properties::NON_VIRTUAL, + __double_R1__getApplyTime, + "", + ""); + I_StaticMethod1(osg::ref_ptr< osg::GLBufferObjectManager > &, getGLBufferObjectManager, IN, unsigned int, contextID, + __osg_ref_ptrT1_GLBufferObjectManager__R1__getGLBufferObjectManager__unsigned_int_S, + "", + ""); + I_SimpleProperty(double &, ApplyTime, + __double_R1__getApplyTime, + 0); + I_SimpleProperty(unsigned int, ContextID, + __unsigned_int__getContextID, + 0); + I_SimpleProperty(unsigned int, CurrGLBufferObjectPoolSize, + __unsigned_int__getCurrGLBufferObjectPoolSize, + __void__setCurrGLBufferObjectPoolSize__unsigned_int); + I_SimpleProperty(double &, DeleteTime, + __double_R1__getDeleteTime, + 0); + I_SimpleProperty(unsigned int &, FrameNumber, + __unsigned_int_R1__getFrameNumber, + 0); + I_SimpleProperty(double &, GenerateTime, + __double_R1__getGenerateTime, + 0); + I_SimpleProperty(unsigned int, MaxGLBufferObjectPoolSize, + __unsigned_int__getMaxGLBufferObjectPoolSize, + __void__setMaxGLBufferObjectPoolSize__unsigned_int); + I_SimpleProperty(unsigned int, NumberActiveGLBufferObjects, + __unsigned_int__getNumberActiveGLBufferObjects, + __void__setNumberActiveGLBufferObjects__unsigned_int); + I_SimpleProperty(unsigned int &, NumberApplied, + __unsigned_int_R1__getNumberApplied, + 0); + I_SimpleProperty(unsigned int &, NumberDeleted, + __unsigned_int_R1__getNumberDeleted, + 0); + I_SimpleProperty(unsigned int &, NumberFrames, + __unsigned_int_R1__getNumberFrames, + 0); + I_SimpleProperty(unsigned int &, NumberGenerated, + __unsigned_int_R1__getNumberGenerated, + 0); + I_SimpleProperty(unsigned int, NumberOrphanedGLBufferObjects, + __unsigned_int__getNumberOrphanedGLBufferObjects, + __void__setNumberOrphanedGLBufferObjects__unsigned_int); +END_REFLECTOR + +BEGIN_OBJECT_REFLECTOR(osg::GLBufferObjectSet) + I_DeclaringFile("osg/BufferObject"); + I_BaseType(osg::Referenced); + I_Constructor2(IN, osg::GLBufferObjectManager *, parent, IN, const osg::BufferObjectProfile &, profile, + ____GLBufferObjectSet__GLBufferObjectManager_P1__C5_BufferObjectProfile_R1, + "", + ""); + I_Method0(void, handlePendingOrphandedGLBufferObjects, + Properties::NON_VIRTUAL, + __void__handlePendingOrphandedGLBufferObjects, + "", + ""); + I_Method0(void, flushAllDeletedGLBufferObjects, + Properties::NON_VIRTUAL, + __void__flushAllDeletedGLBufferObjects, + "", + ""); + I_Method0(void, discardAllDeletedGLBufferObjects, + Properties::NON_VIRTUAL, + __void__discardAllDeletedGLBufferObjects, + "", + ""); + I_Method2(void, flushDeletedGLBufferObjects, IN, double, currentTime, IN, double &, availableTime, + Properties::NON_VIRTUAL, + __void__flushDeletedGLBufferObjects__double__double_R1, + "", + ""); + I_Method1(osg::GLBufferObject *, takeFromOrphans, IN, osg::BufferObject *, bufferObject, + Properties::NON_VIRTUAL, + __GLBufferObject_P1__takeFromOrphans__BufferObject_P1, + "", + ""); + I_Method1(osg::GLBufferObject *, takeOrGenerate, IN, osg::BufferObject *, bufferObject, + Properties::NON_VIRTUAL, + __GLBufferObject_P1__takeOrGenerate__BufferObject_P1, + "", + ""); + I_Method1(void, moveToBack, IN, osg::GLBufferObject *, to, + Properties::NON_VIRTUAL, + __void__moveToBack__GLBufferObject_P1, + "", + ""); + I_Method1(void, addToBack, IN, osg::GLBufferObject *, to, + Properties::NON_VIRTUAL, + __void__addToBack__GLBufferObject_P1, + "", + ""); + I_Method1(void, orphan, IN, osg::GLBufferObject *, to, + Properties::NON_VIRTUAL, + __void__orphan__GLBufferObject_P1, + "", + ""); + I_Method1(void, remove, IN, osg::GLBufferObject *, to, + Properties::NON_VIRTUAL, + __void__remove__GLBufferObject_P1, + "", + ""); + I_Method0(unsigned int, size, + Properties::NON_VIRTUAL, + __unsigned_int__size, + "", + ""); + I_Method1(bool, makeSpace, IN, unsigned int &, size, + Properties::NON_VIRTUAL, + __bool__makeSpace__unsigned_int_R1, + "", + ""); + I_Method0(bool, checkConsistency, + Properties::NON_VIRTUAL, + __bool__checkConsistency, + "", + ""); + I_Method0(osg::GLBufferObjectManager *, getParent, + Properties::NON_VIRTUAL, + __GLBufferObjectManager_P1__getParent, + "", + ""); + I_SimpleProperty(osg::GLBufferObjectManager *, Parent, + __GLBufferObjectManager_P1__getParent, + 0); +END_REFLECTOR + BEGIN_OBJECT_REFLECTOR(osg::PixelBufferObject) I_DeclaringFile("osg/BufferObject"); I_BaseType(osg::BufferObject); @@ -663,3 +1035,87 @@ BEGIN_OBJECT_REFLECTOR(osg::VertexBufferObject) 0); END_REFLECTOR +TYPE_NAME_ALIAS(std::list< osg::ref_ptr< osg::GLBufferObject > >, osg::GLBufferObjectList) + +BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osg::GLBufferObject >) + I_DeclaringFile("osg/ref_ptr"); + I_Constructor0(____ref_ptr, + "", + ""); + I_Constructor1(IN, osg::GLBufferObject *, ptr, + Properties::NON_EXPLICIT, + ____ref_ptr__T_P1, + "", + ""); + I_Constructor1(IN, const osg::ref_ptr< osg::GLBufferObject > &, rp, + Properties::NON_EXPLICIT, + ____ref_ptr__C5_ref_ptr_R1, + "", + ""); + I_Method0(osg::GLBufferObject *, get, + Properties::NON_VIRTUAL, + __T_P1__get, + "", + ""); + I_Method0(bool, valid, + Properties::NON_VIRTUAL, + __bool__valid, + "", + ""); + I_Method0(osg::GLBufferObject *, release, + Properties::NON_VIRTUAL, + __T_P1__release, + "", + ""); + I_Method1(void, swap, IN, osg::ref_ptr< osg::GLBufferObject > &, rp, + Properties::NON_VIRTUAL, + __void__swap__ref_ptr_R1, + "", + ""); + I_SimpleProperty(osg::GLBufferObject *, , + __T_P1__get, + 0); +END_REFLECTOR + +BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osg::GLBufferObjectManager >) + I_DeclaringFile("osg/ref_ptr"); + I_Constructor0(____ref_ptr, + "", + ""); + I_Constructor1(IN, osg::GLBufferObjectManager *, ptr, + Properties::NON_EXPLICIT, + ____ref_ptr__T_P1, + "", + ""); + I_Constructor1(IN, const osg::ref_ptr< osg::GLBufferObjectManager > &, rp, + Properties::NON_EXPLICIT, + ____ref_ptr__C5_ref_ptr_R1, + "", + ""); + I_Method0(osg::GLBufferObjectManager *, get, + Properties::NON_VIRTUAL, + __T_P1__get, + "", + ""); + I_Method0(bool, valid, + Properties::NON_VIRTUAL, + __bool__valid, + "", + ""); + I_Method0(osg::GLBufferObjectManager *, release, + Properties::NON_VIRTUAL, + __T_P1__release, + "", + ""); + I_Method1(void, swap, IN, osg::ref_ptr< osg::GLBufferObjectManager > &, rp, + Properties::NON_VIRTUAL, + __void__swap__ref_ptr_R1, + "", + ""); + I_SimpleProperty(osg::GLBufferObjectManager *, , + __T_P1__get, + 0); +END_REFLECTOR + +STD_LIST_REFLECTOR(std::list< osg::ref_ptr< osg::GLBufferObject > >) + diff --git a/src/osgWrappers/osg/DisplaySettings.cpp b/src/osgWrappers/osg/DisplaySettings.cpp index c11b71080..ea9cb92a1 100644 --- a/src/osgWrappers/osg/DisplaySettings.cpp +++ b/src/osgWrappers/osg/DisplaySettings.cpp @@ -394,24 +394,14 @@ BEGIN_OBJECT_REFLECTOR(osg::DisplaySettings) __unsigned_int__getMaxTexturePoolSize, "", ""); - I_Method1(void, setMaxVBOPoolSize, IN, unsigned int, size, + I_Method1(void, setMaxBufferObjectPoolSize, IN, unsigned int, size, Properties::NON_VIRTUAL, - __void__setMaxVBOPoolSize__unsigned_int, + __void__setMaxBufferObjectPoolSize__unsigned_int, "", ""); - I_Method0(unsigned int, getMaxVBOPoolSize, + I_Method0(unsigned int, getMaxBufferObjectPoolSize, Properties::NON_VIRTUAL, - __unsigned_int__getMaxVBOPoolSize, - "", - ""); - I_Method1(void, setMaxFBOPoolSize, IN, unsigned int, size, - Properties::NON_VIRTUAL, - __void__setMaxFBOPoolSize__unsigned_int, - "", - ""); - I_Method0(unsigned int, getMaxFBOPoolSize, - Properties::NON_VIRTUAL, - __unsigned_int__getMaxFBOPoolSize, + __unsigned_int__getMaxBufferObjectPoolSize, "", ""); I_SimpleProperty(bool, AccumBuffer, @@ -441,18 +431,15 @@ BEGIN_OBJECT_REFLECTOR(osg::DisplaySettings) I_SimpleProperty(float, EyeSeparation, __float__getEyeSeparation, __void__setEyeSeparation__float); - I_SimpleProperty(unsigned int, MaxFBOPoolSize, - __unsigned_int__getMaxFBOPoolSize, - __void__setMaxFBOPoolSize__unsigned_int); + I_SimpleProperty(unsigned int, MaxBufferObjectPoolSize, + __unsigned_int__getMaxBufferObjectPoolSize, + __void__setMaxBufferObjectPoolSize__unsigned_int); I_SimpleProperty(unsigned int, MaxNumberOfGraphicsContexts, __unsigned_int__getMaxNumberOfGraphicsContexts, __void__setMaxNumberOfGraphicsContexts__unsigned_int); I_SimpleProperty(unsigned int, MaxTexturePoolSize, __unsigned_int__getMaxTexturePoolSize, __void__setMaxTexturePoolSize__unsigned_int); - I_SimpleProperty(unsigned int, MaxVBOPoolSize, - __unsigned_int__getMaxVBOPoolSize, - __void__setMaxVBOPoolSize__unsigned_int); I_SimpleProperty(unsigned int, MinimumNumAccumAlphaBits, __unsigned_int__getMinimumNumAccumAlphaBits, 0); diff --git a/src/osgWrappers/osg/State.cpp b/src/osgWrappers/osg/State.cpp index d5a05e259..71fc8b2f9 100644 --- a/src/osgWrappers/osg/State.cpp +++ b/src/osgWrappers/osg/State.cpp @@ -706,24 +706,14 @@ BEGIN_OBJECT_REFLECTOR(osg::State) __unsigned_int__getMaxTexturePoolSize, "", ""); - I_Method1(void, setMaxVBOPoolSize, IN, unsigned int, size, + I_Method1(void, setMaxBufferObjectPoolSize, IN, unsigned int, size, Properties::NON_VIRTUAL, - __void__setMaxVBOPoolSize__unsigned_int, + __void__setMaxBufferObjectPoolSize__unsigned_int, "", ""); - I_Method0(unsigned int, getMaxVBOPoolSize, + I_Method0(unsigned int, getMaxBufferObjectPoolSize, Properties::NON_VIRTUAL, - __unsigned_int__getMaxVBOPoolSize, - "", - ""); - I_Method1(void, setMaxFBOPoolSize, IN, unsigned int, size, - Properties::NON_VIRTUAL, - __void__setMaxFBOPoolSize__unsigned_int, - "", - ""); - I_Method0(unsigned int, getMaxFBOPoolSize, - Properties::NON_VIRTUAL, - __unsigned_int__getMaxFBOPoolSize, + __unsigned_int__getMaxBufferObjectPoolSize, "", ""); I_Method1(void, setCheckForGLErrors, IN, osg::State::CheckForGLErrors, check, @@ -880,15 +870,12 @@ BEGIN_OBJECT_REFLECTOR(osg::State) I_SimpleProperty(const osg::Program::PerContextProgram *, LastAppliedProgramObject, __C5_Program_PerContextProgram_P1__getLastAppliedProgramObject, __void__setLastAppliedProgramObject__C5_Program_PerContextProgram_P1); - I_SimpleProperty(unsigned int, MaxFBOPoolSize, - __unsigned_int__getMaxFBOPoolSize, - __void__setMaxFBOPoolSize__unsigned_int); + I_SimpleProperty(unsigned int, MaxBufferObjectPoolSize, + __unsigned_int__getMaxBufferObjectPoolSize, + __void__setMaxBufferObjectPoolSize__unsigned_int); I_SimpleProperty(unsigned int, MaxTexturePoolSize, __unsigned_int__getMaxTexturePoolSize, __void__setMaxTexturePoolSize__unsigned_int); - I_SimpleProperty(unsigned int, MaxVBOPoolSize, - __unsigned_int__getMaxVBOPoolSize, - __void__setMaxVBOPoolSize__unsigned_int); I_IndexedProperty(bool, ModeValidity, __bool__getModeValidity__StateAttribute_GLMode, __void__setModeValidity__StateAttribute_GLMode__bool,