mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-07 17:43:51 +00:00
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:
parent
f18976ced9
commit
5241bbd669
4 changed files with 45 additions and 5 deletions
|
|
@ -377,6 +377,22 @@ void M2Renderer::clear() {
|
|||
textureBudgetRejectWarnings_ = 0;
|
||||
}
|
||||
|
||||
void M2Renderer::clearInstances() {
|
||||
if (vkCtx_) vkDeviceWaitIdle(vkCtx_->getDevice());
|
||||
for (auto& inst : instances) destroyInstanceBones(inst);
|
||||
instances.clear();
|
||||
spatialGrid.clear();
|
||||
instanceIndexById.clear();
|
||||
instanceDedupMap_.clear();
|
||||
smokeInstanceIndices_.clear();
|
||||
portalInstanceIndices_.clear();
|
||||
animatedInstanceIndices_.clear();
|
||||
particleOnlyInstanceIndices_.clear();
|
||||
particleInstanceIndices_.clear();
|
||||
smokeParticles.clear();
|
||||
smokeEmitAccum = 0.0f;
|
||||
}
|
||||
|
||||
void M2Renderer::setCollisionFocus(const glm::vec3& worldPos, float radius) {
|
||||
collisionFocusEnabled = (radius > 0.0f);
|
||||
collisionFocusPos = worldPos;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue