@@ -1260,7 +1260,8 @@ function getPipelineToRenderTextureToRGB8UnormTexture(
12601260 }
12611261
12621262 const { pipelineByPipelineType } = s_deviceToResourcesMap . get ( device ) ! ;
1263- const pipelineType : PipelineType = isCompatibility && texture . depthOrArrayLayers > 1 ? '2d-array' : '2d' ;
1263+ const pipelineType : PipelineType =
1264+ isCompatibility && texture . depthOrArrayLayers > 1 ? '2d-array' : '2d' ;
12641265 if ( ! pipelineByPipelineType . get ( pipelineType ) ) {
12651266 const [ textureType , layerCode ] =
12661267 pipelineType === '2d' ? [ 'texture_2d' , '' ] : [ 'texture_2d_array' , ', uni.baseArrayLayer' ] ;
@@ -1488,24 +1489,25 @@ export function TextureTestMixin<F extends FixtureClass<GPUTest>>(
14881489 usage : GPUBufferUsage . UNIFORM | GPUBufferUsage . COPY_DST ,
14891490 } ) ;
14901491 this . trackForCleanup ( uniformBuffer ) ;
1491- const uniformData = new Uint32Array ( 1 ) ;
14921492
14931493 for ( let layer = 0 ; layer < numLayers ; ++ layer ) {
1494+ const viewDescriptor : GPUTextureViewDescriptor = {
1495+ baseMipLevel : mipLevel ,
1496+ mipLevelCount : 1 ,
1497+ ...( ! this . isCompatibility && {
1498+ baseArrayLayer : layer ,
1499+ arrayLayerCount : 1 ,
1500+ } ) ,
1501+ dimension : pipelineType ,
1502+ } ;
1503+
14941504 const bindGroup = this . device . createBindGroup ( {
14951505 layout : pipeline . getBindGroupLayout ( 0 ) ,
14961506 entries : [
14971507 { binding : 0 , resource : sampler } ,
14981508 {
14991509 binding : 1 ,
1500- resource : texture . createView ( {
1501- baseMipLevel : mipLevel ,
1502- mipLevelCount : 1 ,
1503- ...( ! this . isCompatibility && {
1504- baseArrayLayer : layer ,
1505- arrayLayerCount : 1 ,
1506- } ) ,
1507- dimension : pipelineType ,
1508- } ) ,
1510+ resource : texture . createView ( viewDescriptor ) ,
15091511 } ,
15101512 ...( pipelineType === '2d-array'
15111513 ? [
@@ -1518,8 +1520,7 @@ export function TextureTestMixin<F extends FixtureClass<GPUTest>>(
15181520 ] ,
15191521 } ) ;
15201522
1521- uniformData [ 0 ] = layer ;
1522- this . device . queue . writeBuffer ( uniformBuffer , 0 , uniformData ) ;
1523+ this . device . queue . writeBuffer ( uniformBuffer , 0 , new Uint32Array ( [ layer ] ) ) ;
15231524
15241525 const encoder = this . device . createCommandEncoder ( ) ;
15251526 const pass = encoder . beginRenderPass ( {
0 commit comments