Skip to content

Commit 1fc47d7

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

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,10 @@ 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 => {
15341537
const { format } = t.params;
@@ -1645,7 +1648,7 @@ 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: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TRANSIENT_ATTACHMENT,
16491652
sampleCount: kSampleCount,
16501653
});
16511654
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)