Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update wgpu and WebGPU CTS to include copy validation tests #27590

Merged
merged 3 commits into from Aug 16, 2020
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

update cts to include copy validation

  • Loading branch information
kunalmohan committed Aug 16, 2020
commit 44173014e0cd397089c7a48c2bb626dafb05dd93
@@ -58,7 +58,7 @@
],
"gpu": {
"device_pool.js": [
"c6be73f9918be979816bf02978e8429ce8b4d63d",
"f72b6b734c671ff0316fadfec49e0a93bd16fd10",
[]
],
"implementation.js": [
@@ -102,7 +102,7 @@
[]
],
"json_param_value.js": [
"1bb32d06dfdf95be6953faac150b767585198cf7",
"921b3ddce6aacde8e3b05d4133dc07ffb90842f8",
[]
],
"parseQuery.js": [
@@ -161,7 +161,7 @@
]
},
"version.js": [
"4d5e72c0442fdbdd4d5ceeefa14dcbaafae4ffaa",
"794e3cdef44214801f15234a61aaf5af338f97fc",
[]
]
},
@@ -229,7 +229,7 @@
],
"render_pass": {
"storeOp.spec.js": [
"c02e99db655933431cf8f310c21eac4febaf380d",
"83ae8657c1c822b6cfc8f511089de88dfd2d8fdc",
[]
]
},
@@ -239,38 +239,56 @@
[]
],
"texture_zero_init_test.js": [
"e3c21011bb288492bd137be9e2e43b5efd02aa36",
"381d7dcb0a8e9574834629223308c7ef0e375b4b",
[]
]
}
},
"validation": {
"copyBufferToBuffer.spec.js": [
"5fd4877383a47b1e3ca27af8e0843781dbf5a443",
[]
],
"copy_between_linear_data_and_texture": {
"copyBetweenLinearDataAndTexture.js": [
"0db6e68d4af6e395ba07157fd4b1ed0c567fd182",
[]
],
"copyBetweenLinearDataAndTexture_dataRelated.spec.js": [
"be1395b664276f13a728a60acee835d96753e6e1",
[]
],
"copyBetweenLinearDataAndTexture_textureRelated.spec.js": [
"bef71943fae2bc6f0dcaa4ae53b744190ccdc00c",
[]
]
},
"createBindGroup.spec.js": [
"fa585038e39ff6208787ee89bc177bdb13cdc385",
[]
],
"createBindGroupLayout.spec.js": [
"9c0df538b278aaa38d11f3922b749799f72f4c3f",
"43fd923687b68d9214305b04ea1573e044245928",
[]
],
"createPipelineLayout.spec.js": [
"689ddaec883cd639f6cf94ab4d3005a4c4512db5",
[]
],
"createTexture.spec.js": [
"a9c7a8be01e03bcda1aa2f96374c30c0ce0bbe45",
"ceff54e136ff321bf22a8647790c3263404f6afc",
[]
],
"createView.spec.js": [
"d5b16563c13d9429bb1da58b9c5dd18279904f3d",
[]
],
"error_scope.spec.js": [
"5523237daeba5d0c1c292dd3da8dead86a99f8e4",
"64575540e8bde1545565389108067bf4b078cae9",
[]
],
"fences.spec.js": [
"cc04848410fed9f20b863aadbedf3482787b6de9",
"b50ebae572d9af8f4edd3f82c051877b6068374e",
[]
],
"queue_submit.spec.js": [
@@ -293,7 +311,7 @@
],
"resource_usages": {
"textureUsageInRender.spec.js": [
"6322ec25ee537584030c322ab99ec3d69e02b30e",
"12efa65ce2d9e9ed67cb2be398a0466424d38015",
[]
]
},
@@ -318,37 +336,37 @@
[]
],
"validation_test.js": [
"d816fd0594bd5097f4a7e3d2de91c3e0aa6e3f7b",
"c6cd14779bbb7b95e37bdb93d3f5be33902be6c2",
[]
]
}
},
"capability_info.js": [
"2e4264fe229c11bb387d300cebce6a4e69780cd1",
"10a8c5aa4b62c05830eabb33734d866939258ade",
[]
],
"examples.spec.js": [
"32825367009ab0c4427821a013e913480ba38863",
[]
],
"gpu_test.js": [
"92f0e41840bd8e74eda57bbeda60757af798e2f9",
"f350131af3babe9729dec35261f7c445e2bf41d2",
[]
],
"idl": {
"constants": {
"flags.spec.js": [
"1de75c84e5daeaafd3ac47b31b6011223b03e360",
"51b80aa8aa23cb987079f6dd228bb0bb68816624",
[]
]
},
"idl_test.js": [
"231fc0945f87fe6aede03ec7a03c1ecaf7fe04db",
"3943563d2ac2c779e6cfb0ab033b92bca24e5749",
[]
]
},
"listing.js": [
"8736de378a6a02235dfff5796f4fe4a963769001",
"3134cf0dd5693705ed82f0828f4dbd93fedf358e",
[]
],
"util": {
@@ -357,20 +375,20 @@
[]
],
"math.js": [
"a76f1a00158ab50df82c74187de859dfbef41d60",
"4761467b586691662834dd0fbf3e86643a5eb823",
[]
],
"texture": {
"layout.js": [
"26d82a7be0aea4483b4b72d6faa2b9233a5f0039",
"c3c610bf0d93ebe66abf81d8f2017deba62641a3",
[]
],
"subresource.js": [
"889fab16e61f6b811d7475a4b5eb7c56353a8a91",
[]
],
"texelData.js": [
"8a827c47d21e1c1a89e081b2e70d1759c9208b0e",
"eadaa09633022e6c82355b07a4798c802c56a8e8",
[]
]
}
@@ -383,7 +401,7 @@
]
},
"copyImageBitmapToTexture.spec.js": [
"1432ff05e1daa192d5898bf1c7f42e84008b23b4",
"9df5ff94419baa92ff27f8b39cdc0ee99439dc06",
[]
],
"reftests": {
@@ -396,7 +414,7 @@
[]
],
"gpu_ref_test.js": [
"dd58b543b01ec86c1a820d9d661a5c3f9b68b323",
"a45002835df48518eacb8d7887791ee200c3e3c1",
[]
],
"ref": {
@@ -417,7 +435,7 @@
"testharness": {
"webgpu": {
"cts.html": [
"e87ceb79a409fc3e3ddcccf38e48b865740e0809",
"28d69b38d20367b4c61e72e834f518a11e8de411",
[
"webgpu/cts.html?q=webgpu:api,operation,buffers,map_detach:*",
{}
@@ -446,6 +464,18 @@
"webgpu/cts.html?q=webgpu:api,operation,render_pass,storeOp:*",
{}
],
[
"webgpu/cts.html?q=webgpu:api,validation,copyBufferToBuffer:*",
{}
],
[
"webgpu/cts.html?q=webgpu:api,validation,copy_between_linear_data_and_texture,copyBetweenLinearDataAndTexture_dataRelated:*",
{}
],
[
"webgpu/cts.html?q=webgpu:api,validation,copy_between_linear_data_and_texture,copyBetweenLinearDataAndTexture_textureRelated:*",
{}
],
[
"webgpu/cts.html?q=webgpu:api,validation,createBindGroup:*",
{}
@@ -91,10 +91,13 @@ export class DevicePool {
static async makeHolder() {
const gpu = getGPU();
const adapter = await gpu.requestAdapter();
assert(adapter !== null);
const device = await adapter.requestDevice();
assert(device !== null);

const holder = {
acquired: false,
device: await adapter.requestDevice(),
device,
lostReason: undefined,
};

@@ -3,10 +3,11 @@
**/ import { assert } from '../util/util.js';
// JSON can't represent `undefined` and by default stores it as `null`.
// Instead, store `undefined` as this magic string value in JSON.
const jsUndefinedMagicValue = '✗undefined';
const jsUndefinedMagicValue = '_undef_';

export function stringifyParamValue(value) {
return JSON.stringify(value, (k, v) => {
// Make sure no one actually uses the magic value as a parameter.
assert(v !== jsUndefinedMagicValue);

return v === undefined ? jsUndefinedMagicValue : v;
@@ -1,3 +1,3 @@
// AUTO-GENERATED - DO NOT EDIT. See tools/gen_version.

export const version = 'a4499c8ced40640242a40448c4d4258e3fb830d3';
export const version = 'fa4873f0a303566ca6f34744a253d96f5e462d3d';
@@ -36,6 +36,9 @@
<meta name=variant content='?q=webgpu:api,operation,fences:*'>
<meta name=variant content='?q=webgpu:api,operation,render_pass,storeOp:*'>
<!--<meta name=variant content='?q=webgpu:api,operation,resource_init,copied_texture_clear:*'>-->
<meta name=variant content='?q=webgpu:api,validation,copyBufferToBuffer:*'>
<meta name=variant content='?q=webgpu:api,validation,copy_between_linear_data_and_texture,copyBetweenLinearDataAndTexture_dataRelated:*'>
<meta name=variant content='?q=webgpu:api,validation,copy_between_linear_data_and_texture,copyBetweenLinearDataAndTexture_textureRelated:*'>
<meta name=variant content='?q=webgpu:api,validation,createBindGroup:*'>
<!--<meta name=variant content='?q=webgpu:api,validation,createBindGroupLayout:*'>-->
<meta name=variant content='?q=webgpu:api,validation,createPipelineLayout:*'>
@@ -30,7 +30,11 @@
TODO: test with more interesting loadOp values`;
import { params, poptions } from '../../../../common/framework/params_builder.js';
import { makeTestGroup } from '../../../../common/framework/test_group.js';
import { kTextureFormatInfo, kTextureFormats } from '../../../capability_info.js';
import {
kEncodableTextureFormatInfo,
kEncodableTextureFormats,
kSizedDepthStencilFormats,
} from '../../../capability_info.js';
import { GPUTest } from '../../../gpu_test.js';

// Test with a zero and non-zero mip.
@@ -140,20 +144,16 @@ g.test('render_pass_store_op,color_attachment_with_depth_stencil_attachment')
g.test('render_pass_store_op,color_attachment_only')
.params(
params()
.combine(poptions('colorFormat', kTextureFormats))
// Filter out any depth/stencil or non-renderable formats
.filter(
({ colorFormat }) =>
kTextureFormatInfo[colorFormat].color && kTextureFormatInfo[colorFormat].renderable
)
.combine(poptions('colorFormat', kEncodableTextureFormats))
// Filter out any non-renderable formats
.filter(({ colorFormat }) => kEncodableTextureFormatInfo[colorFormat].renderable)
.combine(poptions('storeOperation', kStoreOps))
.combine(poptions('mipLevel', kMipLevel))
.combine(poptions('arrayLayer', kArrayLayers))
)
.fn(t => {
const kColorFormat = 'rgba8unorm';
const colorAttachment = t.device.createTexture({
format: kColorFormat,
format: t.params.colorFormat,
size: { width: kWidth, height: kHeight, depth: t.params.arrayLayer + 1 },
mipLevelCount: kMipLevelCount,
usage: GPUTextureUsage.COPY_SRC | GPUTextureUsage.OUTPUT_ATTACHMENT,
@@ -194,7 +194,7 @@ g.test('render_pass_store_op,color_attachment_only')
expectedValue = { R: 1.0, G: 0.0, B: 0.0, A: 1.0 };
}

t.expectSingleColor(colorAttachment, kColorFormat, {
t.expectSingleColor(colorAttachment, t.params.colorFormat, {
size: [kHeight, kWidth, 1],
slice: t.params.arrayLayer,
exp: expectedValue,
@@ -266,15 +266,8 @@ g.test('render_pass_store_op,multiple_color_attachments')
g.test('render_pass_store_op,depth_stencil_attachment_only')
.params(
params()
.combine(poptions('depthStencilFormat', kTextureFormats))
// Filter out color and non-renderable formats.
.filter(
({ depthStencilFormat }) =>
(kTextureFormatInfo[depthStencilFormat].depth ||
kTextureFormatInfo[depthStencilFormat].stencil) &&
kTextureFormatInfo[depthStencilFormat].renderable &&
kTextureFormatInfo[depthStencilFormat].copyable
)
// TODO: Also test unsized depth/stencil formats
.combine(poptions('depthStencilFormat', kSizedDepthStencilFormats))
.combine(poptions('storeOperation', kStoreOps))
.combine(poptions('mipLevel', kMipLevel))
.combine(poptions('arrayLayer', kArrayLayers))
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.