Skip to content

Commit cd8362e

Browse files
committed
move ext mesh gpu instancing check
1 parent c3a6eec commit cd8362e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/engine/Source/Scene/Model/ModelSceneGraph.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,12 @@ ModelSceneGraph.prototype.initialize = function (model, components) {
316316
Check.typeOf.object("modelComponents", components);
317317
//>>includeEnd('debug');
318318

319+
if (model._loader._hasMeshGpuInstancing & this.hasInstances) {
320+
throw new RuntimeError(
321+
"Models with the EXT_mesh_gpu_instancing extension cannot use the ModelInstanceCollection class.",
322+
);
323+
}
324+
319325
this._components = components;
320326

321327
this._axisCorrectionMatrix = ModelUtility.getAxisCorrectionMatrix(
@@ -521,12 +527,6 @@ ModelSceneGraph.prototype.traverseAndCreateSceneGraph = function (
521527
node,
522528
transformToRoot,
523529
) {
524-
if (defined(node.instances) & this.hasInstances) {
525-
throw new RuntimeError(
526-
"Models with the EXT_mesh_gpu_instancing extension cannot use the ModelInstanceCollection class.",
527-
);
528-
}
529-
530530
// The indices of the children of this node in the runtimeNodes array.
531531
const childrenIndices = [];
532532
const transform = ModelUtility.getNodeTransform(node);

0 commit comments

Comments
 (0)