Skip to content

Commit 8648a46

Browse files
authored
Merge pull request #8569 from AnalyticalGraphicsInc/dontShareGeometryArray
Don't share geometry arrays between Batch and Primitive
2 parents bfd66c4 + 680fcbe commit 8648a46

11 files changed

+15
-14
lines changed

Apps/Sandcastle/gallery/development/Circle Outline.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
});
4343
// Add the geometry instance to primitives.
4444
scene.primitives.add(new Cesium.Primitive({
45-
geometryInstances : [circleOutlineInstance],
45+
geometryInstances : circleOutlineInstance,
4646
appearance : new Cesium.PerInstanceColorAppearance({
4747
flat : true,
4848
renderState : {
@@ -72,7 +72,7 @@
7272
});
7373
// Add the geometry instance to primitives.
7474
scene.primitives.add(new Cesium.Primitive({
75-
geometryInstances : [circleOutlineInstance],
75+
geometryInstances : circleOutlineInstance,
7676
appearance : new Cesium.PerInstanceColorAppearance({
7777
flat : true,
7878
renderState : {

Apps/Sandcastle/gallery/development/Circle.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
});
4646
// Add the geometry instance to primitives.
4747
scene.primitives.add(new Cesium.Primitive({
48-
geometryInstances: [redCircleInstance],
48+
geometryInstances: redCircleInstance,
4949
appearance: new Cesium.PerInstanceColorAppearance({
5050
closed: true
5151
})
@@ -71,7 +71,7 @@
7171
});
7272
// Add the geometry instance to primitives.
7373
scene.primitives.add(new Cesium.Primitive({
74-
geometryInstances: [greenCircleInstance],
74+
geometryInstances: greenCircleInstance,
7575
appearance: new Cesium.PerInstanceColorAppearance({
7676
closed: true
7777
})

Apps/Sandcastle/gallery/development/Corridor.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
});
5050
// Add the geometry instance to primitives.
5151
scene.primitives.add(new Cesium.Primitive({
52-
geometryInstances : [redCorridorInstance],
52+
geometryInstances : redCorridorInstance,
5353
appearance : new Cesium.PerInstanceColorAppearance({
5454
closed : true
5555
})
@@ -118,7 +118,7 @@
118118
});
119119
// Add the geometry instance to primitives.
120120
scene.primitives.add(new Cesium.Primitive({
121-
geometryInstances : [blueCorridorInstance],
121+
geometryInstances : blueCorridorInstance,
122122
appearance : new Cesium.PerInstanceColorAppearance({
123123
closed : true
124124
})

Apps/Sandcastle/gallery/development/Cylinder Outline.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
});
5656
// Add the instance to primitives.
5757
scene.primitives.add(new Cesium.Primitive({
58-
geometryInstances : [cylinderOutline],
58+
geometryInstances : cylinderOutline,
5959
appearance : new Cesium.PerInstanceColorAppearance({
6060
flat : true,
6161
renderState : {

CHANGES.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ Change Log
4242
* Fixed a bug where toggling point cloud classification visibility would result in a grey screen on Linux / Nvidia [#8538](https://github.com/AnalyticalGraphicsInc/cesium/pull/8538)
4343
* Fixed a bug where a point in a `PointPrimitiveCollection` is rendered in the middle of the screen instead of being clipped. [#8542](https://github.com/AnalyticalGraphicsInc/cesium/pull/8542)
4444
* Fixed a crash when deleting and re-creating polylines from CZML. `ReferenceProperty` now returns undefined when the target entity or property does not exist, instead of throwing. [#8544](https://github.com/AnalyticalGraphicsInc/cesium/pull/8544)
45-
* Fixed a bug where rapidly updating a PolylineCollection could result in an instanceIndex is out of range error [#8546](https://github.com/AnalyticalGraphicsInc/cesium/pull/8546)
45+
* Fixed a bug where rapidly updating a `PolylineCollection` could result in an instanceIndex is out of range error. [#8546](https://github.com/AnalyticalGraphicsInc/cesium/pull/8546)
46+
* Fixed a crash that could occur when an entity was deleted while the corresponding `Primitive` was being created asynchronously. [#8569](https://github.com/AnalyticalGraphicsInc/cesium/pull/8569)
4647

4748
### 1.65.0 - 2020-01-06
4849

Source/DataSources/StaticGeometryColorBatch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ import Property from './Property.js';
131131
primitive = new Primitive({
132132
show : false,
133133
asynchronous : true,
134-
geometryInstances : geometries,
134+
geometryInstances : geometries.slice(),
135135
appearance : new this.appearanceType({
136136
translucent : this.translucent,
137137
closed : this.closed

Source/DataSources/StaticGeometryPerMaterialBatch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ import Property from './Property.js';
127127
primitive = new Primitive({
128128
show : false,
129129
asynchronous : true,
130-
geometryInstances : geometries,
130+
geometryInstances : geometries.slice(),
131131
appearance : new this.appearanceType({
132132
material : this.material,
133133
translucent : this.material.isTranslucent(),

Source/DataSources/StaticGroundGeometryColorBatch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ import Property from './Property.js';
8989
primitive = new GroundPrimitive({
9090
show : false,
9191
asynchronous : true,
92-
geometryInstances : geometries,
92+
geometryInstances : geometries.slice(),
9393
classificationType : this.classificationType
9494
});
9595
primitives.add(primitive, this.zIndex);

Source/DataSources/StaticGroundGeometryPerMaterialBatch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ import Property from './Property.js';
119119
primitive = new GroundPrimitive({
120120
show : false,
121121
asynchronous : true,
122-
geometryInstances : geometries,
122+
geometryInstances : geometries.slice(),
123123
appearance : new this.appearanceType({
124124
material : this.material
125125
// translucent and closed properties overridden

Source/DataSources/StaticGroundPolylinePerMaterialBatch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ import Property from './Property.js';
121121
primitive = new GroundPolylinePrimitive({
122122
show : false,
123123
asynchronous : this._asynchronous,
124-
geometryInstances : geometries,
124+
geometryInstances : geometries.slice(),
125125
appearance : new this.appearanceType(),
126126
classificationType : this.classificationType
127127
});

Source/DataSources/StaticOutlineGeometryBatch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ import Property from './Property.js';
9090
primitive = new Primitive({
9191
show : false,
9292
asynchronous : true,
93-
geometryInstances : geometries,
93+
geometryInstances : geometries.slice(),
9494
appearance : new PerInstanceColorAppearance({
9595
flat : true,
9696
translucent : this.translucent,

0 commit comments

Comments
 (0)