Commit Graph

24 Commits

Author SHA1 Message Date
teoxoy
08105461ce omit non referenced expressions 2023-06-12 17:49:06 -07: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
Teodor Tanasoaia
27d38aae33
[hlsl-out] More matCx2 fixes (#1989)
* [hlsl-out] fix matCx2 as global uniform

* [hlsl-out] update comments

* [hlsl-out] fix `row_major` not being written on global arrays of matrices and also write it on nested arrays of matrices

* [hlsl-out] fix matCx2's nested inside global arrays

* [hlsl-out] fix struct members of type array<matCx2>

* [hlsl-out] test mat2x4 to make sure our matCx2 code behaves properly
2022-06-27 15:56:10 -07:00
teoxoy
062b66ca31 implement phony assignment 2022-04-26 21:40:31 -07:00
Igor Shaposhnik
fbb77aa0dc [wgsl-in] Update entry point stage attributes 2022-04-15 18:02:48 +01:00
Jim Blandy
bdbf821c32 Test matrix-typed uniform globals. 2022-04-14 11:54:47 -07:00
Jim Blandy
27d0fee2e7 More tests for non-struct global types. 2022-04-14 11:45:42 -07:00
teoxoy
32cdb27230 add better tests for msl packed vec3 2022-04-11 20:30:00 -07:00
teoxoy
d7f4c340a7 add matrix vector multiplication test 2022-04-11 20:30:00 -07:00
teoxoy
1f797fdc2f add more packed vec3 load/stores to test 2022-04-11 20:30:00 -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
Dzmitry Malyshau
79845371d3 msl: qualify read-only storage with const 2022-03-06 19:28:15 -08:00
Jim Blandy
0ce98d6411 [msl-out][spv-out][glsl-out][hlsl-out] Fix ArraySize on globals. 2022-02-05 00:16:53 -05:00
Dzmitry Malyshau
75692d3795 Allow non-structure buffer types 2022-02-02 10:08:20 -05:00
Dzmitry Malyshau
4bd1efc34d wgsl: declare attribtues with @ 2022-01-20 19:44:05 -05:00
Dzmitry Malyshau
09d35f3631 gl-out: skip unsized types if unused 2022-01-05 23:11:43 -05:00
Dzmitry Malyshau
2738ad80b9
msl: fix packed vec access (#1634) 2021-12-28 05:13:13 +00:00
Dzmitry Malyshau
b1ab59925d
msl: fix packed float support (#1630) 2021-12-27 02:57:47 +00:00
Dzmitry Malyshau
c2328fea75 Release v0.8 2021-12-18 12:05:12 -05:00
Igor Shaposhnik
dba6beb941 [wgsl-in] Don't allow redefinition of module scope identifiers 2021-11-28 21:23:22 -05:00
Dzmitry Malyshau
5415d8c7c4 Fix atomics in workgroup storage 2021-08-13 23:01:25 -04:00
Dzmitry Malyshau
1366546645 [glsl-out] improve array types 2021-05-28 22:18:51 -04:00
Dzmitry Malyshau
d1e2ac57fe New snapshot test for global variables 2021-05-28 22:18:51 -04:00