Skip to content

Commit

Permalink
Compat: fix createBindGroup validation test for compat
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
greggman committed Nov 11, 2023
1 parent 8406040 commit 7ca54d7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/webgpu/api/validation/createBindGroup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit 7ca54d7

Please sign in to comment.