@@ -1297,7 +1297,7 @@ class WebGPUBackend extends Backend {
12971297
12981298 }
12991299
1300- // compute
1300+
13011301
13021302 /**
13031303 * This method is executed at the beginning of a compute call and
@@ -1309,17 +1309,39 @@ class WebGPUBackend extends Backend {
13091309
13101310 const groupGPU = this . get ( computeGroup ) ;
13111311
1312- //
1312+ if ( groupGPU . computePassDescriptor === undefined ) {
13131313
1314- const descriptor = {
1315- label : 'computeGroup_' + computeGroup . id
1316- } ;
1314+ let computePassLabel = 'computeGroup[' ;
1315+
1316+ if ( Array . isArray ( computeGroup ) ) {
1317+
1318+ for ( let i = 0 ; i < computeGroup . length ; i ++ ) {
1319+
1320+ const group = computeGroup [ i ] ;
1321+ computePassLabel += `${ group . name } _${ group . id } ${ i !== computeGroup . length - 1 ? ',' : '' } ` ;
1322+
1323+ }
1324+
1325+ } else {
1326+
1327+ computePassLabel += `${ computeGroup . name } _${ computeGroup . id } ` ;
1328+
1329+ }
1330+
1331+ computePassLabel += ']' ;
1332+
1333+ const descriptor = { label : computePassLabel } ;
1334+
1335+ groupGPU . computePassDescriptor = descriptor ;
1336+
1337+ }
1338+ //
13171339
1318- this . initTimestampQuery ( TimestampQuery . COMPUTE , this . getTimestampUID ( computeGroup ) , descriptor ) ;
1340+ this . initTimestampQuery ( TimestampQuery . COMPUTE , this . getTimestampUID ( computeGroup ) , groupGPU . computePassDescriptor ) ;
13191341
1320- groupGPU . cmdEncoderGPU = this . device . createCommandEncoder ( { label : 'computeGroup_' + computeGroup . id } ) ;
1342+ groupGPU . cmdEncoderGPU = this . device . createCommandEncoder ( groupGPU . computePassDescriptor ) ;
13211343
1322- groupGPU . passEncoderGPU = groupGPU . cmdEncoderGPU . beginComputePass ( descriptor ) ;
1344+ groupGPU . passEncoderGPU = groupGPU . cmdEncoderGPU . beginComputePass ( groupGPU . computePassDescriptor ) ;
13231345
13241346 }
13251347
0 commit comments