1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-04-10 06:44:29 +00:00

Merge branch 'optimize_object_paging_refs_exclusion' into 'master'

Optimize object paging refs exclusion

See merge request OpenMW/openmw!4075
This commit is contained in:
psi29a 2024-05-05 20:15:15 +00:00
commit 41a2a4082f
3 changed files with 18 additions and 5 deletions

View File

@ -343,7 +343,12 @@ namespace MWGui
MWBase::Environment::get().getInputManager()->update(0, true, true); 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()) if (osgUtil::IncrementalCompileOperation* ico = mViewer->getIncrementalCompileOperation())
{ {
ico->setMinimumTimeAvailableForGLCompileAndDeletePerFrame(1.f / getTargetFrameRate()); ico->setMinimumTimeAvailableForGLCompileAndDeletePerFrame(1.f / getTargetFrameRate());

View File

@ -555,11 +555,19 @@ namespace MWRender
// TODO // TODO
} }
if (activeGrid) if (activeGrid && !refs.empty())
{ {
std::lock_guard<std::mutex> lock(mRefTrackerMutex); std::lock_guard<std::mutex> lock(mRefTrackerMutex);
for (auto ref : getRefTracker().mBlacklist) const std::set<ESM::RefNum>& blacklist = getRefTracker().mBlacklist;
refs.erase(ref); if (blacklist.size() < refs.size())
{
for (ESM::RefNum ref : blacklist)
refs.erase(ref);
}
else
{
std::erase_if(refs, [&](const auto& ref) { return blacklist.contains(ref.first); });
}
} }
osg::Vec2f minBound = (center - osg::Vec2f(size / 2.f, size / 2.f)); osg::Vec2f minBound = (center - osg::Vec2f(size / 2.f, size / 2.f));

View File

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