-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move tileset cache to its own class #6391
Conversation
@lilleyse, thanks for the pull request! Maintainers, we have a signed CLA from @lilleyse, so you can review this at any time.
I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
Originally in #6390 but moved out into its own PR for easier reviewing. |
* | ||
* @private | ||
*/ | ||
function Cesium3DTilesetCache() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to unit test this alone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it needs to be unit tested alone since it depends pretty heavily on having a tileset. The cache related tests in Cesium3DTileset
are pretty good and this file has 100% coverage.
@likangning93 do you want to review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple small suggestions, otherwise this looks solid to me. I also couldn't identify why CI failed on the last commit, so I restarted that.
tile.unloadContent(); | ||
totalMemoryUsageInBytes = tileset.totalMemoryUsageInBytes; | ||
} | ||
tileset._cache.unloadTiles(tileset, unloadTile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this just be inlined now that it's a one-liner and it's only called from update
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind of like how each operation on tiles has a specific name to it, e.g. processTiles
, selectTiles
, requestTiles
, updateTiles
, unloadTiles
. Just a style preference.
@@ -1502,10 +1497,7 @@ define([ | |||
tileset._statistics.incrementLoadCounts(tile.content); | |||
++tileset._statistics.numberOfTilesWithContentReady; | |||
|
|||
// Add to the tile cache. Previously expired tiles are already in the cache. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this doc be kept since checks on add
are abstracted away now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes - fixed.
CHANGES.md
Outdated
@@ -35,6 +35,7 @@ Change Log | |||
* Added support for ordering in `DataSourceCollection` [#6316](https://github.com/AnalyticalGraphicsInc/cesium/pull/6316) | |||
* All ground geometry from one `DataSource` will render in front of all ground geometry from another `DataSource` in the same collection with a lower index. | |||
* Use `DataSourceCollection.raise`, `DataSourceCollection.lower`, `DataSourceCollection.raiseToTop` and `DataSourceCollection.lowerToBottom` functions to change the ordering of a `DataSource` in the collection. | |||
* Improved processing order of 3D tiles. [#6364](https://github.com/AnalyticalGraphicsInc/cesium/pull/6364) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to 1.45.
Updated - hopefully CI passes this time. |
@likangning93 is this ready to merge? |
@pjcozzi sorry for the slow response! Yes, this is ready to go. We were waiting on CI but that seems to be resolved now. |
The 3D tiles caching code was a bit all over the place, this centralizes it to its own class.