Added stats collection to new Texture Pool code, and improved TexturePool implementation.

The Texture Pool can be enabled by setting the env var OSG_TEXTURE_POOL_SIZE=size_in_bytes.
Note, setting a size of 1 will result in the TexturePool allocating the minimum number of
textures it can without having to reuse TextureObjects from within the same frame.
This commit is contained in:
Robert Osfield
2009-09-25 18:05:54 +00:00
parent 6bc9c626f4
commit 4d75729650
5 changed files with 307 additions and 54 deletions

View File

@@ -1022,6 +1022,9 @@ void SceneView::draw()
osg::State* state = _renderInfo.getState();
state->initializeExtensionProcs();
osg::Texture::TextureObjectManager* tom = osg::Texture::getTextureObjectManager(state->getContextID());
tom->newFrame(state->getFrameStamp());
if (!_initCalled) init();
// note, to support multi-pipe systems the deletion of OpenGL display list
@@ -1560,6 +1563,10 @@ void SceneView::draw()
}
}
#ifdef REPORT_TEXTURE_MANAGER_STATS
tom->reportStats();
#endif
// osg::notify(osg::NOTICE)<<"SceneView draw() DynamicObjectCount"<<getState()->getDynamicObjectCount()<<std::endl;
}