summaryrefslogtreecommitdiffstats
path: root/dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/shader_io/size.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/shader_io/size.spec.ts')
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/shader_io/size.spec.ts20
1 files changed, 19 insertions, 1 deletions
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/shader_io/size.spec.ts b/dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/shader_io/size.spec.ts
index f81dde4a1d..564c3f2b7c 100644
--- a/dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/shader_io/size.spec.ts
+++ b/dom/webgpu/tests/cts/checkout/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<f32${t.params.array_size}>,
+};
+@group(0) @binding(0)
+var<storage> a: S;
+
+@workgroup_size(1)
+@compute fn main() {
+ _ = a.a[0];
+}`;
+ t.expectCompileResult(t.params.array_size !== '', code);
+ });