Răsfoiți Sursa

Updated builds.

Mr.doob 4 luni în urmă
părinte
comite
7e1acd058e
3 a modificat fișierele cu 20 adăugiri și 32 ștergeri
  1. 10 16
      build/three.cjs
  2. 10 16
      build/three.module.js
  3. 0 0
      build/three.module.min.js

+ 10 - 16
build/three.cjs

@@ -66100,6 +66100,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 	const _customShaders = new WebGLShaderCache();
 	const _activeChannels = new Set();
 	const programs = [];
+	const programsMap = new Map();
 
 	const logarithmicDepthBuffer = capabilities.logarithmicDepthBuffer;
 
@@ -66676,29 +66677,19 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 
 	function acquireProgram( parameters, cacheKey ) {
 
-		let program;
+		let program = programsMap.get( cacheKey );
 
-		// Check if code has been already compiled
-		for ( let p = 0, pl = programs.length; p < pl; p ++ ) {
+		if ( program !== undefined ) {
 
-			const preexistingProgram = programs[ p ];
+			++ program.usedTimes;
 
-			if ( preexistingProgram.cacheKey === cacheKey ) {
-
-				program = preexistingProgram;
-				++ program.usedTimes;
-
-				break;
-
-			}
-
-		}
-
-		if ( program === undefined ) {
+		} else {
 
 			program = new WebGLProgram( renderer, cacheKey, parameters, bindingStates );
 			programs.push( program );
 
+			programsMap.set( cacheKey, program );
+
 		}
 
 		return program;
@@ -66714,6 +66705,9 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 			programs[ i ] = programs[ programs.length - 1 ];
 			programs.pop();
 
+			// Remove from map
+			programsMap.delete( program.cacheKey );
+
 			// Free WebGL resources
 			program.destroy();
 

+ 10 - 16
build/three.module.js

@@ -7004,6 +7004,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 	const _customShaders = new WebGLShaderCache();
 	const _activeChannels = new Set();
 	const programs = [];
+	const programsMap = new Map();
 
 	const logarithmicDepthBuffer = capabilities.logarithmicDepthBuffer;
 
@@ -7580,29 +7581,19 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 
 	function acquireProgram( parameters, cacheKey ) {
 
-		let program;
+		let program = programsMap.get( cacheKey );
 
-		// Check if code has been already compiled
-		for ( let p = 0, pl = programs.length; p < pl; p ++ ) {
+		if ( program !== undefined ) {
 
-			const preexistingProgram = programs[ p ];
+			++ program.usedTimes;
 
-			if ( preexistingProgram.cacheKey === cacheKey ) {
-
-				program = preexistingProgram;
-				++ program.usedTimes;
-
-				break;
-
-			}
-
-		}
-
-		if ( program === undefined ) {
+		} else {
 
 			program = new WebGLProgram( renderer, cacheKey, parameters, bindingStates );
 			programs.push( program );
 
+			programsMap.set( cacheKey, program );
+
 		}
 
 		return program;
@@ -7618,6 +7609,9 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 			programs[ i ] = programs[ programs.length - 1 ];
 			programs.pop();
 
+			// Remove from map
+			programsMap.delete( program.cacheKey );
+
 			// Free WebGL resources
 			program.destroy();
 

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
build/three.module.min.js


Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff

粤ICP备19079148号