Commit Graph
17 Commits
Author SHA1 Message Date
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 fbb77aa0dc [wgsl-in] Update entry point stage attributes 2022-04-15 18:02:48 +01:00
Pu Xingyu 3c313564ac wgsl-in: Make semicolon after struct decl optional 2022-03-27 00:22:58 -07:00
Igor Shaposhnik 816fa347ad [wgsl-in] Uses commas to separate struct members instead of semicolons 2022-03-12 22:07:06 -08:00
Igor Shaposhnik c356b93962 [wgsl-in] Optional parentheses for if and switch 2022-02-15 09:57:07 -05:00
Dzmitry Malyshau 4bd1efc34d wgsl: declare attribtues with @ 2022-01-20 19:44:05 -05:00
Igor Shaposhnik 20b96ef47b Avoid function name redefinition in tests 2021-11-28 21:23:22 -05:00
Gordon-F a8119f005e Add extra fragment entry point to wgsl quad snapshot 2021-06-24 10:47:17 -04:00
Gordon-F e28344edbb [hlsl-out] Return entry points name to users 2021-06-24 10:47:17 -04:00
Dzmitry Malyshau a2e5284f82 WGSL trailing commas (#743)
* [wgsl-in] typedef Span

* [wgsl-in] trailing comma for case list

* [wgsl-in] trailing comma for constructors

* Review fixes
2021-04-21 22:38:26 -04:00
Lachlan SneffandDzmitry Malyshau 4cbef59dd6 Add struct instantiation support to wgsl-in (#507)
* Add struct instantiation support to wgsl-in

* Readd type matching and move struct test

* rebase onto master and update tests

* Update tests to upstream

* Fix merge errors

* Rebase onto master

* [wgsl-in] delay composite type creation

* Use the new WGSL construction syntax in the tests

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-17 01:14:07 -04:00
Mehmet Oguz Derin 142038c85b WGSL: const to let 2021-04-11 01:24:19 -04:00
Dzmitry Malyshau 20979b4800 [wgsl] type inference for constants 2021-03-15 01:31:57 -04:00
Dzmitry Malyshau ebcd815250 Update IR to have entry points with inputs/outputs 2021-03-13 23:26:19 -05:00
Dzmitry Malyshau 7ebd96b597 Fix uniformity requirements of emitted expressions 2021-03-12 16:21:08 -05:00
Dzmitry Malyshau dd273e254a Distinguish between expression uniformity and function uniformity 2021-03-11 10:14:47 -05:00
Joshua Groves 31be7099f2 Move snapshot inputs and outputs around 2021-02-07 18:16:26 -05:00