From 4100c67da6122d7f4416a687d5b4b5c39cf3901b Mon Sep 17 00:00:00 2001 From: elsid Date: Mon, 12 Jan 2026 22:59:10 +0100 Subject: [PATCH 1/5] Report stats by context data managers --- include/osg/BufferObject | 2 ++ include/osg/ContextData | 9 +++++++++ include/osg/GLObjects | 7 ++++++- include/osg/Texture | 2 ++ src/osg/BufferObject.cpp | 6 ++++++ src/osg/ContextData.cpp | 14 +++++++++++++- src/osg/Drawable.cpp | 12 +++++++++++- src/osg/GLObjects.cpp | 10 ++++++++++ src/osg/Texture.cpp | 5 +++++ src/osg/VertexArrayState.cpp | 13 ++++++++++++- 10 files changed, 76 insertions(+), 4 deletions(-) diff --git a/include/osg/BufferObject b/include/osg/BufferObject index 3ec365544fb..22f05e8bdac 100644 --- a/include/osg/BufferObject +++ b/include/osg/BufferObject @@ -368,6 +368,8 @@ class OSG_EXPORT GLBufferObjectManager : public GraphicsObjectManager void reportStats(std::ostream& out); void recomputeStats(std::ostream& out) const; + void reportStats(unsigned frameNumber, Stats& stats) const override; + unsigned int& getFrameNumber() { return _frameNumber; } unsigned int& getNumberFrames() { return _numFrames; } diff --git a/include/osg/ContextData b/include/osg/ContextData index fec208a7d1f..4bf22d81e6d 100644 --- a/include/osg/ContextData +++ b/include/osg/ContextData @@ -14,10 +14,15 @@ #ifndef OSG_CONTEXTDATA #define OSG_CONTEXTDATA 1 +#include #include namespace osg { +class ContextData; + +typedef std::map > ContextDataMap; + class OSG_EXPORT ContextData : public GraphicsObjectManager { public: @@ -73,6 +78,8 @@ class OSG_EXPORT ContextData : public GraphicsObjectManager virtual void reportStats(std::ostream& out); virtual void recomputeStats(std::ostream& out) const; + void reportStats(unsigned frameNumber, Stats& stats) const override; + /** Flush all deleted OpenGL objects within the specified availableTime. * Note, must be called from a thread which has current the graphics context associated with contextID. */ virtual void flushDeletedGLObjects(double currentTime, double& availableTime); @@ -130,6 +137,8 @@ class OSG_EXPORT ContextData : public GraphicsObjectManager /** Unregister a GraphicsContext.*/ static void unregisterGraphicsContext(GraphicsContext* gc); + static ContextDataMap getContextDataMap(); + protected: virtual ~ContextData(); diff --git a/include/osg/GLObjects b/include/osg/GLObjects index 84b5ec30853..f8ca8d15710 100644 --- a/include/osg/GLObjects +++ b/include/osg/GLObjects @@ -23,6 +23,7 @@ namespace osg { // forward declare class FrameStamp; +class Stats; /** Flush all deleted OpenGL objects within the specified availableTime. * Note, must be called from a thread which has current the graphics context associated with contextID. */ @@ -67,6 +68,8 @@ class OSG_EXPORT GraphicsObjectManager : public osg::Referenced virtual void reportStats(std::ostream& /*out*/) {} virtual void recomputeStats(std::ostream& /*out*/) const {} + virtual void reportStats(unsigned frameNumber, Stats& stats) const {} + /** Flush all deleted OpenGL objects within the specified availableTime. * Note, must be called from a thread which has current the graphics context associated with contextID. */ @@ -117,11 +120,13 @@ public: /** implementation of the actual deletion of an GL object - subclasses from GLObjectManager must implement the appropriate GL calls.*/ virtual void deleteGLObject(GLuint globj) = 0; + void reportStats(unsigned frameNumber, Stats& stats) const override; + protected: virtual ~GLObjectManager(); typedef std::list GLObjectHandleList; - OpenThreads::Mutex _mutex; + mutable OpenThreads::Mutex _mutex; GLObjectHandleList _deleteGLObjectHandles; }; diff --git a/include/osg/Texture b/include/osg/Texture index f6614633acd..11d2a0d6a0d 100644 --- a/include/osg/Texture +++ b/include/osg/Texture @@ -1232,6 +1232,8 @@ public: void recomputeStats(std::ostream& out) const; bool checkConsistency() const; + void reportStats(unsigned frameNumber, Stats& stats) const override; + unsigned int& getFrameNumber() { return _frameNumber; } unsigned int& getNumberFrames() { return _numFrames; } diff --git a/src/osg/BufferObject.cpp b/src/osg/BufferObject.cpp index b94d9805934..1a1c60b936f 100644 --- a/src/osg/BufferObject.cpp +++ b/src/osg/BufferObject.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -1051,6 +1052,11 @@ void GLBufferObjectManager::recomputeStats(std::ostream& out) const out<<" getMaxGLBufferObjectPoolSize()="<(_glBufferObjectSetMap.size())); +} + ////////////////////////////////////////////////////////////////////////////////////////////////////// // // BufferObject diff --git a/src/osg/ContextData.cpp b/src/osg/ContextData.cpp index bdbc4aaf6f8..34843b9bc7c 100644 --- a/src/osg/ContextData.cpp +++ b/src/osg/ContextData.cpp @@ -19,7 +19,7 @@ using namespace osg; -typedef std::map > ContextIDMap; +typedef ContextDataMap ContextIDMap; static ContextIDMap s_contextIDMap; static OpenThreads::ReentrantMutex s_contextIDMapMutex; static ContextData::GraphicsContexts s_registeredContexts; @@ -79,6 +79,12 @@ void ContextData::recomputeStats(std::ostream& out) const } } +void ContextData::reportStats(unsigned frameNumber, Stats& stats) const +{ + for (ManagerMap::const_iterator it = _managerMap.begin(); it != _managerMap.end(); ++it) + if (osg::GraphicsObjectManager* const v = dynamic_cast(it->second.get())) + v->reportStats(frameNumber, stats); +} void ContextData::flushDeletedGLObjects(double currentTime, double& availableTime) { @@ -334,3 +340,9 @@ GraphicsContext* ContextData::getCompileContext(unsigned int contextID) if (itr != s_contextIDMap.end()) return itr->second->getCompileContext(); else return 0; } + +ContextDataMap ContextData::getContextDataMap() +{ + OpenThreads::ScopedLock lock(s_contextIDMapMutex); + return s_contextIDMap; +} diff --git a/src/osg/Drawable.cpp b/src/osg/Drawable.cpp index 348deaf0e7b..7c87af859c8 100644 --- a/src/osg/Drawable.cpp +++ b/src/osg/Drawable.cpp @@ -188,6 +188,16 @@ class DisplayListManager : public GraphicsObjectManager #endif } + void reportStats(unsigned frameNumber, Stats& stats) const override + { + const std::size_t size = [&](){ + const OpenThreads::ScopedLock lock(_mutex_deletedDisplayListCache); + return _displayListMap.size(); + }(); + + stats.setAttribute(frameNumber, "DisplayListManager" + std::to_string(_contextID), static_cast(size)); + } + protected: int _numberDrawablesReusedLastInLastFrame; @@ -195,7 +205,7 @@ class DisplayListManager : public GraphicsObjectManager int _numberDeletedDrawablesInLastFrame; typedef std::multimap DisplayListMap; - OpenThreads::Mutex _mutex_deletedDisplayListCache; + mutable OpenThreads::Mutex _mutex_deletedDisplayListCache; DisplayListMap _displayListMap; }; diff --git a/src/osg/GLObjects.cpp b/src/osg/GLObjects.cpp index 0e2ca14013a..a85876ac86e 100644 --- a/src/osg/GLObjects.cpp +++ b/src/osg/GLObjects.cpp @@ -146,3 +146,13 @@ GLuint GLObjectManager::createGLObject() OSG_INFO<<"void "<<_name<<"::createGLObject() : Not Implemented"< lock(_mutex); + return _deleteGLObjectHandles.size(); + }(); + + stats.setAttribute(frameNumber, _name + std::to_string(_contextID), static_cast(size)); +} diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index 189d941ef81..099ccca3f41 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -1289,6 +1289,11 @@ bool TextureObjectManager::checkConsistency() const return true; } +void TextureObjectManager::reportStats(unsigned frameNumber, Stats& stats) const +{ + stats.setAttribute(frameNumber, "TextureObjectManager" + std::to_string(_contextID), static_cast(_textureSetMap.size())); +} + osg::ref_ptr Texture::generateTextureObject(const Texture* texture, unsigned int contextID, GLenum target) { return osg::get(contextID)->generateTextureObject(texture, target); diff --git a/src/osg/VertexArrayState.cpp b/src/osg/VertexArrayState.cpp index 16298b720a9..e8f67c3a6b7 100644 --- a/src/osg/VertexArrayState.cpp +++ b/src/osg/VertexArrayState.cpp @@ -14,6 +14,7 @@ #include #include #include +#include using namespace osg; @@ -102,10 +103,20 @@ class VertexArrayStateManager : public GraphicsObjectManager _vertexArrayStateList.push_back(vas); } + void reportStats(unsigned frameNumber, Stats& stats) const override + { + const std::size_t size = [&](){ + const OpenThreads::ScopedLock lock(_mutex_vertexArrayStateList); + return _vertexArrayStateList.size(); + }(); + + stats.setAttribute(frameNumber, "VertexArrayStateManager" + std::to_string(_contextID), static_cast(size)); + } + protected: typedef std::list< osg::ref_ptr > VertexArrayStateList; - OpenThreads::Mutex _mutex_vertexArrayStateList; + mutable OpenThreads::Mutex _mutex_vertexArrayStateList; VertexArrayStateList _vertexArrayStateList; }; From 4292cccdab4ee56f50db6512f36380cf0820584a Mon Sep 17 00:00:00 2001 From: elsid Date: Sun, 11 Jan 2026 01:40:46 +0100 Subject: [PATCH 2/5] Erase empty object sets To avoid endless accumulation over time. --- src/osg/BufferObject.cpp | 30 ++++++++++++++++++++++-------- src/osg/Texture.cpp | 28 ++++++++++++++++++++-------- 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/src/osg/BufferObject.cpp b/src/osg/BufferObject.cpp index 1a1c60b936f..a804bb644ed 100644 --- a/src/osg/BufferObject.cpp +++ b/src/osg/BufferObject.cpp @@ -38,6 +38,19 @@ using namespace osg; +namespace +{ + +template +Iterator eraseIfEmpty(Iterator it, Map& map) +{ + if (it->second->getNumOfGLBufferObjects() == 0) + return map.erase(it); + return ++it; +} + +} + ////////////////////////////////////////////////////////////////////////////////////////////////////// // // GLBufferObject::BufferEntry @@ -937,10 +950,10 @@ void GLBufferObjectManager::deleteAllGLObjects() ElapsedTime elapsedTime(&(getDeleteTime())); for(GLBufferObjectSetMap::iterator itr = _glBufferObjectSetMap.begin(); - itr != _glBufferObjectSetMap.end(); - ++itr) + itr != _glBufferObjectSetMap.end();) { (*itr).second->deleteAllGLBufferObjects(); + itr = eraseIfEmpty(itr, _glBufferObjectSetMap); } } @@ -952,6 +965,7 @@ void GLBufferObjectManager::discardAllGLObjects() { (*itr).second->discardAllGLBufferObjects(); } + _glBufferObjectSetMap.clear(); } void GLBufferObjectManager::flushAllDeletedGLObjects() @@ -959,20 +973,20 @@ void GLBufferObjectManager::flushAllDeletedGLObjects() ElapsedTime elapsedTime(&(getDeleteTime())); for(GLBufferObjectSetMap::iterator itr = _glBufferObjectSetMap.begin(); - itr != _glBufferObjectSetMap.end(); - ++itr) + itr != _glBufferObjectSetMap.end();) { (*itr).second->flushAllDeletedGLBufferObjects(); + itr = eraseIfEmpty(itr, _glBufferObjectSetMap); } } void GLBufferObjectManager::discardAllDeletedGLObjects() { for(GLBufferObjectSetMap::iterator itr = _glBufferObjectSetMap.begin(); - itr != _glBufferObjectSetMap.end(); - ++itr) + itr != _glBufferObjectSetMap.end();) { (*itr).second->discardAllDeletedGLBufferObjects(); + itr = eraseIfEmpty(itr, _glBufferObjectSetMap); } } @@ -981,10 +995,10 @@ void GLBufferObjectManager::flushDeletedGLObjects(double currentTime, double& av ElapsedTime elapsedTime(&(getDeleteTime())); for(GLBufferObjectSetMap::iterator itr = _glBufferObjectSetMap.begin(); - (itr != _glBufferObjectSetMap.end()) && (availableTime > 0.0); - ++itr) + (itr != _glBufferObjectSetMap.end()) && (availableTime > 0.0);) { (*itr).second->flushDeletedGLBufferObjects(currentTime, availableTime); + itr = eraseIfEmpty(itr, _glBufferObjectSetMap); } } diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index 099ccca3f41..703080515ad 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -60,6 +60,17 @@ #define CHECK_CONSISTENCY #endif +namespace { + template + Iterator eraseIfEmpty(Iterator it, Map& map) + { + if (it->second->getNumOfTextureObjects() == 0) + return map.erase(it); + return ++it; + } +} + + namespace osg { ApplicationUsageProxy Texture_e0(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_MAX_TEXTURE_SIZE","Set the maximum size of textures."); @@ -1153,10 +1164,10 @@ void TextureObjectManager::handlePendingOrphandedTextureObjects() void TextureObjectManager::deleteAllGLObjects() { for(TextureSetMap::iterator itr = _textureSetMap.begin(); - itr != _textureSetMap.end(); - ++itr) + itr != _textureSetMap.end();) { (*itr).second->deleteAllTextureObjects(); + itr = eraseIfEmpty(itr, _textureSetMap); } } @@ -1168,35 +1179,36 @@ void TextureObjectManager::discardAllGLObjects() { (*itr).second->discardAllTextureObjects(); } + _textureSetMap.clear(); } void TextureObjectManager::flushAllDeletedGLObjects() { for(TextureSetMap::iterator itr = _textureSetMap.begin(); - itr != _textureSetMap.end(); - ++itr) + itr != _textureSetMap.end();) { (*itr).second->flushAllDeletedTextureObjects(); + itr = eraseIfEmpty(itr, _textureSetMap); } } void TextureObjectManager::discardAllDeletedGLObjects() { for(TextureSetMap::iterator itr = _textureSetMap.begin(); - itr != _textureSetMap.end(); - ++itr) + itr != _textureSetMap.end();) { (*itr).second->discardAllDeletedTextureObjects(); + itr = eraseIfEmpty(itr, _textureSetMap); } } void TextureObjectManager::flushDeletedGLObjects(double currentTime, double& availableTime) { for(TextureSetMap::iterator itr = _textureSetMap.begin(); - (itr != _textureSetMap.end()) && (availableTime > 0.0); - ++itr) + (itr != _textureSetMap.end()) && (availableTime > 0.0);) { (*itr).second->flushDeletedTextureObjects(currentTime, availableTime); + itr = eraseIfEmpty(itr, _textureSetMap); } } From fde349aeffcb9fcbff1c739439565719b60bf315 Mon Sep 17 00:00:00 2001 From: elsid Date: Mon, 12 Jan 2026 21:45:15 +0100 Subject: [PATCH 3/5] Use std::vector for pending orphaned objects List has allocation overhead on adding every element. But there is no reason to use it. --- include/osg/BufferObject | 3 ++- include/osg/Texture | 3 ++- src/osg/BufferObject.cpp | 2 +- src/osg/Texture.cpp | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/osg/BufferObject b/include/osg/BufferObject index 22f05e8bdac..716b245a515 100644 --- a/include/osg/BufferObject +++ b/include/osg/BufferObject @@ -272,6 +272,7 @@ class OSG_EXPORT GLBufferObject : public GraphicsObject }; typedef std::list< ref_ptr > GLBufferObjectList; +typedef std::vector> GLBufferObjectVector; class OSG_EXPORT GLBufferObjectSet : public Referenced { @@ -322,7 +323,7 @@ class OSG_EXPORT GLBufferObjectSet : public Referenced BufferObjectProfile _profile; unsigned int _numOfGLBufferObjects; GLBufferObjectList _orphanedGLBufferObjects; - GLBufferObjectList _pendingOrphanedGLBufferObjects; + GLBufferObjectVector _pendingOrphanedGLBufferObjects; GLBufferObject* _head; GLBufferObject* _tail; diff --git a/include/osg/Texture b/include/osg/Texture index 11d2a0d6a0d..c3a9e7c0670 100644 --- a/include/osg/Texture +++ b/include/osg/Texture @@ -1166,6 +1166,7 @@ public: unsigned int getNumPendingOrphans() const { return static_cast(_pendingOrphanedTextureObjects.size()); } protected: + typedef std::vector> TextureObjectVector; virtual ~TextureObjectSet(); @@ -1176,7 +1177,7 @@ protected: Texture::TextureProfile _profile; unsigned int _numOfTextureObjects; Texture::TextureObjectList _orphanedTextureObjects; - Texture::TextureObjectList _pendingOrphanedTextureObjects; + TextureObjectVector _pendingOrphanedTextureObjects; Texture::TextureObject* _head; Texture::TextureObject* _tail; diff --git a/src/osg/BufferObject.cpp b/src/osg/BufferObject.cpp index a804bb644ed..50b94850ad8 100644 --- a/src/osg/BufferObject.cpp +++ b/src/osg/BufferObject.cpp @@ -365,7 +365,7 @@ void GLBufferObjectSet::handlePendingOrphandedGLBufferObjects() unsigned int numOrphaned = _pendingOrphanedGLBufferObjects.size(); - for(GLBufferObjectList::iterator itr = _pendingOrphanedGLBufferObjects.begin(); + for(GLBufferObjectVector::iterator itr = _pendingOrphanedGLBufferObjects.begin(); itr != _pendingOrphanedGLBufferObjects.end(); ++itr) { diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index 703080515ad..566cf11e1a1 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -530,7 +530,7 @@ void TextureObjectSet::handlePendingOrphandedTextureObjects() unsigned int numOrphaned = _pendingOrphanedTextureObjects.size(); - for(Texture::TextureObjectList::iterator itr = _pendingOrphanedTextureObjects.begin(); + for(TextureObjectVector::iterator itr = _pendingOrphanedTextureObjects.begin(); itr != _pendingOrphanedTextureObjects.end(); ++itr) { From 8890897631e2cfc523e091378790b058f3d63359 Mon Sep 17 00:00:00 2001 From: elsid Date: Mon, 12 Jan 2026 21:48:07 +0100 Subject: [PATCH 4/5] Avoid redundant emptiness check handlePendingOrphandedGLBufferObjects and handlePendingOrphandedTextureObjects do it. --- src/osg/BufferObject.cpp | 35 ++++++++++------------------------- src/osg/Texture.cpp | 35 ++++++++++------------------------- 2 files changed, 20 insertions(+), 50 deletions(-) diff --git a/src/osg/BufferObject.cpp b/src/osg/BufferObject.cpp index 50b94850ad8..bcae338f7cb 100644 --- a/src/osg/BufferObject.cpp +++ b/src/osg/BufferObject.cpp @@ -392,11 +392,8 @@ void GLBufferObjectSet::deleteAllGLBufferObjects() { OpenThreads::ScopedLock lock(_mutex); - if (!_pendingOrphanedGLBufferObjects.empty()) - { - // OSG_NOTICE<<"GLBufferObjectSet::flushDeletedGLBufferObjects(..) handling orphans"< lock(_mutex); - if (!_pendingOrphanedGLBufferObjects.empty()) - { - // OSG_NOTICE<<"GLBufferObjectSet::flushDeletedGLBufferObjects(..) handling orphans"< lock(_mutex); - if (!_pendingOrphanedGLBufferObjects.empty()) - { - // OSG_NOTICE<<"GLBufferObjectSet::flushDeletedGLBufferObjects(..) handling orphans"< lock(_mutex); - if (!_pendingOrphanedGLBufferObjects.empty()) - { - // OSG_NOTICE<<"GLBufferObjectSet::flushDeletedGLBufferObjects(..) handling orphans"<getCurrGLBufferObjectPoolSize()<=_parent->getMaxGLBufferObjectPoolSize()) @@ -588,11 +576,8 @@ bool GLBufferObjectSet::makeSpace(unsigned int& size) { { OpenThreads::ScopedLock lock(_mutex); - if (!_pendingOrphanedGLBufferObjects.empty()) - { - // OSG_NOTICE<<"GLBufferSet::::makeSpace(..) handling orphans"< lock(_mutex); - if (!_pendingOrphanedTextureObjects.empty()) - { - // OSG_NOTICE<<"TextureObjectSet::flushDeletedTextureObjects(..) handling orphans"< lock(_mutex); - if (!_pendingOrphanedTextureObjects.empty()) - { - // OSG_NOTICE<<"TextureObjectSet::flushDeletedTextureObjects(..) handling orphans"< lock(_mutex); - if (!_pendingOrphanedTextureObjects.empty()) - { - // OSG_NOTICE<<"TextureObjectSet::flushDeletedTextureObjects(..) handling orphans"< lock(_mutex); - if (!_pendingOrphanedTextureObjects.empty()) - { - // OSG_NOTICE<<"TextureObjectSet::flushDeletedTextureObjects(..) handling orphans"<getCurrTexturePoolSize()<=_parent->getMaxTexturePoolSize()) @@ -770,11 +758,8 @@ bool TextureObjectSet::makeSpace(unsigned int& size) { { OpenThreads::ScopedLock lock(_mutex); - if (!_pendingOrphanedTextureObjects.empty()) - { - // OSG_NOTICE<<"TextureObjectSet::TextureObjectSet::makeSpace(..) handling orphans"< Date: Mon, 12 Jan 2026 21:53:09 +0100 Subject: [PATCH 5/5] Use atomic to store pending orphaned objects size To avoid locking a mutex when the container is empty. --- include/osg/BufferObject | 1 + include/osg/Texture | 1 + src/osg/BufferObject.cpp | 6 ++++++ src/osg/Texture.cpp | 8 ++++++++ 4 files changed, 16 insertions(+) diff --git a/include/osg/BufferObject b/include/osg/BufferObject index 716b245a515..d0488d51464 100644 --- a/include/osg/BufferObject +++ b/include/osg/BufferObject @@ -323,6 +323,7 @@ class OSG_EXPORT GLBufferObjectSet : public Referenced BufferObjectProfile _profile; unsigned int _numOfGLBufferObjects; GLBufferObjectList _orphanedGLBufferObjects; + OpenThreads::Atomic _pendingOrphanedGLBufferObjectsSize; GLBufferObjectVector _pendingOrphanedGLBufferObjects; GLBufferObject* _head; diff --git a/include/osg/Texture b/include/osg/Texture index c3a9e7c0670..166584ee860 100644 --- a/include/osg/Texture +++ b/include/osg/Texture @@ -1177,6 +1177,7 @@ protected: Texture::TextureProfile _profile; unsigned int _numOfTextureObjects; Texture::TextureObjectList _orphanedTextureObjects; + OpenThreads::Atomic _pendingOrphanedTextureObjectsSize; TextureObjectVector _pendingOrphanedTextureObjects; Texture::TextureObject* _head; diff --git a/src/osg/BufferObject.cpp b/src/osg/BufferObject.cpp index bcae338f7cb..d731959fa13 100644 --- a/src/osg/BufferObject.cpp +++ b/src/osg/BufferObject.cpp @@ -382,6 +382,7 @@ void GLBufferObjectSet::handlePendingOrphandedGLBufferObjects() _parent->getNumberActiveGLBufferObjects() -= numOrphaned; _pendingOrphanedGLBufferObjects.clear(); + _pendingOrphanedGLBufferObjectsSize.exchange(0); CHECK_CONSISTENCY } @@ -390,6 +391,7 @@ void GLBufferObjectSet::deleteAllGLBufferObjects() { // OSG_NOTICE<<"GLBufferObjectSet::deleteAllGLBufferObjects()"< lock(_mutex); // OSG_NOTICE<<"GLBufferObjectSet::flushDeletedGLBufferObjects(..) handling orphans"< lock(_mutex); // OSG_NOTICE<<"GLBufferObjectSet::flushDeletedGLBufferObjects(..) handling orphans"< lock(_mutex); // OSG_NOTICE<<"GLBufferObjectSet::flushDeletedGLBufferObjects(..) handling orphans"< lock(_mutex); // OSG_NOTICE<<"GLBufferObjectSet::flushDeletedGLBufferObjects(..) handling orphans"<getNumberActiveTextureObjects() -= numOrphaned; _pendingOrphanedTextureObjects.clear(); + _pendingOrphanedTextureObjectsSize.exchange(0); CHECK_CONSISTENCY } @@ -556,6 +557,7 @@ void TextureObjectSet::deleteAllTextureObjects() { // OSG_NOTICE<<"TextureObjectSet::deleteAllTextureObjects()"< lock(_mutex); // OSG_NOTICE<<"TextureObjectSet::flushDeletedTextureObjects(..) handling orphans"< lock(_mutex); // OSG_NOTICE<<"TextureObjectSet::flushDeletedTextureObjects(..) handling orphans"< lock(_mutex); // OSG_NOTICE<<"TextureObjectSet::flushDeletedTextureObjects(..) handling orphans"< lock(_mutex); // OSG_NOTICE<<"TextureObjectSet::flushDeletedTextureObjects(..) handling orphans"< lock(_mutex); // OSG_NOTICE<<"TextureObjectSet::TextureObjectSet::makeSpace(..) handling orphans"<