Commit Graph

17 Commits

Author SHA1 Message Date
Teodor Tanasoaia
9742f1616c fix zero initialization of workgroup memory (#2259)
Use the local (not global) invocation id to decide which invocation should do the initialization, so that every workgroup gets initialized, not just the first.
2023-02-20 19:56:24 -08:00
teoxoy
c7d02151f0 add support for zero-initializing workgroup memory 2023-01-25 18:07:48 +01:00
SparkyPotato
6035b07b78 [wgsl-in] Implement module-level scoping.
Fixes #1745: Support out-of-order module scope declarations in WGSL
Fixes #1044: Forbid local variable shadowing in WGSL
Fixes #2076: [wgsl-in] no error for duplicated type definition
Fixes #2071: Global item does not support 'const'
Fixes #2105: [wgsl-in] Type aliases for a vecN<T> doesn't work when constructing vec from a single argument
Fixes #1775: Referencing a function without a return type yields an unknown identifier error.
Fixes #2089: Error span reported on the declaration of a variable instead of its use
Fixes #1996: [wgsl-in] Confusing error: "expected unsigned/signed integer literal, found '1'"

Separate parsing from lowering by generating an AST, which desugars as
much as possible down to something like Naga IR. The AST is then used
to resolve identifiers while lowering to Naga IR.

Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
Co-authored-by: Jim Blandy <jimb@red-bean.com>
2023-01-12 09:37:08 -08:00
Igor Shaposhnik
f76af4e53a [wgsl] Remove buffer, texture, in, out, input, output from reserved keywords 2022-04-29 20:06:09 +02:00
Teodor Tanasoaia
dc075e66e3 [wgsl-in] Update reserved keywords (#1847) 2022-04-17 15:56:54 +02:00
Jim Blandy
78975f25da [msl-out] Permit invariant qualifier on vertex shader outputs. 2022-04-12 22:22:20 +02:00
teoxoy
6ee1fd4929 fix MSL issue 2022-04-10 21:49:23 -07:00
teoxoy
d3957c1186 implement invariant attribute 2022-04-10 21:49:23 -07:00
Jim Blandy
c84aa77579 [msl-out] Properly rename entry point arguments for struct members. (#1766) 2022-03-08 10:07:30 -05:00
Jim Blandy
688ad474f7 [msl-out] Write 'using metal::uint' at the top, to work around bug. (#1740)
This lets us remove some special cases where `uint` must be fully
qualified, even though other similar types are not.
2022-02-21 13:22:54 -08:00
Taylor Holliday
f63003cd36 WGSL storage address space should always correspond to MSL device add… (#1711)
* WGSL storage address space should always correspond to MSL device address space.

See MSL spec section 4.2.

* Update baselines

* Add error for storage address space if MSL version < 2.

* Update default MSL version to 2.0.
2022-02-03 13:00:04 -05:00
Dzmitry Malyshau
76814a83a2 msl: inject point size if needed 2022-01-19 11:33:14 -05:00
Dzmitry Malyshau
8bc3aa824b Refactor namer scheme, fix trailing digits (#1510) 2021-11-09 09:24:41 -05:00
Dzmitry Malyshau
79d899fe4c Support num_workgroups builtin 2021-08-17 22:22:22 -04:00
Dzmitry Malyshau
8f71a368ef Validate the exact MSL version (#1101) 2021-07-16 23:56:15 -04:00
Dzmitry Malyshau
8eef784416 WGSL: Flip true/false arguments of select() 2021-07-16 11:42:12 -04:00
Gordon-F
6cdd332cef Reorganize test snapshot folder 2021-06-19 10:19:04 -04:00