1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-29 03:19:44 +00:00

Report loading screens to osg stats

This commit is contained in:
elsid 2024-04-25 08:18:13 +02:00
parent 739ff70a82
commit a920ca9070
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625
2 changed files with 7 additions and 2 deletions

View File

@ -343,7 +343,12 @@ namespace MWGui
MWBase::Environment::get().getInputManager()->update(0, true, true);
mResourceSystem->reportStats(mViewer->getFrameStamp()->getFrameNumber(), mViewer->getViewerStats());
osg::Stats* const stats = mViewer->getViewerStats();
const unsigned frameNumber = mViewer->getFrameStamp()->getFrameNumber();
stats->setAttribute(frameNumber, "Loading", 1);
mResourceSystem->reportStats(frameNumber, stats);
if (osgUtil::IncrementalCompileOperation* ico = mViewer->getIncrementalCompileOperation())
{
ico->setMinimumTimeAvailableForGLCompileAndDeletePerFrame(1.f / getTargetFrameRate());

View File

@ -54,6 +54,7 @@ namespace Resource
constexpr std::string_view firstPage[] = {
"FrameNumber",
"",
"Loading",
"Compiling",
"WorkQueue",
"WorkThread",
@ -75,7 +76,6 @@ namespace Resource
"",
"",
"",
"",
};
static_assert(std::size(firstPage) == itemsPerPage);