Skip to content

Commit 3fb7b1b

Browse files
authored
latest (#9011)
1 parent 10a295c commit 3fb7b1b

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

src/scene/gsplat-unified/gsplat-octree.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,11 @@ class GSplatOctree {
360360
*/
361361
ensureFileResource(fileIndex) {
362362
Debug.assert(fileIndex >= 0 && fileIndex < this.files.length);
363-
Debug.assert(this.assetLoader);
363+
364+
// If octree was destroyed, assetLoader is null - nothing to load
365+
if (!this.assetLoader) {
366+
return;
367+
}
364368

365369
// resource already loaded
366370
if (this.fileResources.has(fileIndex)) {

src/scene/gsplat-unified/gsplat-world.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,19 @@ class GSplatWorld {
447447
result.overdrawDirty = false;
448448
result.sortNeeded = false;
449449

450+
// Drop instances whose octree was destroyed (e.g. the asset was unloaded) before the
451+
// layer placement change reaches reconcile - they can no longer stream and their
452+
// resources are gone, so letting them run this update would assert and crash the
453+
// budget pass. Mirrors the removal branch in reconcile.
454+
for (const [placement, inst] of this._octreeInstances) {
455+
if (inst.octree.destroyed) {
456+
this._octreeInstances.delete(placement);
457+
this._layerPlacementsDirty = true;
458+
this._placementSetChanged = true;
459+
this._octreeInstancesToDestroy.push(inst);
460+
}
461+
}
462+
450463
// Cadence: a free-running metronome raises a latched request every 10 frames.
451464
if (--this._framesTillFullUpdate <= 0) {
452465
this._framesTillFullUpdate = 10;

0 commit comments

Comments
 (0)