diff --git a/src/webgpu/listing_meta.json b/src/webgpu/listing_meta.json index cd81244e41e0..fad278b7753c 100644 --- a/src/webgpu/listing_meta.json +++ b/src/webgpu/listing_meta.json @@ -1861,7 +1861,7 @@ "webgpu:shader,validation,expression,call,builtin,ceil:integer_argument:*": { "subcaseMS": 1.456 }, "webgpu:shader,validation,expression,call,builtin,ceil:values:*": { "subcaseMS": 1.539 }, "webgpu:shader,validation,expression,call,builtin,clamp:values:*": { "subcaseMS": 0.377 }, - "webgpu:shader,validation,expression,call,builtin,cos:bad_args:*": { "subcaseMS": 2.868 }, + "webgpu:shader,validation,expression,call,builtin,cos:args:*": { "subcaseMS": 4.445 }, "webgpu:shader,validation,expression,call,builtin,cos:integer_argument:*": { "subcaseMS": 1.601 }, "webgpu:shader,validation,expression,call,builtin,cos:must_use:*": { "subcaseMS": 0.526 }, "webgpu:shader,validation,expression,call,builtin,cos:values:*": { "subcaseMS": 0.338 }, @@ -1924,7 +1924,7 @@ "webgpu:shader,validation,expression,call,builtin,saturate:values:*": { "subcaseMS": 0.317 }, "webgpu:shader,validation,expression,call,builtin,sign:unsigned_integer_argument:*": { "subcaseMS": 1.120 }, "webgpu:shader,validation,expression,call,builtin,sign:values:*": { "subcaseMS": 0.343 }, - "webgpu:shader,validation,expression,call,builtin,sin:bad_args:*": { "subcaseMS": 3.338 }, + "webgpu:shader,validation,expression,call,builtin,sin:args:*": { "subcaseMS": 4.443 }, "webgpu:shader,validation,expression,call,builtin,sin:integer_argument:*": { "subcaseMS": 1.189 }, "webgpu:shader,validation,expression,call,builtin,sin:must_use:*": { "subcaseMS": 0.588 }, "webgpu:shader,validation,expression,call,builtin,sin:values:*": { "subcaseMS": 0.349 }, diff --git a/src/webgpu/shader/validation/expression/call/builtin/cos.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/cos.spec.ts index 1cb618c3888b..361cb8ed9955 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/cos.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/cos.spec.ts @@ -80,26 +80,29 @@ Validates that scalar and vector integer arguments are rejected by ${builtin}() ); }); -const kGoodArgs = '(1.1)'; -const kBadArgs = { - no_parens: '', +const kArgCases = { + good: '(1.1)', + bad_no_parens: '', // Bad number of args - '0args': '()', - '2args': '(1.0,2.0)', - // Bad value for arg 0 - '0i32': '(1i)', - '0u32': '(1u)', - '0bool': '(false)', - '0vec2u': '(vec2u())', - '0array': '(array(1.1,2.2))', - '0struct': '(modf(2.2))', + bad_0args: '()', + bad_2args: '(1.0,2.0)', + // Bad value type for arg 0 + bad_0i32: '(1i)', + bad_0u32: '(1u)', + bad_0bool: '(false)', + bad_0vec2u: '(vec2u())', + bad_0array: '(array(1.1,2.2))', + bad_0struct: '(modf(2.2))', }; -g.test('bad_args') - .desc(`Test compilation failure of ${builtin} with bad arguments`) - .params(u => u.combine('arg', keysOf(kBadArgs))) +g.test('args') + .desc(`Test compilation failure of ${builtin} with variously shaped and typed arguments`) + .params(u => u.combine('arg', keysOf(kArgCases))) .fn(t => { - t.expectCompileResult(false, `const c = ${builtin}${kBadArgs[t.params.arg]};`); + t.expectCompileResult( + t.params.arg === 'good', + `const c = ${builtin}${kArgCases[t.params.arg]};` + ); }); g.test('must_use') @@ -107,5 +110,5 @@ g.test('must_use') .params(u => u.combine('use', [true, false])) .fn(t => { const use_it = t.params.use ? '_ = ' : ''; - t.expectCompileResult(t.params.use, `fn f() { ${use_it}${builtin}${kGoodArgs}; }`); + t.expectCompileResult(t.params.use, `fn f() { ${use_it}${builtin}${kArgCases['good']}; }`); }); diff --git a/src/webgpu/shader/validation/expression/call/builtin/sin.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/sin.spec.ts index 7885d2e9141c..6be01123cc94 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/sin.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/sin.spec.ts @@ -75,31 +75,35 @@ Validates that scalar and vector integer arguments are rejected by ${builtin}() t, builtin, /* expectedResult */ type === Type.f32, + [type.create(0)], 'constant' ); }); -const kGoodArgs = '(1.1)'; -const kBadArgs = { - no_parens: '', +const kArgCases = { + good: '(1.1)', + bad_no_parens: '', // Bad number of args - '0args': '()', - '2args': '(1.0,2.0)', - // Bad value for arg 0 - '0i32': '(1i)', - '0u32': '(1u)', - '0bool': '(false)', - '0vec2u': '(vec2u())', - '0array': '(array(1.1,2.2))', - '0struct': '(modf(2.2))', + bad_0args: '()', + bad_2args: '(1.0,2.0)', + // Bad value type for arg 0 + bad_0i32: '(1i)', + bad_0u32: '(1u)', + bad_0bool: '(false)', + bad_0vec2u: '(vec2u())', + bad_0array: '(array(1.1,2.2))', + bad_0struct: '(modf(2.2))', }; -g.test('bad_args') - .desc(`Test compilation failure of ${builtin} with bad arguments`) - .params(u => u.combine('arg', keysOf(kBadArgs))) +g.test('args') + .desc(`Test compilation failure of ${builtin} with variously shaped and typed arguments`) + .params(u => u.combine('arg', keysOf(kArgCases))) .fn(t => { - t.expectCompileResult(false, `const c = ${builtin}${kBadArgs[t.params.arg]};`); + t.expectCompileResult( + t.params.arg === 'good', + `const c = ${builtin}${kArgCases[t.params.arg]};` + ); }); g.test('must_use') @@ -107,5 +111,5 @@ g.test('must_use') .params(u => u.combine('use', [true, false])) .fn(t => { const use_it = t.params.use ? '_ = ' : ''; - t.expectCompileResult(t.params.use, `fn f() { ${use_it}${builtin}${kGoodArgs}; }`); + t.expectCompileResult(t.params.use, `fn f() { ${use_it}${builtin}${kArgCases['good']}; }`); });