Commit Graph

28 Commits (a854a6e04a8437d74078906d1d1720c0649e4e6f)

Author SHA1 Message Date
Bo Svensson a854a6e04a
removes UnrefQueue (#3181)
Currently, we use an `UnrefQueue` which supposedly aims to transfer destruction costs to another thread. The implications of this unusual pattern can not be well understood because some allocators might free resources more efficiently if they are freed by the same thread that allocated them. In addition, `UnrefQueue` complicates the validation of thread safety in our engine. Lastly, our current usage of `UnrefQueue` triggers `ref()`, `unref()` atomic operations as objects are passed into the queue. These operations could be more expensive than the actual destruction.

With this PR we thus remove `UnrefQueue`. We can expect these changes to have a minor impact at most because we free most resources elsewhere in `ResourceSystem::updateCache`.
3 years ago
Bret Curtis fd251dfe55 remove unused member variable 3 years ago
Bo Svensson f62adab43a
Avoid the terrain sync completely in most cases (#3103)
We can take elsid's commit 605cb8d further by avoiding the terrain sync completely in most cases. Currently in changeCellGrid we wait for a new preloading task to ensure the getPagedRefnums for the new active cells have been filled in by object paging. This is usually not necessary because we have already completed a preload in the past containing these active cells. With this PR we remember what we preloaded and skip the terrain sync if it is not needed.
3 years ago
elsid 605cb8db7c
Make sync terrain preloading sleep free
This reduces average time spent on in. 5 milliseconds as a base precision is
quite a lot considering that for 60 FPS frame time is 1000/16 = ~16.67 ms
when it's a cell loading frame and there is more important work to do rather
than sleeping.
3 years ago
bzzt lost a hitlab login b27b76e325 avoid pagerebuild when reloading a same save
Signed-off-by: Bret Curtis <psi29a@gmail.com>
4 years ago
bzzt lost a hitlab login c7fda6d280 activegrid paging = 2xfps
Signed-off-by: Bret Curtis <psi29a@gmail.com>
4 years ago
bzzt lost a hitlab login b4af2ac672 avoid blocking on pagerebuild
Signed-off-by: Bret Curtis <psi29a@gmail.com>
4 years ago
bzzt lost a hitlab login ffbed7ee38 loadingscreen
Signed-off-by: Bret Curtis <psi29a@gmail.com>
4 years ago
bzzt d684f1a78f terrainbased objectpaging
Signed-off-by: Bret Curtis <psi29a@gmail.com>
4 years ago
Andrei Kortunov 489e5c6cce Store preloaded terrain view in the main thread 5 years ago
scrawl 42e9891504 Fix issues caused by loading multiple views into the same terrain View 7 years ago
scrawl 97ed999097 Fix cleanup issue 7 years ago
scrawl 3c29e2dbeb Refactor ownership of terrain views 7 years ago
scrawl 4549196b31 Use the new way of terrain preloading in CellPreloader/Scene 7 years ago
scrawl 9a3a64f0c4 Add resource manager for ESM::Land to allow data to be unloaded when no longer required 7 years ago
scrawl 3f3d00ffc9 Add CellPreloader::clear to avoid potential dangling CellStore pointer and to more aggressively clear preload state from a previous game 7 years ago
scrawl eaeba4138b Move the deletion of PreloadItem to the worker thread 7 years ago
scrawl 0be811c519 Update the resource cache every second instead of every frame
A dry run takes about ~1.5ms. Even though it's all done in the worker thread, the locks used can stall loading operations that are about to happen in other threads, and just in general this CPU load is unnecessary.
7 years ago
scrawl e1dda9675d Add "preload instances" setting, disabling this may help if you are low on memory. 8 years ago
scrawl 5cda89c15d Don't attempt to preload more exterior cells than the cache can hold (Bug #3273) 8 years ago
scrawl 6fb0022b35 Update preloading settings
Disable 'preload fast travel' by default.

Add 'min cache size' and 'max cache size' settings.

Split the 'cache expiry delay' into 'preload cell expiry delay' and 'cache expiry delay'.
8 years ago
scrawl 6bfeb118d7 Fix cleanup issue 8 years ago
scrawl 0865cea211 Preload terrain 8 years ago
scrawl e28dc3e72f Preload instances in SceneManager 8 years ago
scrawl c8054424c9 Preload items equipped by NPCs 8 years ago
scrawl a81b10b415 Make the cache expiryDelay configurable 8 years ago
scrawl d855a13b44 Clear the resource cache from the worker thread 8 years ago
scrawl 6f9ca0f68f Add basic cell preloader class
Not properly in use yet, but seems to be working.
8 years ago