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:
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user