Explorar o código

BatchedMesh: Avoid primitive restart values in index array (#28641)

* BatchedMesh: Avoid primitive restart values in index array

* BatchedMesh: Add clarifying comment on primitive restart
Don McCurdy hai 1 ano
pai
achega
376f997ebd
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/objects/BatchedMesh.js

+ 2 - 1
src/objects/BatchedMesh.js

@@ -239,7 +239,8 @@ class BatchedMesh extends Mesh {
 
 			if ( reference.getIndex() !== null ) {
 
-				const indexArray = maxVertexCount > 65536
+				// Reserve last u16 index for primitive restart.
+				const indexArray = maxVertexCount > 65535
 					? new Uint32Array( maxIndexCount )
 					: new Uint16Array( maxIndexCount );