diff --git a/src/webgpu/compat/api/validation/encoding/cmds/copyTextureToTexture.spec.ts b/src/webgpu/compat/api/validation/encoding/cmds/copyTextureToTexture.spec.ts index ed15d2fad985..cd551f9b63a4 100644 --- a/src/webgpu/compat/api/validation/encoding/cmds/copyTextureToTexture.spec.ts +++ b/src/webgpu/compat/api/validation/encoding/cmds/copyTextureToTexture.spec.ts @@ -3,15 +3,17 @@ Tests limitations of copyTextureToTextures in compat mode. `; import { makeTestGroup } from '../../../../../../common/framework/test_group.js'; -import { kCompressedTextureFormats, kTextureFormatInfo } from '../../../../../format_info.js'; +import { + kAllTextureFormats, + kCompressedTextureFormats, + kTextureFormatInfo, +} from '../../../../../format_info.js'; import { CompatibilityTest } from '../../../../compatibility_test.js'; export const g = makeTestGroup(CompatibilityTest); g.test('compressed') - .desc( - `Tests that you can not call copyTextureToTextures with compressed textures in compat mode.` - ) + .desc(`Tests that you can not call copyTextureToTexture with compressed textures in compat mode.`) .params(u => u.combine('format', kCompressedTextureFormats)) .beforeAllSubcases(t => { const { format } = t.params; @@ -46,3 +48,47 @@ g.test('compressed') encoder.finish(); }); }); + +g.test('multisample') + .desc(`Test that you can not call copyTextureToTexture with multisample textures in compat mode.`) + .params(u => + u + .beginSubcases() + .combine('format', kAllTextureFormats) + .filter(({ format }) => { + const info = kTextureFormatInfo[format]; + return info.multisample && !info.feature; + }) + ) + .fn(t => { + const { format } = t.params; + const { blockWidth, blockHeight } = kTextureFormatInfo[format]; + + t.skipIfTextureFormatNotSupported(format as GPUTextureFormat); + + const srcTexture = t.device.createTexture({ + size: [blockWidth, blockHeight, 1], + format, + sampleCount: 4, + usage: GPUTextureUsage.COPY_SRC | GPUTextureUsage.RENDER_ATTACHMENT, + }); + t.trackForCleanup(srcTexture); + + const dstTexture = t.device.createTexture({ + size: [blockWidth, blockHeight, 1], + format, + sampleCount: 4, + usage: GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT, + }); + t.trackForCleanup(dstTexture); + + const encoder = t.device.createCommandEncoder(); + encoder.copyTextureToTexture({ texture: srcTexture }, { texture: dstTexture }, [ + blockWidth, + blockHeight, + 1, + ]); + t.expectGPUError('validation', () => { + encoder.finish(); + }); + }); diff --git a/src/webgpu/listing_meta.json b/src/webgpu/listing_meta.json index 7890d0c7fe37..4357795529c6 100644 --- a/src/webgpu/listing_meta.json +++ b/src/webgpu/listing_meta.json @@ -845,6 +845,7 @@ "webgpu:compat,api,validation,createBindGroupLayout:unsupportedStorageTextureFormats:*": { "subcaseMS": 0.601 }, "webgpu:compat,api,validation,encoding,cmds,copyTextureToBuffer:compressed:*": { "subcaseMS": 202.929 }, "webgpu:compat,api,validation,encoding,cmds,copyTextureToTexture:compressed:*": { "subcaseMS": 0.600 }, + "webgpu:compat,api,validation,encoding,cmds,copyTextureToTexture:multisample:*": { "subcaseMS": 0.600 }, "webgpu:compat,api,validation,encoding,programmable,pipeline_bind_group_compat:twoDifferentTextureViews,compute_pass,unused:*": { "subcaseMS": 1.501 }, "webgpu:compat,api,validation,encoding,programmable,pipeline_bind_group_compat:twoDifferentTextureViews,compute_pass,used:*": { "subcaseMS": 49.405 }, "webgpu:compat,api,validation,encoding,programmable,pipeline_bind_group_compat:twoDifferentTextureViews,render_pass,unused:*": { "subcaseMS": 16.002 },