Add CompositeMapRenderer info to the stats panel

pull/185/head
scrawl 8 years ago
parent ec0b743123
commit e7a0878c10

@ -922,6 +922,8 @@ namespace MWRender
if (stats->collectStats("resource"))
{
stats->setAttribute(frameNumber, "UnrefQueue", mUnrefQueue->getNumItems());
mTerrain->reportStats(frameNumber, stats);
}
}

@ -259,7 +259,7 @@ void StatsHandler::setUpScene(osgViewer::ViewerBase *viewer)
_resourceStatsChildNum = _switch->getNumChildren();
_switch->addChild(group, false);
const char* statNames[] = {"Compiling", "WorkQueue", "WorkThread", "", "Texture", "StateSet", "Node", "Node Instance", "Shape", "Shape Instance", "Image", "Nif", "Keyframe", "Terrain Chunk", "Terrain Texture", "Land", "", "UnrefQueue"};
const char* statNames[] = {"Compiling", "WorkQueue", "WorkThread", "", "Texture", "StateSet", "Node", "Node Instance", "Shape", "Shape Instance", "Image", "Nif", "Keyframe", "", "Terrain Chunk", "Terrain Texture", "Land", "Composite", "", "UnrefQueue"};
int numLines = sizeof(statNames) / sizeof(statNames[0]);

@ -142,6 +142,12 @@ void CompositeMapRenderer::setImmediate(CompositeMap* compositeMap)
}
}
unsigned int CompositeMapRenderer::getCompileSetSize() const
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(mMutex);
return mCompileSet.size();
}
CompositeMap::CompositeMap()
: mCompiled(0)
{

@ -48,6 +48,8 @@ namespace Terrain
/// Mark this composite map to be required for the current frame
void setImmediate(CompositeMap* map);
unsigned int getCompileSetSize() const;
private:
double mTimeAvailable;

@ -398,5 +398,10 @@ void QuadTreeWorld::preload(View *view, const osg::Vec3f &eyePoint)
}
}
void QuadTreeWorld::reportStats(unsigned int frameNumber, osg::Stats *stats)
{
stats->setAttribute(frameNumber, "Composite", mCompositeMapRenderer->getCompileSetSize());
}
}

@ -32,6 +32,8 @@ namespace Terrain
void removeView(View* view);
void preload(View* view, const osg::Vec3f& eyePoint);
void reportStats(unsigned int frameNumber, osg::Stats* stats);
private:
void ensureQuadTreeBuilt();

@ -90,6 +90,8 @@ namespace Terrain
/// @note Thread safe, as long as you do not attempt to load into the same view from multiple threads.
virtual void preload(View* view, const osg::Vec3f& eyePoint) {}
virtual void reportStats(unsigned int frameNumber, osg::Stats* stats) {}
Storage* getStorage() { return mStorage; }
protected:

Loading…
Cancel
Save