Skip to content
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

Fix loading multiple draco models wit the same url #6673

Merged
merged 5 commits into from
Jun 12, 2018
Merged

Conversation

ggetz
Copy link
Contributor

@ggetz ggetz commented Jun 8, 2018

Fixes #6668 by caching decoded Draco data for models with the same cache key (url).

@ggetz ggetz requested a review from lilleyse June 8, 2018 21:41
@cesium-concierge
Copy link

Signed CLA is on file.

@ggetz, thanks for the pull request! Maintainers, we have a signed CLA from @ggetz, so you can review this at any time.


I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@@ -2380,14 +2380,14 @@ defineSuite([
});
});

it('loads a gltf with WEB3D_quantized_attributes SCALAR attribute', function() {
fit('loads a gltf with WEB3D_quantized_attributes SCALAR attribute', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you left a couple of fit in the code.

@mramato
Copy link
Contributor

mramato commented Jun 9, 2018

I'll let @lilleyse review and merge, but I can confirm that this fixes the original issue I was seeing with draco encoded i3dm tiles. Thanks @ggetz!

Copy link
Contributor

@lilleyse lilleyse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and fixes the issue. Can confirm that the GPU resources are still shared.

if (!DracoLoader.hasExtension(model)) {
return;
}

var loadResources = model._loadResources;
var cacheKey = model.cacheKey;
if (defined(cacheKey)) {
if (!define(DracoLoader._decodedModelResourceCache)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be defined

@@ -4585,6 +4587,7 @@ define([

this._rendererResources = undefined;
this._cachedRendererResources = this._cachedRendererResources && this._cachedRendererResources.release();
DracoLoader.destroyCachedDataForModel(this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the cached data be reference counted, similar to CachedRendererResources? This scenario isn't working for me:

  1. Load first model
  2. Load second model
  3. Destroy first model
  4. Load third model

localhost:8080 Sandcastle

CHANGES.md Outdated
@@ -9,6 +9,7 @@ Change Log

##### Fixes :wrench:
* Fixed a bug causing crashes with custom vertex attributes on `Geometry` crossing the IDL. Attributes will be barycentrically interpolated. [#6644](https://github.com/AnalyticalGraphicsInc/cesium/pull/6644)
* Fixed a bug with loading two Draco models with the same url. [#6668](https://github.com/AnalyticalGraphicsInc/cesium/issues/6668)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mention that this also applies to draco encoded i3dm tiles, since that's where most users have run into it.

@ggetz
Copy link
Contributor Author

ggetz commented Jun 12, 2018

@lilleyse Fixed issue with #6673 (comment), ready for another look.

@lilleyse
Copy link
Contributor

The updates look good, thanks @ggetz!

@lilleyse lilleyse merged commit 75356fb into master Jun 12, 2018
@lilleyse lilleyse deleted the instanced-draco branch June 12, 2018 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants