Browse Source

Updated builds.

Mugen87 2 years ago
parent
commit
6b851b940b
4 changed files with 165 additions and 109 deletions
  1. 51 35
      build/three.cjs
  2. 51 35
      build/three.js
  3. 0 0
      build/three.min.js
  4. 63 39
      build/three.module.js

+ 51 - 35
build/three.cjs

@@ -13455,9 +13455,14 @@ function setValueV4uiArray(gl, v) {
 
 
 function setValueT1Array(gl, v, textures) {
+	const cache = this.cache;
 	const n = v.length;
 	const units = allocTexUnits(textures, n);
-	gl.uniform1iv(this.addr, units);
+
+	if (!arraysEqual(cache, units)) {
+		gl.uniform1iv(this.addr, units);
+		copyArray(cache, units);
+	}
 
 	for (let i = 0; i !== n; ++i) {
 		textures.setTexture2D(v[i] || emptyTexture, units[i]);
@@ -13465,9 +13470,14 @@ function setValueT1Array(gl, v, textures) {
 }
 
 function setValueT3DArray(gl, v, textures) {
+	const cache = this.cache;
 	const n = v.length;
 	const units = allocTexUnits(textures, n);
-	gl.uniform1iv(this.addr, units);
+
+	if (!arraysEqual(cache, units)) {
+		gl.uniform1iv(this.addr, units);
+		copyArray(cache, units);
+	}
 
 	for (let i = 0; i !== n; ++i) {
 		textures.setTexture3D(v[i] || empty3dTexture, units[i]);
@@ -13475,9 +13485,14 @@ function setValueT3DArray(gl, v, textures) {
 }
 
 function setValueT6Array(gl, v, textures) {
+	const cache = this.cache;
 	const n = v.length;
 	const units = allocTexUnits(textures, n);
-	gl.uniform1iv(this.addr, units);
+
+	if (!arraysEqual(cache, units)) {
+		gl.uniform1iv(this.addr, units);
+		copyArray(cache, units);
+	}
 
 	for (let i = 0; i !== n; ++i) {
 		textures.setTextureCube(v[i] || emptyCubeTexture, units[i]);
@@ -13485,9 +13500,14 @@ function setValueT6Array(gl, v, textures) {
 }
 
 function setValueT2DArrayArray(gl, v, textures) {
+	const cache = this.cache;
 	const n = v.length;
 	const units = allocTexUnits(textures, n);
-	gl.uniform1iv(this.addr, units);
+
+	if (!arraysEqual(cache, units)) {
+		gl.uniform1iv(this.addr, units);
+		copyArray(cache, units);
+	}
 
 	for (let i = 0; i !== n; ++i) {
 		textures.setTexture2DArray(v[i] || emptyArrayTexture, units[i]);
@@ -15706,45 +15726,41 @@ function WebGLState(gl, extensions, capabilities) {
 			},
 			setFunc: function (depthFunc) {
 				if (currentDepthFunc !== depthFunc) {
-					if (depthFunc) {
-						switch (depthFunc) {
-							case NeverDepth:
-								gl.depthFunc(gl.NEVER);
-								break;
+					switch (depthFunc) {
+						case NeverDepth:
+							gl.depthFunc(gl.NEVER);
+							break;
 
-							case AlwaysDepth:
-								gl.depthFunc(gl.ALWAYS);
-								break;
+						case AlwaysDepth:
+							gl.depthFunc(gl.ALWAYS);
+							break;
 
-							case LessDepth:
-								gl.depthFunc(gl.LESS);
-								break;
+						case LessDepth:
+							gl.depthFunc(gl.LESS);
+							break;
 
-							case LessEqualDepth:
-								gl.depthFunc(gl.LEQUAL);
-								break;
+						case LessEqualDepth:
+							gl.depthFunc(gl.LEQUAL);
+							break;
 
-							case EqualDepth:
-								gl.depthFunc(gl.EQUAL);
-								break;
+						case EqualDepth:
+							gl.depthFunc(gl.EQUAL);
+							break;
 
-							case GreaterEqualDepth:
-								gl.depthFunc(gl.GEQUAL);
-								break;
+						case GreaterEqualDepth:
+							gl.depthFunc(gl.GEQUAL);
+							break;
 
-							case GreaterDepth:
-								gl.depthFunc(gl.GREATER);
-								break;
+						case GreaterDepth:
+							gl.depthFunc(gl.GREATER);
+							break;
 
-							case NotEqualDepth:
-								gl.depthFunc(gl.NOTEQUAL);
-								break;
+						case NotEqualDepth:
+							gl.depthFunc(gl.NOTEQUAL);
+							break;
 
-							default:
-								gl.depthFunc(gl.LEQUAL);
-						}
-					} else {
-						gl.depthFunc(gl.LEQUAL);
+						default:
+							gl.depthFunc(gl.LEQUAL);
 					}
 
 					currentDepthFunc = depthFunc;

+ 51 - 35
build/three.js

@@ -13457,9 +13457,14 @@
 
 
 	function setValueT1Array(gl, v, textures) {
+		const cache = this.cache;
 		const n = v.length;
 		const units = allocTexUnits(textures, n);
-		gl.uniform1iv(this.addr, units);
+
+		if (!arraysEqual(cache, units)) {
+			gl.uniform1iv(this.addr, units);
+			copyArray(cache, units);
+		}
 
 		for (let i = 0; i !== n; ++i) {
 			textures.setTexture2D(v[i] || emptyTexture, units[i]);
@@ -13467,9 +13472,14 @@
 	}
 
 	function setValueT3DArray(gl, v, textures) {
+		const cache = this.cache;
 		const n = v.length;
 		const units = allocTexUnits(textures, n);
-		gl.uniform1iv(this.addr, units);
+
+		if (!arraysEqual(cache, units)) {
+			gl.uniform1iv(this.addr, units);
+			copyArray(cache, units);
+		}
 
 		for (let i = 0; i !== n; ++i) {
 			textures.setTexture3D(v[i] || empty3dTexture, units[i]);
@@ -13477,9 +13487,14 @@
 	}
 
 	function setValueT6Array(gl, v, textures) {
+		const cache = this.cache;
 		const n = v.length;
 		const units = allocTexUnits(textures, n);
-		gl.uniform1iv(this.addr, units);
+
+		if (!arraysEqual(cache, units)) {
+			gl.uniform1iv(this.addr, units);
+			copyArray(cache, units);
+		}
 
 		for (let i = 0; i !== n; ++i) {
 			textures.setTextureCube(v[i] || emptyCubeTexture, units[i]);
@@ -13487,9 +13502,14 @@
 	}
 
 	function setValueT2DArrayArray(gl, v, textures) {
+		const cache = this.cache;
 		const n = v.length;
 		const units = allocTexUnits(textures, n);
-		gl.uniform1iv(this.addr, units);
+
+		if (!arraysEqual(cache, units)) {
+			gl.uniform1iv(this.addr, units);
+			copyArray(cache, units);
+		}
 
 		for (let i = 0; i !== n; ++i) {
 			textures.setTexture2DArray(v[i] || emptyArrayTexture, units[i]);
@@ -15708,45 +15728,41 @@
 				},
 				setFunc: function (depthFunc) {
 					if (currentDepthFunc !== depthFunc) {
-						if (depthFunc) {
-							switch (depthFunc) {
-								case NeverDepth:
-									gl.depthFunc(gl.NEVER);
-									break;
+						switch (depthFunc) {
+							case NeverDepth:
+								gl.depthFunc(gl.NEVER);
+								break;
 
-								case AlwaysDepth:
-									gl.depthFunc(gl.ALWAYS);
-									break;
+							case AlwaysDepth:
+								gl.depthFunc(gl.ALWAYS);
+								break;
 
-								case LessDepth:
-									gl.depthFunc(gl.LESS);
-									break;
+							case LessDepth:
+								gl.depthFunc(gl.LESS);
+								break;
 
-								case LessEqualDepth:
-									gl.depthFunc(gl.LEQUAL);
-									break;
+							case LessEqualDepth:
+								gl.depthFunc(gl.LEQUAL);
+								break;
 
-								case EqualDepth:
-									gl.depthFunc(gl.EQUAL);
-									break;
+							case EqualDepth:
+								gl.depthFunc(gl.EQUAL);
+								break;
 
-								case GreaterEqualDepth:
-									gl.depthFunc(gl.GEQUAL);
-									break;
+							case GreaterEqualDepth:
+								gl.depthFunc(gl.GEQUAL);
+								break;
 
-								case GreaterDepth:
-									gl.depthFunc(gl.GREATER);
-									break;
+							case GreaterDepth:
+								gl.depthFunc(gl.GREATER);
+								break;
 
-								case NotEqualDepth:
-									gl.depthFunc(gl.NOTEQUAL);
-									break;
+							case NotEqualDepth:
+								gl.depthFunc(gl.NOTEQUAL);
+								break;
 
-								default:
-									gl.depthFunc(gl.LEQUAL);
-							}
-						} else {
-							gl.depthFunc(gl.LEQUAL);
+							default:
+								gl.depthFunc(gl.LEQUAL);
 						}
 
 						currentDepthFunc = depthFunc;

File diff suppressed because it is too large
+ 0 - 0
build/three.min.js


+ 63 - 39
build/three.module.js

@@ -17644,11 +17644,19 @@ function setValueV4uiArray( gl, v ) {
 
 function setValueT1Array( gl, v, textures ) {
 
+	const cache = this.cache;
+
 	const n = v.length;
 
 	const units = allocTexUnits( textures, n );
 
-	gl.uniform1iv( this.addr, units );
+	if ( ! arraysEqual( cache, units ) ) {
+
+		gl.uniform1iv( this.addr, units );
+
+		copyArray( cache, units );
+
+	}
 
 	for ( let i = 0; i !== n; ++ i ) {
 
@@ -17660,11 +17668,19 @@ function setValueT1Array( gl, v, textures ) {
 
 function setValueT3DArray( gl, v, textures ) {
 
+	const cache = this.cache;
+
 	const n = v.length;
 
 	const units = allocTexUnits( textures, n );
 
-	gl.uniform1iv( this.addr, units );
+	if ( ! arraysEqual( cache, units ) ) {
+
+		gl.uniform1iv( this.addr, units );
+
+		copyArray( cache, units );
+
+	}
 
 	for ( let i = 0; i !== n; ++ i ) {
 
@@ -17676,11 +17692,19 @@ function setValueT3DArray( gl, v, textures ) {
 
 function setValueT6Array( gl, v, textures ) {
 
+	const cache = this.cache;
+
 	const n = v.length;
 
 	const units = allocTexUnits( textures, n );
 
-	gl.uniform1iv( this.addr, units );
+	if ( ! arraysEqual( cache, units ) ) {
+
+		gl.uniform1iv( this.addr, units );
+
+		copyArray( cache, units );
+
+	}
 
 	for ( let i = 0; i !== n; ++ i ) {
 
@@ -17692,11 +17716,19 @@ function setValueT6Array( gl, v, textures ) {
 
 function setValueT2DArrayArray( gl, v, textures ) {
 
+	const cache = this.cache;
+
 	const n = v.length;
 
 	const units = allocTexUnits( textures, n );
 
-	gl.uniform1iv( this.addr, units );
+	if ( ! arraysEqual( cache, units ) ) {
+
+		gl.uniform1iv( this.addr, units );
+
+		copyArray( cache, units );
+
+	}
 
 	for ( let i = 0; i !== n; ++ i ) {
 
@@ -21040,59 +21072,51 @@ function WebGLState( gl, extensions, capabilities ) {
 
 				if ( currentDepthFunc !== depthFunc ) {
 
-					if ( depthFunc ) {
+					switch ( depthFunc ) {
 
-						switch ( depthFunc ) {
+						case NeverDepth:
 
-							case NeverDepth:
-
-								gl.depthFunc( 512 );
-								break;
-
-							case AlwaysDepth:
-
-								gl.depthFunc( 519 );
-								break;
-
-							case LessDepth:
+							gl.depthFunc( 512 );
+							break;
 
-								gl.depthFunc( 513 );
-								break;
+						case AlwaysDepth:
 
-							case LessEqualDepth:
+							gl.depthFunc( 519 );
+							break;
 
-								gl.depthFunc( 515 );
-								break;
+						case LessDepth:
 
-							case EqualDepth:
+							gl.depthFunc( 513 );
+							break;
 
-								gl.depthFunc( 514 );
-								break;
+						case LessEqualDepth:
 
-							case GreaterEqualDepth:
+							gl.depthFunc( 515 );
+							break;
 
-								gl.depthFunc( 518 );
-								break;
+						case EqualDepth:
 
-							case GreaterDepth:
+							gl.depthFunc( 514 );
+							break;
 
-								gl.depthFunc( 516 );
-								break;
+						case GreaterEqualDepth:
 
-							case NotEqualDepth:
+							gl.depthFunc( 518 );
+							break;
 
-								gl.depthFunc( 517 );
-								break;
+						case GreaterDepth:
 
-							default:
+							gl.depthFunc( 516 );
+							break;
 
-								gl.depthFunc( 515 );
+						case NotEqualDepth:
 
-						}
+							gl.depthFunc( 517 );
+							break;
 
-					} else {
+						default:
 
-						gl.depthFunc( 515 );
+							gl.depthFunc( 515 );
 
 					}
 

Some files were not shown because too many files changed in this diff