-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Conversation
@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. 🌍 🌎 🌏 |
Specs/Scene/ModelSpec.js
Outdated
@@ -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() { |
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.
you left a couple of fit
in the code.
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.
Looks good and fixes the issue. Can confirm that the GPU resources are still shared.
Source/Scene/DracoLoader.js
Outdated
if (!DracoLoader.hasExtension(model)) { | ||
return; | ||
} | ||
|
||
var loadResources = model._loadResources; | ||
var cacheKey = model.cacheKey; | ||
if (defined(cacheKey)) { | ||
if (!define(DracoLoader._decodedModelResourceCache)) { |
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 be defined
@@ -4585,6 +4587,7 @@ define([ | |||
|
|||
this._rendererResources = undefined; | |||
this._cachedRendererResources = this._cachedRendererResources && this._cachedRendererResources.release(); | |||
DracoLoader.destroyCachedDataForModel(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.
Should the cached data be reference counted, similar to CachedRendererResources
? This scenario isn't working for me:
- Load first model
- Load second model
- Destroy first model
- Load third model
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) |
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.
Maybe mention that this also applies to draco encoded i3dm tiles, since that's where most users have run into it.
@lilleyse Fixed issue with #6673 (comment), ready for another look. |
The updates look good, thanks @ggetz! |
Fixes #6668 by caching decoded Draco data for models with the same cache key (url).