Skip to content

Commit

Permalink
Remove automatic mark unused schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Jan 1, 2025
1 parent ee7e3a4 commit b1365c0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
1 change: 1 addition & 0 deletions src/plugins/three/UnloadTilesPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export class UnloadTilesPlugin {

lruCache.add( tile, unloadCallback );
lruCache.markUsed( tile );
tiles.usedSet.add( tile );
deferCallbacks.cancel( tile );

} else {
Expand Down
1 change: 1 addition & 0 deletions src/plugins/three/fade/TilesFadePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ function onUpdateAfter() {
const scene = tile.cached.scene;
const isFadingOut = fadeManager.isFadingOut( tile );
lruCache.markUsed( tile );
tiles.usedSet.add( tile );
if ( scene ) {

fadeMaterialManager.setFade( scene, fadeIn, fadeOut );
Expand Down
20 changes: 0 additions & 20 deletions src/utilities/LRUCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class LRUCache {
this.itemList = [];
this.usedSet = new Set();
this.callbacks = new Map();
this.markUnusedQueued = false;
this.unloadingHandle = - 1;
this.cachedBytes = 0;
this.bytesMap = new Map();
Expand Down Expand Up @@ -78,12 +77,6 @@ class LRUCache {

add( item, removeCb ) {

if ( this.markUnusedQueued ) {

this.markAllUnused();

}

const itemSet = this.itemSet;
if ( itemSet.has( item ) ) {

Expand Down Expand Up @@ -194,12 +187,6 @@ class LRUCache {

markUsed( item ) {

if ( this.markUnusedQueued ) {

this.markAllUnused();

}

const itemSet = this.itemSet;
const usedSet = this.usedSet;
if ( itemSet.has( item ) && ! usedSet.has( item ) ) {
Expand All @@ -220,7 +207,6 @@ class LRUCache {
markAllUnused() {

this.usedSet.clear();
this.markUnusedQueued = false;
if ( this.unloadingHandle !== - 1 ) {

cancelAnimationFrame( this.unloadingHandle );
Expand Down Expand Up @@ -386,12 +372,6 @@ class LRUCache {
this.scheduled = false;
this.unloadUnusedContent();

if ( this.autoMarkUnused ) {

this.markUnusedQueued = true;

}

} );

}
Expand Down

0 comments on commit b1365c0

Please sign in to comment.