@@ -9,6 +9,7 @@ import { CubeUVReflectionMapping, EquirectangularReflectionMapping, Equirectangu
99import { hashArray } from '../../../nodes/core/NodeUtils.js' ;
1010
1111const _outputNodeMap = new WeakMap ( ) ;
12+ const _chainKeys = [ ] ;
1213
1314/**
1415 * This renderer module manages node-related objects and is the
@@ -136,10 +137,13 @@ class Nodes extends DataMap {
136137
137138 // other groups are updated just when groupNode.needsUpdate is true
138139
139- const groupChain = [ groupNode , nodeUniformsGroup ] ;
140+ _chainKeys [ 0 ] = groupNode ;
141+ _chainKeys [ 1 ] = nodeUniformsGroup ;
140142
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 ;
143147
144148 if ( groupData . version !== groupNode . version ) {
145149
@@ -382,10 +386,12 @@ class Nodes extends DataMap {
382386 */
383387 getCacheKey ( scene , lightsNode ) {
384388
385- const chain = [ scene , lightsNode ] ;
389+ _chainKeys [ 0 ] = scene ;
390+ _chainKeys [ 1 ] = lightsNode ;
391+
386392 const callId = this . renderer . info . calls ;
387393
388- let cacheKeyData = this . callHashCache . get ( chain ) ;
394+ let cacheKeyData = this . callHashCache . get ( _chainKeys ) ;
389395
390396 if ( cacheKeyData === undefined || cacheKeyData . callId !== callId ) {
391397
@@ -405,10 +411,12 @@ class Nodes extends DataMap {
405411 cacheKey : hashArray ( values )
406412 } ;
407413
408- this . callHashCache . set ( chain , cacheKeyData ) ;
414+ this . callHashCache . set ( _chainKeys , cacheKeyData ) ;
409415
410416 }
411417
418+ _chainKeys . length = 0 ;
419+
412420 return cacheKeyData . cacheKey ;
413421
414422 }
0 commit comments