Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ g.test('invalidTextureBindingViewDimension')
textureBindingViewDimension === '2d'
? 1
: 6;
const shouldError = getTextureDimensionFromView(textureBindingViewDimension) !== dimension;
const shouldError =
getTextureDimensionFromView(textureBindingViewDimension) !== dimension ||
textureBindingViewDimension === 'cube-array';
t.expectGPUErrorInCompatibilityMode(
'validation',
() => {
Expand Down
21 changes: 21 additions & 0 deletions src/webgpu/web_platform/canvas/getCurrentTexture.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,3 +433,24 @@ TODO: test more canvas types, and ways to update the rendering
break;
}
});

g.test('compatibility')
.desc(
`
Test that the texture returned from getCurrentTexture has textureBindingViewDimension
and that it's undefined in core and '2d' in compatibility mode.
`
)
.params(u =>
u //
.combine('canvasType', kAllCanvasTypes)
)
.fn(t => {
const { canvasType } = t.params;
const ctx = t.initCanvasContext(canvasType);
const texture = ctx.getCurrentTexture();
t.expect(() => 'textureBindingViewDimension' in texture);

const expected = t.isCompatibility ? '2d' : undefined;
t.expect(texture.textureBindingViewDimension === expected);
});