mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 17:15:34 +00:00
Merge branch 'fix_gpu_osg_stats' into 'master'
Delay OSG stats reporting for 3 frames See merge request OpenMW/openmw!2677
This commit is contained in:
commit
9c92a8ab57
1 changed files with 5 additions and 3 deletions
|
@ -939,14 +939,16 @@ void OMW::Engine::go()
|
|||
|
||||
if (stats)
|
||||
{
|
||||
constexpr unsigned statsReportDelay = 3;
|
||||
const auto frameNumber = mViewer->getFrameStamp()->getFrameNumber();
|
||||
if (frameNumber >= 2)
|
||||
if (frameNumber >= statsReportDelay)
|
||||
{
|
||||
mViewer->getViewerStats()->report(stats, frameNumber - 2);
|
||||
const unsigned reportFrameNumber = frameNumber - statsReportDelay;
|
||||
mViewer->getViewerStats()->report(stats, reportFrameNumber);
|
||||
osgViewer::Viewer::Cameras cameras;
|
||||
mViewer->getCameras(cameras);
|
||||
for (auto camera : cameras)
|
||||
camera->getStats()->report(stats, frameNumber - 2);
|
||||
camera->getStats()->report(stats, reportFrameNumber);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue