Skip to content

Commit

Permalink
Merge pull request #5728 from AnalyticalGraphicsInc/model-cache-fix
Browse files Browse the repository at this point in the history
Fixed model cache bug
  • Loading branch information
Hannah authored Aug 8, 2017
2 parents d949a01 + 9f86488 commit be83a12
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 31 deletions.
1 change: 1 addition & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Change Log

* Fixed `replaceState` bug that was causing the `CesiumViewer` demo application to crash in Safari and iOS
* Fixed issue where `Model` and `BillboardCollection` would throw an error if the globe is undefined [#5638](https://github.com/AnalyticalGraphicsInc/cesium/issues/5638)
* Fixed issue where the `Model` glTF cache loses reference to the model's buffer data. [#5720](https://github.com/AnalyticalGraphicsInc/cesium/issues/5720)

### 1.36 - 2017-08-01

Expand Down
1 change: 0 additions & 1 deletion Source/Scene/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -4593,7 +4593,6 @@ define([
cachedResources.samplers = resources.samplers;
cachedResources.renderStates = resources.renderStates;
cachedResources.ready = true;
removePipelineExtras(this.gltf);

// The normal attribute name is required for silhouettes, so get it before the gltf JSON is released
this._normalAttributeName = getAttributeOrUniformBySemantic(this.gltf, 'NORMAL');
Expand Down
42 changes: 12 additions & 30 deletions Specs/Scene/ModelSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,38 +429,20 @@ defineSuite([
});

it('rejects readyPromise on error', function() {
var invalidGltf = clone(texturedBoxModel.gltf, true);
invalidGltf.shaders[0].uri = 'invalid.glsl';

var model = primitives.add(new Model({
gltf : invalidGltf
}));

scene.renderForSpecs();

return model.readyPromise.then(function(model) {
fail('should not resolve');
}).otherwise(function(error) {
expect(model.ready).toEqual(false);
primitives.remove(model);
});
});

it('rejects readyPromise on error', function() {
var invalidGltf = clone(texturedBoxModel.gltf, true);
invalidGltf.shaders[0].uri = 'invalid.glsl';

var model = primitives.add(new Model({
gltf : invalidGltf
}));
return loadJson(boomBoxUrl).then(function(gltf) {
gltf.images[0].uri = 'invalid.png';
var model = primitives.add(new Model({
gltf : gltf
}));

scene.renderForSpecs();
scene.renderForSpecs();

return model.readyPromise.then(function(model) {
fail('should not resolve');
}).otherwise(function(error) {
expect(model.ready).toEqual(false);
primitives.remove(model);
return model.readyPromise.then(function(model) {
fail('should not resolve');
}).otherwise(function(error) {
expect(model.ready).toEqual(false);
primitives.remove(model);
});
});
});

Expand Down

0 comments on commit be83a12

Please sign in to comment.