From 7ca54d7b3387009ec5bd72f4b121db19ba1cefb6 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Fri, 10 Nov 2023 15:49:57 +0900 Subject: [PATCH] Compat: fix createBindGroup validation test for compat In compat certain textureBindingViewDimemsion must match the view dimension so skip tests when they don't Note: That these cases are correctly rejected is tested in the webgpu:compat,* tests. --- src/webgpu/api/validation/createBindGroup.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/webgpu/api/validation/createBindGroup.spec.ts b/src/webgpu/api/validation/createBindGroup.spec.ts index ddd0f8b39fd4..c1951348ce1d 100644 --- a/src/webgpu/api/validation/createBindGroup.spec.ts +++ b/src/webgpu/api/validation/createBindGroup.spec.ts @@ -313,6 +313,19 @@ g.test('texture_must_have_correct_dimension') }); t.skipIfTextureViewDimensionNotSupported(viewDimension, dimension); + if (t.isCompatibility && texture.dimension === '2d') { + if (depthOrArrayLayers === 1) { + t.skipIf( + viewDimension !== '2d', + '1 layer 2d textures default to textureBindingViewDimension: "2d" in compat mode' + ); + } else { + t.skipIf( + viewDimension !== '2d-array', + '> 1 layer 2d textures default to textureBindingViewDimension "2d-array" in compat mode' + ); + } + } const shouldError = viewDimension !== dimension; const textureView = texture.createView({ dimension });