浏览代码

Merge pull request #8486 from spite/dev

Using context's max attributes number
Mr.doob 9 年之前
父节点
当前提交
7e4ad58a3f
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/renderers/webgl/WebGLState.js

+ 4 - 3
src/renderers/webgl/WebGLState.js

@@ -8,9 +8,10 @@ THREE.WebGLState = function ( gl, extensions, paramThreeToGL ) {
 
 	var color = new THREE.Vector4();
 
-	var newAttributes = new Uint8Array( 16 );
-	var enabledAttributes = new Uint8Array( 16 );
-	var attributeDivisors = new Uint8Array( 16 );
+	var maxVertexAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS );
+	var newAttributes = new Uint8Array( maxVertexAttributes );
+	var enabledAttributes = new Uint8Array( maxVertexAttributes );
+	var attributeDivisors = new Uint8Array( maxVertexAttributes );
 
 	var capabilities = {};