소스 검색

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 1 년 전
부모
커밋
376f997ebd
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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 );