Skip to content

Commit

Permalink
shader/validation: Test function addrspace at module-scope (#3347)
Browse files Browse the repository at this point in the history
Issue #1570
  • Loading branch information
jrprice authored Jan 29, 2024
1 parent fe37e44 commit bc32dbc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/webgpu/listing_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -1730,6 +1730,7 @@
"webgpu:shader,validation,decl,ptr_spelling:ptr_not_instantiable:*": { "subcaseMS": 1.310 },
"webgpu:shader,validation,decl,var:module_scope_types:*": { "subcaseMS": 1.000 },
"webgpu:shader,validation,decl,var:function_scope_types:*": { "subcaseMS": 1.000 },
"webgpu:shader,validation,decl,var:function_addrspace_at_module_scope:*": { "subcaseMS": 1.000 },
"webgpu:shader,validation,decl,var_access_mode:explicit_access_mode:*": { "subcaseMS": 1.373 },
"webgpu:shader,validation,decl,var_access_mode:implicit_access_mode:*": { "subcaseMS": 1.000 },
"webgpu:shader,validation,decl,var_access_mode:read_access:*": { "subcaseMS": 1.177 },
Expand Down
10 changes: 10 additions & 0 deletions src/webgpu/shader/validation/decl/var.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,13 @@ g.test('function_scope_types')

t.expectCompileResult(shouldPass, wgsl);
});

g.test('function_addrspace_at_module_scope')
.desc('Test that the function address space is not allowed at module scope.')
.params(u => u.combine('addrspace', ['private', 'function']))
.fn(t => {
t.expectCompileResult(
t.params.addrspace === 'private',
`var<${t.params.addrspace}> foo : i32;`
);
});

0 comments on commit bc32dbc

Please sign in to comment.