mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 18:59:57 +00:00
Add CompositeMapRenderer info to the stats panel
This commit is contained in:
parent
ec0b743123
commit
e7a0878c10
7 changed files with 20 additions and 1 deletions
|
@ -922,6 +922,8 @@ namespace MWRender
|
||||||
if (stats->collectStats("resource"))
|
if (stats->collectStats("resource"))
|
||||||
{
|
{
|
||||||
stats->setAttribute(frameNumber, "UnrefQueue", mUnrefQueue->getNumItems());
|
stats->setAttribute(frameNumber, "UnrefQueue", mUnrefQueue->getNumItems());
|
||||||
|
|
||||||
|
mTerrain->reportStats(frameNumber, stats);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -259,7 +259,7 @@ void StatsHandler::setUpScene(osgViewer::ViewerBase *viewer)
|
||||||
_resourceStatsChildNum = _switch->getNumChildren();
|
_resourceStatsChildNum = _switch->getNumChildren();
|
||||||
_switch->addChild(group, false);
|
_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]);
|
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()
|
CompositeMap::CompositeMap()
|
||||||
: mCompiled(0)
|
: mCompiled(0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,6 +48,8 @@ namespace Terrain
|
||||||
/// Mark this composite map to be required for the current frame
|
/// Mark this composite map to be required for the current frame
|
||||||
void setImmediate(CompositeMap* map);
|
void setImmediate(CompositeMap* map);
|
||||||
|
|
||||||
|
unsigned int getCompileSetSize() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double mTimeAvailable;
|
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 removeView(View* view);
|
||||||
void preload(View* view, const osg::Vec3f& eyePoint);
|
void preload(View* view, const osg::Vec3f& eyePoint);
|
||||||
|
|
||||||
|
void reportStats(unsigned int frameNumber, osg::Stats* stats);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ensureQuadTreeBuilt();
|
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.
|
/// @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 preload(View* view, const osg::Vec3f& eyePoint) {}
|
||||||
|
|
||||||
|
virtual void reportStats(unsigned int frameNumber, osg::Stats* stats) {}
|
||||||
|
|
||||||
Storage* getStorage() { return mStorage; }
|
Storage* getStorage() { return mStorage; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in a new issue