Skip to content

Commit 3f4bf23

Browse files
Fix nit
1 parent 7ddcf7a commit 3f4bf23

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

src/webgpu/api/validation/render_pass/render_pass_descriptor.spec.ts

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,13 @@ class F extends AllFeaturesMaxLimitsGPUTest {
6060

6161
getColorAttachment(
6262
texture: GPUTexture,
63-
textureViewDescriptor?: GPUTextureViewDescriptor
63+
options: {
64+
viewDescriptor?: GPUTextureViewDescriptor;
65+
bindTextureResource?: boolean;
66+
}
6467
): GPURenderPassColorAttachment {
65-
const { bindTextureResource = false } = this.params as { bindTextureResource?: boolean };
66-
const view = bindTextureResource ? texture : texture.createView(textureViewDescriptor);
68+
const { viewDescriptor, bindTextureResource = false } = options;
69+
const view = bindTextureResource ? texture : texture.createView(viewDescriptor);
6770

6871
return {
6972
view,
@@ -75,10 +78,13 @@ class F extends AllFeaturesMaxLimitsGPUTest {
7578

7679
getDepthStencilAttachment(
7780
texture: GPUTexture,
78-
textureViewDescriptor?: GPUTextureViewDescriptor
81+
options: {
82+
viewDescriptor?: GPUTextureViewDescriptor;
83+
bindTextureResource?: boolean;
84+
}
7985
): GPURenderPassDepthStencilAttachment {
80-
const { bindTextureResource = false } = this.params as { bindTextureResource?: boolean };
81-
const view = bindTextureResource ? texture : texture.createView(textureViewDescriptor);
86+
const { viewDescriptor, bindTextureResource = false } = options;
87+
const view = bindTextureResource ? texture : texture.createView(viewDescriptor);
8288

8389
return {
8490
view,
@@ -361,7 +367,7 @@ g.test('color_attachments,depthSlice,bound_check')
361367
arrayLayerCount: 1,
362368
};
363369

364-
const colorAttachment = t.getColorAttachment(texture, viewDescriptor);
370+
const colorAttachment = t.getColorAttachment(texture, { viewDescriptor });
365371
colorAttachment.depthSlice = depthSlice;
366372

367373
const passDescriptor: GPURenderPassDescriptor = {
@@ -458,7 +464,7 @@ g.test('color_attachments,depthSlice,overlaps,diff_miplevel')
458464
if (!sameMipLevel) {
459465
viewDescriptor.baseMipLevel = i;
460466
}
461-
const colorAttachment = t.getColorAttachment(texture, viewDescriptor);
467+
const colorAttachment = t.getColorAttachment(texture, { viewDescriptor });
462468
colorAttachment.depthSlice = 0;
463469
colorAttachments.push(colorAttachment);
464470
}
@@ -603,30 +609,29 @@ g.test('attachments,layer_count')
603609

604610
{
605611
// Check 2D array texture view for color
606-
const textureViewDescriptor: GPUTextureViewDescriptor = {
612+
const viewDescriptor: GPUTextureViewDescriptor = {
607613
...baseTextureViewDescriptor,
608614
format: COLOR_FORMAT,
609615
};
610616

611617
const descriptor: GPURenderPassDescriptor = {
612-
colorAttachments: [t.getColorAttachment(colorTexture, textureViewDescriptor)],
618+
colorAttachments: [t.getColorAttachment(colorTexture, { viewDescriptor })],
613619
};
614620

615621
t.tryRenderPass(_success, descriptor);
616622
}
617623
{
618624
// Check 2D array texture view for depth stencil
619-
const textureViewDescriptor: GPUTextureViewDescriptor = {
625+
const viewDescriptor: GPUTextureViewDescriptor = {
620626
...baseTextureViewDescriptor,
621627
format: DEPTH_STENCIL_FORMAT,
622628
};
623629

624630
const descriptor: GPURenderPassDescriptor = {
625631
colorAttachments: [],
626-
depthStencilAttachment: t.getDepthStencilAttachment(
627-
depthStencilTexture,
628-
textureViewDescriptor
629-
),
632+
depthStencilAttachment: t.getDepthStencilAttachment(depthStencilTexture, {
633+
viewDescriptor,
634+
}),
630635
};
631636

632637
t.tryRenderPass(_success, descriptor);
@@ -680,30 +685,29 @@ g.test('attachments,mip_level_count')
680685

681686
{
682687
// Check 2D texture view for color
683-
const textureViewDescriptor: GPUTextureViewDescriptor = {
688+
const viewDescriptor: GPUTextureViewDescriptor = {
684689
...baseTextureViewDescriptor,
685690
format: COLOR_FORMAT,
686691
};
687692

688693
const descriptor: GPURenderPassDescriptor = {
689-
colorAttachments: [t.getColorAttachment(colorTexture, textureViewDescriptor)],
694+
colorAttachments: [t.getColorAttachment(colorTexture, { viewDescriptor })],
690695
};
691696

692697
t.tryRenderPass(_success, descriptor);
693698
}
694699
{
695700
// Check 2D texture view for depth stencil
696-
const textureViewDescriptor: GPUTextureViewDescriptor = {
701+
const viewDescriptor: GPUTextureViewDescriptor = {
697702
...baseTextureViewDescriptor,
698703
format: DEPTH_STENCIL_FORMAT,
699704
};
700705

701706
const descriptor: GPURenderPassDescriptor = {
702707
colorAttachments: [],
703-
depthStencilAttachment: t.getDepthStencilAttachment(
704-
depthStencilTexture,
705-
textureViewDescriptor
706-
),
708+
depthStencilAttachment: t.getDepthStencilAttachment(depthStencilTexture, {
709+
viewDescriptor,
710+
}),
707711
};
708712

709713
t.tryRenderPass(_success, descriptor);

0 commit comments

Comments
 (0)