Skip to content

Commit e6a13d9

Browse files
Add operation tests for transient attachment usage
1 parent ceb8795 commit e6a13d9

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/webgpu/api/operation/command_buffer/copyTextureToTexture.spec.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,10 +1528,13 @@ g.test('copy_multisampled_depth')
15281528
`
15291529
)
15301530
.params(u =>
1531-
u.combine('format', kDepthStencilFormats).filter(t => isDepthTextureFormat(t.format))
1531+
u
1532+
.combine('format', kDepthStencilFormats)
1533+
.combine('transientAttachment', [false, true])
1534+
.filter(t => isDepthTextureFormat(t.format))
15321535
)
15331536
.fn(t => {
1534-
const { format } = t.params;
1537+
const { format, transientAttachment } = t.params;
15351538

15361539
t.skipIf(t.isCompatibility, 'multisample textures are not copyable in compatibility mode');
15371540
t.skipIfTextureFormatNotSupported(format);
@@ -1645,7 +1648,9 @@ g.test('copy_multisampled_depth')
16451648
const multisampledColorTexture = t.createTextureTracked({
16461649
format: kColorFormat,
16471650
size: textureSize,
1648-
usage: GPUTextureUsage.COPY_SRC | GPUTextureUsage.RENDER_ATTACHMENT,
1651+
usage: transientAttachment
1652+
? GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TRANSIENT_ATTACHMENT
1653+
: GPUTextureUsage.RENDER_ATTACHMENT,
16491654
sampleCount: kSampleCount,
16501655
});
16511656
const colorTextureAsResolveTarget = t.createTextureTracked({

src/webgpu/api/operation/render_pass/resolve.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ Test basic render pass resolve behavior for combinations of:
3939
u
4040
.combine('separateResolvePass', [false, true])
4141
.combine('storeOperation', ['discard', 'store'] as const)
42+
.combine('transientAttachment', [false, true])
43+
// Exclude if transient AND (separate pass OR storing)
44+
.unless(t => t.transientAttachment && (t.separateResolvePass || t.storeOperation === 'store'))
4245
.beginSubcases()
4346
.combine('numColorAttachments', [2, 4] as const)
4447
.combine('slotsToResolve', kSlotsToResolve)
@@ -114,8 +117,9 @@ Test basic render pass resolve behavior for combinations of:
114117
size: [kSize, kSize, 1],
115118
sampleCount: 4,
116119
mipLevelCount: 1,
117-
usage:
118-
GPUTextureUsage.COPY_DST | GPUTextureUsage.COPY_SRC | GPUTextureUsage.RENDER_ATTACHMENT,
120+
usage: t.params.transientAttachment
121+
? GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TRANSIENT_ATTACHMENT
122+
: GPUTextureUsage.RENDER_ATTACHMENT,
119123
})
120124
.createView();
121125

0 commit comments

Comments
 (0)