Skip to content

Commit

Permalink
Remove copyToTexture,CopyExternalImageToTexture:destination_texture,d…
Browse files Browse the repository at this point in the history
…imension:* (#1864)

This patch removes the validation test on the dimension of the destination
texture of CopyExternalImageToTexture() as now we only allow textures with
RENDER_ATTACHMENT usage to be the destination texture used in that API, while
in current SPEC only 2D textures are allowed to be created with RENDER_ATTACHMENT
usage.
  • Loading branch information
Jiawei-Shao authored Sep 26, 2022
1 parent deb4ba9 commit 409e987
Showing 1 changed file with 3 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
export const description = `
copyExternalImageToTexture Validation Tests in Queue.
Note that we don't need to add tests on the destination texture dimension as currently we require
the destination texture should have RENDER_ATTACHMENT usage, which is only allowed to be used on 2D
textures.
`;

import { getResourcePath } from '../../../../../common/framework/resources.js';
import { makeTestGroup } from '../../../../../common/framework/test_group.js';
import { raceWithRejectOnTimeout, unreachable, assert } from '../../../../../common/util/util.js';
import {
kTextureDimensions,
kTextureFormatInfo,
kTextureFormats,
kTextureUsages,
Expand Down Expand Up @@ -711,36 +713,6 @@ g.test('destination_texture,sample_count')
t.runTest({ source: imageBitmap }, { texture: dstTexture }, copySize, sampleCount === 1);
});

g.test('destination_texture,dimension')
.desc(
`
Test dst texture dimension.
Check that an error is generated when dimension is not 2d.
`
)
.params(u =>
u //
.combine('dimension', kTextureDimensions)
.beginSubcases()
.combine('copySize', [
{ width: 0, height: 0, depthOrArrayLayers: 0 },
{ width: 1, height: 1, depthOrArrayLayers: 1 },
])
)
.fn(async t => {
const { dimension, copySize } = t.params;
const imageBitmap = await t.createImageBitmap(t.getImageData(1, 1));
const dstTexture = t.device.createTexture({
size: { width: 1, height: 1, depthOrArrayLayers: 1 },
dimension,
format: 'bgra8unorm',
usage: GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT,
});

t.runTest({ source: imageBitmap }, { texture: dstTexture }, copySize, dimension === '2d');
});

g.test('destination_texture,mipLevel')
.desc(
`
Expand Down

0 comments on commit 409e987

Please sign in to comment.