diff --git a/src/webgpu/compat/api/validation/createBindGroup.spec.ts b/src/webgpu/compat/api/validation/createBindGroup.spec.ts index c27d8091f0ab..b48fa804226b 100644 --- a/src/webgpu/compat/api/validation/createBindGroup.spec.ts +++ b/src/webgpu/compat/api/validation/createBindGroup.spec.ts @@ -68,6 +68,8 @@ function isValidViewDimensionForDepthOrArrayLayers( depthOrArrayLayers: number ) { switch (viewDimension) { + case '2d': + return depthOrArrayLayers === 1; case 'cube': return depthOrArrayLayers === 6; case 'cube-array': diff --git a/src/webgpu/compat/api/validation/texture/createTexture.spec.ts b/src/webgpu/compat/api/validation/texture/createTexture.spec.ts index 974f10082e7f..a5c16a6f8425 100644 --- a/src/webgpu/compat/api/validation/texture/createTexture.spec.ts +++ b/src/webgpu/compat/api/validation/texture/createTexture.spec.ts @@ -55,12 +55,13 @@ g.test('invalidTextureBindingViewDimension') ) .fn(t => { const { dimension, textureBindingViewDimension } = t.params; + const depthOrArrayLayers = textureBindingViewDimension === '1d' || textureBindingViewDimension === '2d' ? 1 : 6; const shouldError = getTextureDimensionFromView(textureBindingViewDimension) !== dimension; t.expectGPUError( 'validation', () => { const texture = t.device.createTexture({ - size: [1, 1, dimension === '1d' ? 1 : 6], + size: [1, 1, depthOrArrayLayers], format: 'rgba8unorm', usage: GPUTextureUsage.TEXTURE_BINDING, dimension,