Commit Graph
23 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 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
Igor Shaposhnik fbb77aa0dc [wgsl-in] Update entry point stage attributes 2022-04-15 18:02:48 +01:00
teoxoy 9dddfeec37 [wgsl-in] implement increment and decrement 2022-03-27 00:34:53 -07: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
hatoo 7f4c01784c Remove vs_bake entry point from tests/in/shadow.wgsl
This entry point isn't useful for testing.
2022-03-11 20:14:25 -08:00
hatoo ae282703e2 Update test case from wgpu's shadow example 2022-03-11 20:14:25 -08:00
Igor Shaposhnik c356b93962 [wgsl-in] Optional parentheses for if and switch 2022-02-15 09:57:07 -05:00
Dzmitry Malyshau 4c91abe5b3 wgsl: remove stride 2022-01-24 16:44:12 -05:00
Dzmitry Malyshau 4bd1efc34d wgsl: declare attribtues with @ 2022-01-20 19:44:05 -05:00
Dzmitry Malyshau 8ffd6ba929 Remove top_level property of structs 2021-12-15 09:33:33 -05:00
pyrotechnickandDzmitry Malyshau 2f516c0932 [wgsl] Storage buffer/texture access (#1142)
* Resurrect texture_storage_* tests
* Test parsing of `var<storage,write>`
* Default storage textures to READ
* Restore default features
* Fix glsl/hlsl/msl/spv front and back ends
* Add missing test outputs
* All-around fixes for the storage access

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-28 01:47:18 -04:00
Dzmitry Malyshau c69736210a Snapshot test local variable inference 2021-07-06 01:26:03 -04:00
Dzmitry Malyshau 8a1d883ba5 [wgsl-in] support textureSampleCompareLevel 2021-05-28 22:43:39 -04:00
Dzmitry Malyshau c8d26a1f47 Splat support for WGSL and SPV in/out, updated snapshots 2021-04-14 19:26:20 -04:00
Mehmet Oguz Derin 142038c85b WGSL: const to let 2021-04-11 01:24:19 -04:00
Dzmitry Malyshau 7d042337e2 Align the block decoration with SPIR-V, require storage buffers 2021-03-25 12:34:25 -04:00
Dzmitry Malyshau e87f57d82c Fix expression validation check 2021-03-25 09:32:55 -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
Joshua Groves 31be7099f2 Move snapshot inputs and outputs around 2021-02-07 18:16:26 -05:00