@@ -9,6 +9,7 @@ import { CubeUVReflectionMapping, EquirectangularReflectionMapping, Equirectangu
9
9
import { hashArray } from '../../../nodes/core/NodeUtils.js' ;
10
10
11
11
const _outputNodeMap = new WeakMap ( ) ;
12
+ const _chainKeys = [ ] ;
12
13
13
14
/**
14
15
* This renderer module manages node-related objects and is the
@@ -136,10 +137,13 @@ class Nodes extends DataMap {
136
137
137
138
// other groups are updated just when groupNode.needsUpdate is true
138
139
139
- const groupChain = [ groupNode , nodeUniformsGroup ] ;
140
+ _chainKeys [ 0 ] = groupNode ;
141
+ _chainKeys [ 1 ] = nodeUniformsGroup ;
140
142
141
- let groupData = this . groupsData . get ( groupChain ) ;
142
- if ( groupData === undefined ) this . groupsData . set ( groupChain , groupData = { } ) ;
143
+ let groupData = this . groupsData . get ( _chainKeys ) ;
144
+ if ( groupData === undefined ) this . groupsData . set ( _chainKeys , groupData = { } ) ;
145
+
146
+ _chainKeys . length = 0 ;
143
147
144
148
if ( groupData . version !== groupNode . version ) {
145
149
@@ -382,10 +386,12 @@ class Nodes extends DataMap {
382
386
*/
383
387
getCacheKey ( scene , lightsNode ) {
384
388
385
- const chain = [ scene , lightsNode ] ;
389
+ _chainKeys [ 0 ] = scene ;
390
+ _chainKeys [ 1 ] = lightsNode ;
391
+
386
392
const callId = this . renderer . info . calls ;
387
393
388
- let cacheKeyData = this . callHashCache . get ( chain ) ;
394
+ let cacheKeyData = this . callHashCache . get ( _chainKeys ) ;
389
395
390
396
if ( cacheKeyData === undefined || cacheKeyData . callId !== callId ) {
391
397
@@ -405,10 +411,12 @@ class Nodes extends DataMap {
405
411
cacheKey : hashArray ( values )
406
412
} ;
407
413
408
- this . callHashCache . set ( chain , cacheKeyData ) ;
414
+ this . callHashCache . set ( _chainKeys , cacheKeyData ) ;
409
415
410
416
}
411
417
418
+ _chainKeys . length = 0 ;
419
+
412
420
return cacheKeyData . cacheKey ;
413
421
414
422
}
0 commit comments