perf(editor): cache M2/WMO models across rebuilds, only clear instances

The editor's rebuildObjects path was destroying every cached model and
re-uploading it on every (debounced) change. Added M2Renderer::clearInstances
that drops only the instance list while keeping models loaded. Editor's
clearObjects switches to clearInstances (M2) + clearInstances (WMO),
and persistent path->modelId maps survive across rebuilds. clearTerrain
fully evicts when loading a new zone.
This commit is contained in:
Kelsi 2026-05-06 03:23:06 -07:00
parent f18976ced9
commit 5241bbd669
4 changed files with 45 additions and 5 deletions

View file

@ -357,6 +357,9 @@ public:
void removeInstances(const std::vector<uint32_t>& instanceIds);
void setSkipCollision(uint32_t instanceId, bool skip);
void clear();
/** Drop all instances but keep models in GPU memory. Cheap path for the
* editor's rebuild loop where the same model is re-instanced repeatedly. */
void clearInstances();
void cleanupUnusedModels();
bool checkCollision(const glm::vec3& from, const glm::vec3& to,