浏览代码

WebGLState: Simplify checks in drawBuffers(). (#23200)

Michael Herzog 3 年之前
父节点
当前提交
9410bdadd1
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      src/renderers/webgl/WebGLState.js

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

@@ -500,10 +500,9 @@ function WebGLState( gl, extensions, capabilities ) {
 
 			} else {
 
-				if ( drawBuffers.length !== 1 || drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) {
+				if ( drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) {
 
 					drawBuffers[ 0 ] = gl.COLOR_ATTACHMENT0;
-					drawBuffers.length = 1;
 
 					needsUpdate = true;
 
@@ -513,10 +512,9 @@ function WebGLState( gl, extensions, capabilities ) {
 
 		} else {
 
-			if ( drawBuffers.length !== 1 || drawBuffers[ 0 ] !== gl.BACK ) {
+			if ( drawBuffers[ 0 ] !== gl.BACK ) {
 
 				drawBuffers[ 0 ] = gl.BACK;
-				drawBuffers.length = 1;
 
 				needsUpdate = true;