diff --git a/src/webgpu/compat/api/validation/encoding/cmds/copyTextureToTexture.spec.ts b/src/webgpu/compat/api/validation/encoding/cmds/copyTextureToTexture.spec.ts new file mode 100644 index 000000000000..561f4e83ca64 --- /dev/null +++ b/src/webgpu/compat/api/validation/encoding/cmds/copyTextureToTexture.spec.ts @@ -0,0 +1,48 @@ +export const description = ` +Tests limitations of copyTextureToTextures in compat mode. +`; + +import { makeTestGroup } from '../../../../../../common/framework/test_group.js'; +import { 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.` + ) + .params(u => u.combine('format', kCompressedTextureFormats)) + .beforeAllSubcases(t => { + const { format } = t.params; + t.selectDeviceOrSkipTestCase([kTextureFormatInfo[format].feature]); + }) + .fn(t => { + const { format } = t.params; + + const { blockWidth, blockHeight } = kTextureFormatInfo[format]; + + const srcTexture = t.device.createTexture({ + size: [blockWidth, blockHeight, 1], + format, + usage: GPUTextureUsage.COPY_SRC, + }); + t.trackForCleanup(srcTexture); + + const dstTexture = t.device.createTexture({ + size: [blockWidth, blockHeight, 1], + format, + usage: GPUTextureUsage.COPY_SRC, + }); + 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 c8396bab2ffc..5a1060805a06 100644 --- a/src/webgpu/listing_meta.json +++ b/src/webgpu/listing_meta.json @@ -830,6 +830,7 @@ "webgpu:api,validation,texture,rg11b10ufloat_renderable:create_texture:*": { "subcaseMS": 12.700 }, "webgpu:compat,api,validation,createBindGroup:viewDimension_matches_textureBindingViewDimension:*": { "subcaseMS": 6.523 }, "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,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 },