File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) ) {
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments