瀏覽代碼

WebGLAttributes: Clean up.

Mr.doob 5 年之前
父節點
當前提交
ce45cc36d9
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/renderers/webgl/WebGLAttributes.js

+ 3 - 1
src/renderers/webgl/WebGLAttributes.js

@@ -4,6 +4,8 @@
 
 
 function WebGLAttributes( gl, capabilities ) {
 function WebGLAttributes( gl, capabilities ) {
 
 
+	var isWebGL2 = capabilities.isWebGL2;
+
 	var buffers = new WeakMap();
 	var buffers = new WeakMap();
 
 
 	function createBuffer( attribute, bufferType ) {
 	function createBuffer( attribute, bufferType ) {
@@ -78,7 +80,7 @@ function WebGLAttributes( gl, capabilities ) {
 
 
 		} else {
 		} else {
 
 
-			if ( capabilities.isWebGL2 ) {
+			if ( isWebGL2 ) {
 
 
 				gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT,
 				gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT,
 					array, updateRange.offset, updateRange.count );
 					array, updateRange.offset, updateRange.count );