@galacean/engine 1.1.0-beta.11 → 1.1.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -21269,7 +21269,7 @@
21269
21269
  * @internal
21270
21270
  */ var ShaderProgramPool = /*#__PURE__*/ function() {
21271
21271
  var ShaderProgramPool = function ShaderProgramPool() {
21272
- this._cacheHierarchy = 1;
21272
+ this._cacheHierarchyDepth = 1;
21273
21273
  this._cacheMap = Object.create(null);
21274
21274
  };
21275
21275
  var _proto = ShaderProgramPool.prototype;
@@ -21280,12 +21280,14 @@
21280
21280
  */ _proto.get = function get(macros) {
21281
21281
  var cacheMap = this._cacheMap;
21282
21282
  var maskLength = macros._length;
21283
- if (maskLength > this._cacheHierarchy) {
21284
- this._resizeCacheMapHierarchy(cacheMap, 0, maskLength);
21283
+ var cacheHierarchyDepth = this._cacheHierarchyDepth;
21284
+ if (maskLength > cacheHierarchyDepth) {
21285
+ this._resizeCacheMapHierarchy(cacheMap, 0, cacheHierarchyDepth, maskLength - cacheHierarchyDepth);
21286
+ this._cacheHierarchyDepth = maskLength;
21285
21287
  }
21286
21288
  var mask = macros._mask;
21287
21289
  var endIndex = macros._length - 1;
21288
- var maxEndIndex = this._cacheHierarchy - 1;
21290
+ var maxEndIndex = this._cacheHierarchyDepth - 1;
21289
21291
  for(var i = 0; i < maxEndIndex; i++){
21290
21292
  var subMask = endIndex < i ? 0 : mask[i];
21291
21293
  var subCacheShaders = cacheMap[subMask];
@@ -21310,25 +21312,21 @@
21310
21312
  */ _proto.cache = function cache(shaderProgram) {
21311
21313
  this._lastQueryMap[this._lastQueryKey] = shaderProgram;
21312
21314
  };
21313
- _proto._resizeCacheMapHierarchy = function _resizeCacheMapHierarchy(cacheMap, hierarchy, resizeLength) {
21314
- // only expand but not shrink.
21315
- var end = this._cacheHierarchy - 1;
21316
- if (hierarchy == end) {
21315
+ _proto._resizeCacheMapHierarchy = function _resizeCacheMapHierarchy(cacheMap, hierarchy, currentHierarchy, increaseHierarchy) {
21316
+ // Only expand but not shrink
21317
+ if (hierarchy == currentHierarchy - 1) {
21317
21318
  for(var k in cacheMap){
21318
21319
  var shader = cacheMap[k];
21319
21320
  var subCacheMap = cacheMap;
21320
- for(var i = 0, n = resizeLength - end; i < n; i++){
21321
- if (i == n - 1) {
21322
- subCacheMap[0] = shader;
21323
- } else {
21324
- subCacheMap = subCacheMap[i == 0 ? k : 0] = Object.create(null);
21325
- }
21321
+ for(var i = 0; i < increaseHierarchy; i++){
21322
+ subCacheMap[i == 0 ? k : 0] = subCacheMap = Object.create(null);
21326
21323
  }
21324
+ subCacheMap[0] = shader;
21327
21325
  }
21328
- this._cacheHierarchy = resizeLength;
21329
21326
  } else {
21327
+ hierarchy++;
21330
21328
  for(var k1 in cacheMap){
21331
- this._resizeCacheMapHierarchy(cacheMap[k1], ++hierarchy, resizeLength);
21329
+ this._resizeCacheMapHierarchy(cacheMap[k1], hierarchy, currentHierarchy, increaseHierarchy);
21332
21330
  }
21333
21331
  }
21334
21332
  };
@@ -43296,7 +43294,7 @@
43296
43294
  ], GALACEAN_animation_event);
43297
43295
 
43298
43296
  //@ts-ignore
43299
- var version = "1.1.0-beta.11";
43297
+ var version = "1.1.0-beta.12";
43300
43298
  console.log("Galacean engine version: " + version);
43301
43299
  for(var key in CoreObjects){
43302
43300
  Loader.registerClass(key, CoreObjects[key]);