@@ -60,9 +60,12 @@ class F extends AllFeaturesMaxLimitsGPUTest {
6060
6161 getColorAttachment (
6262 texture : GPUTexture ,
63- textureViewDescriptor ?: GPUTextureViewDescriptor
63+ options : {
64+ textureViewDescriptor ?: GPUTextureViewDescriptor ;
65+ bindTextureResource ?: boolean ;
66+ } = { }
6467 ) : GPURenderPassColorAttachment {
65- const { bindTextureResource = false } = this . params as { bindTextureResource ?: boolean } ;
68+ const { textureViewDescriptor , bindTextureResource = false } = options ;
6669 const view = bindTextureResource ? texture : texture . createView ( textureViewDescriptor ) ;
6770
6871 return {
@@ -75,9 +78,12 @@ class F extends AllFeaturesMaxLimitsGPUTest {
7578
7679 getDepthStencilAttachment (
7780 texture : GPUTexture ,
78- textureViewDescriptor ?: GPUTextureViewDescriptor
81+ options : {
82+ textureViewDescriptor ?: GPUTextureViewDescriptor ;
83+ bindTextureResource ?: boolean ;
84+ } = { }
7985 ) : GPURenderPassDepthStencilAttachment {
80- const { bindTextureResource = false } = this . params as { bindTextureResource ?: boolean } ;
86+ const { textureViewDescriptor , bindTextureResource = false } = options ;
8187 const view = bindTextureResource ? texture : texture . createView ( textureViewDescriptor ) ;
8288
8389 return {
@@ -354,14 +360,14 @@ g.test('color_attachments,depthSlice,bound_check')
354360 mipLevelCount : mipLevel + 1 ,
355361 } ) ;
356362
357- const viewDescriptor : GPUTextureViewDescriptor = {
363+ const textureViewDescriptor : GPUTextureViewDescriptor = {
358364 baseMipLevel : mipLevel ,
359365 mipLevelCount : 1 ,
360366 baseArrayLayer : 0 ,
361367 arrayLayerCount : 1 ,
362368 } ;
363369
364- const colorAttachment = t . getColorAttachment ( texture , viewDescriptor ) ;
370+ const colorAttachment = t . getColorAttachment ( texture , { textureViewDescriptor } ) ;
365371 colorAttachment . depthSlice = depthSlice ;
366372
367373 const passDescriptor : GPURenderPassDescriptor = {
@@ -446,7 +452,7 @@ g.test('color_attachments,depthSlice,overlaps,diff_miplevel')
446452 } ;
447453 const texture = t . createTestTexture ( texDescriptor ) ;
448454
449- const viewDescriptor : GPUTextureViewDescriptor = {
455+ const textureViewDescriptor : GPUTextureViewDescriptor = {
450456 baseMipLevel : 0 ,
451457 mipLevelCount : 1 ,
452458 baseArrayLayer : 0 ,
@@ -456,9 +462,9 @@ g.test('color_attachments,depthSlice,overlaps,diff_miplevel')
456462 const colorAttachments = [ ] ;
457463 for ( let i = 0 ; i < mipLevelCount ; i ++ ) {
458464 if ( ! sameMipLevel ) {
459- viewDescriptor . baseMipLevel = i ;
465+ textureViewDescriptor . baseMipLevel = i ;
460466 }
461- const colorAttachment = t . getColorAttachment ( texture , viewDescriptor ) ;
467+ const colorAttachment = t . getColorAttachment ( texture , { textureViewDescriptor } ) ;
462468 colorAttachment . depthSlice = 0 ;
463469 colorAttachments . push ( colorAttachment ) ;
464470 }
@@ -609,7 +615,7 @@ g.test('attachments,layer_count')
609615 } ;
610616
611617 const descriptor : GPURenderPassDescriptor = {
612- colorAttachments : [ t . getColorAttachment ( colorTexture , textureViewDescriptor ) ] ,
618+ colorAttachments : [ t . getColorAttachment ( colorTexture , { textureViewDescriptor } ) ] ,
613619 } ;
614620
615621 t . tryRenderPass ( _success , descriptor ) ;
@@ -623,10 +629,9 @@ g.test('attachments,layer_count')
623629
624630 const descriptor : GPURenderPassDescriptor = {
625631 colorAttachments : [ ] ,
626- depthStencilAttachment : t . getDepthStencilAttachment (
627- depthStencilTexture ,
628- textureViewDescriptor
629- ) ,
632+ depthStencilAttachment : t . getDepthStencilAttachment ( depthStencilTexture , {
633+ textureViewDescriptor,
634+ } ) ,
630635 } ;
631636
632637 t . tryRenderPass ( _success , descriptor ) ;
@@ -686,7 +691,7 @@ g.test('attachments,mip_level_count')
686691 } ;
687692
688693 const descriptor : GPURenderPassDescriptor = {
689- colorAttachments : [ t . getColorAttachment ( colorTexture , textureViewDescriptor ) ] ,
694+ colorAttachments : [ t . getColorAttachment ( colorTexture , { textureViewDescriptor } ) ] ,
690695 } ;
691696
692697 t . tryRenderPass ( _success , descriptor ) ;
@@ -700,10 +705,9 @@ g.test('attachments,mip_level_count')
700705
701706 const descriptor : GPURenderPassDescriptor = {
702707 colorAttachments : [ ] ,
703- depthStencilAttachment : t . getDepthStencilAttachment (
704- depthStencilTexture ,
705- textureViewDescriptor
706- ) ,
708+ depthStencilAttachment : t . getDepthStencilAttachment ( depthStencilTexture , {
709+ textureViewDescriptor,
710+ } ) ,
707711 } ;
708712
709713 t . tryRenderPass ( _success , descriptor ) ;
0 commit comments