diff --git a/src/webgpu/listing_meta.json b/src/webgpu/listing_meta.json index 4497993899e1..1f8f74330495 100644 --- a/src/webgpu/listing_meta.json +++ b/src/webgpu/listing_meta.json @@ -2001,6 +2001,7 @@ "webgpu:shader,validation,shader_io,size:size:*": { "subcaseMS": 1.218 }, "webgpu:shader,validation,shader_io,size:size_fp16:*": { "subcaseMS": 1.500 }, "webgpu:shader,validation,shader_io,size:size_non_struct:*": { "subcaseMS": 0.929 }, + "webgpu:shader,validation,shader_io,size:size_creation_fixed_footprint:*": { "subcaseMS": 1.000 }, "webgpu:shader,validation,shader_io,workgroup_size:workgroup_size:*": { "subcaseMS": 1.227 }, "webgpu:shader,validation,shader_io,workgroup_size:workgroup_size_const:*": { "subcaseMS": 3.400 }, "webgpu:shader,validation,shader_io,workgroup_size:workgroup_size_fp16:*": { "subcaseMS": 0.700 }, diff --git a/src/webgpu/shader/validation/shader_io/size.spec.ts b/src/webgpu/shader/validation/shader_io/size.spec.ts index f81dde4a1d63..564c3f2b7ceb 100644 --- a/src/webgpu/shader/validation/shader_io/size.spec.ts +++ b/src/webgpu/shader/validation/shader_io/size.spec.ts @@ -103,7 +103,7 @@ const kSizeTests = { }; g.test('size') - .desc(`Test validation of ize`) + .desc(`Test validation of size`) .params(u => u.combine('attr', keysOf(kSizeTests))) .fn(t => { const code = ` @@ -210,3 +210,21 @@ g.test('size_non_struct') t.expectCompileResult(data.pass, code); }); + +g.test('size_creation_fixed_footprint') + .desc(`Test that @size is only valid on types that have creation-fixed footprint.`) + .params(u => u.combine('array_size', [', 4', ''])) + .fn(t => { + const code = ` +struct S { + @size(64) a: array, +}; +@group(0) @binding(0) +var a: S; + +@workgroup_size(1) +@compute fn main() { + _ = a.a[0]; +}`; + t.expectCompileResult(t.params.array_size !== '', code); + });