소스 검색

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;