Explorar o código

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

Michael Herzog %!s(int64=3) %!d(string=hai) anos
pai
achega
9410bdadd1
Modificáronse 1 ficheiros con 2 adicións e 4 borrados
  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;