1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 15:29:55 +00:00

Add a setting to wait for all navmesh jobs on exit

This commit is contained in:
elsid 2024-04-07 15:22:02 +02:00
parent 50f4471750
commit 910c88325a
No known key found for this signature in database
GPG key ID: 4DE04C198CBA7625
4 changed files with 20 additions and 0 deletions

View file

@ -591,6 +591,12 @@ namespace MWWorld
// Must be cleared before mRendering is destroyed // Must be cleared before mRendering is destroyed
if (mProjectileManager) if (mProjectileManager)
mProjectileManager->clear(); mProjectileManager->clear();
if (Settings::navigator().mWaitForAllJobsOnExit)
{
Log(Debug::Verbose) << "Waiting for all navmesh jobs to be done...";
mNavigator->wait(DetourNavigator::WaitConditionType::allJobsDone, nullptr);
}
} }
void World::setRandomSeed(uint32_t seed) void World::setRandomSeed(uint32_t seed)

View file

@ -63,6 +63,7 @@ namespace Settings
SettingValue<bool> mEnableNavMeshDiskCache{ mIndex, "Navigator", "enable nav mesh disk cache" }; SettingValue<bool> mEnableNavMeshDiskCache{ mIndex, "Navigator", "enable nav mesh disk cache" };
SettingValue<bool> mWriteToNavmeshdb{ mIndex, "Navigator", "write to navmeshdb" }; SettingValue<bool> mWriteToNavmeshdb{ mIndex, "Navigator", "write to navmeshdb" };
SettingValue<std::uint64_t> mMaxNavmeshdbFileSize{ mIndex, "Navigator", "max navmeshdb file size" }; SettingValue<std::uint64_t> mMaxNavmeshdbFileSize{ mIndex, "Navigator", "max navmeshdb file size" };
SettingValue<bool> mWaitForAllJobsOnExit{ mIndex, "Navigator", "wait for all jobs on exit" };
}; };
} }

View file

@ -245,6 +245,16 @@ Absent pieces usually mean a bug in recast mesh tiles building.
Allows to do in-game debug. Allows to do in-game debug.
Potentially decreases performance. Potentially decreases performance.
wait for all jobs on exit
-------------------------
:Type: boolean
:Range: True/False
:Default: False
Wait until all queued async navmesh jobs are processed before exiting the engine.
Useful when a benchmark generates jobs to write into navmeshdb faster than they are processed.
Expert settings Expert settings
*************** ***************

View file

@ -999,6 +999,9 @@ write to navmeshdb = true
# Approximate maximum file size of navigation mesh cache stored on disk in bytes (value > 0) # Approximate maximum file size of navigation mesh cache stored on disk in bytes (value > 0)
max navmeshdb file size = 2147483648 max navmeshdb file size = 2147483648
# Wait until all queued async navmesh jobs are processed before exiting the engine (true, false)
wait for all jobs on exit = false
[Shadows] [Shadows]
# Enable or disable shadows. Bear in mind that this will force OpenMW to use shaders as if "[Shaders]/force shaders" was set to true. # Enable or disable shadows. Bear in mind that this will force OpenMW to use shaders as if "[Shaders]/force shaders" was set to true.