Commit Graph

21 Commits

Author SHA1 Message Date
teoxoy
062b66ca31 implement phony assignment 2022-04-26 21:40:31 -07:00
Teodor Tanasoaia
dc075e66e3
[wgsl-in] Update reserved keywords (#1847) 2022-04-17 15:56:54 +02:00
Teodor Tanasoaia
bd62887a13
[hlsl-out] Add more padding when necessary (#1814)
* [hlsl-out] add padding at the end of structs and after struct members of type matrix and array (when necessary)

* use wrapped constructor fn for constants

* add array as fn arg test

* fix glsl array fn arg

* add wrapped constructor for arrays

* [glsl-out] support multidimensional arrays

* address comments
2022-04-11 20:34:06 -07:00
Teodor Tanasoaia
7aaac25fbf
[hlsl-out] fix matCx2 translation for uniform buffers (#1802)
* [hlsl-out] fix matCx2 translation

* fix msl validation (warning: unused variable)

* fix msl buffer declaration

* address comments
2022-04-10 22:29:11 -07:00
Teodor Tanasoaia
012f2a6b2e
Merge pull request #1784 from teoxoy/patch-2
[hlsl-out] fix matrix not being declared as transposed
2022-03-27 22:24:09 -07:00
Dzmitry Malyshau
79845371d3 msl: qualify read-only storage with const 2022-03-06 19:28:15 -08:00
Dzmitry Malyshau
4c91abe5b3 wgsl: remove stride 2022-01-24 16:44:12 -05:00
Dzmitry Malyshau
f2832b8999
hlsl: support arrays of matrices (#1629) 2021-12-27 00:30:57 +00:00
Dzmitry Malyshau
8ffd6ba929 Remove top_level property of structs 2021-12-15 09:33:33 -05:00
Dzmitry Malyshau
28c45321e5
hlsl: respect array stride in storage buffers (#1507) 2021-11-03 22:44:46 -04:00
João Capucho
c3a0d71f8b
[spv-out] Write function arguments names (#1472) 2021-10-23 23:20:12 -04:00
Dzmitry Malyshau
21324b8fea
Update WGSL grammar for pointer access. (#1312)
* Update WGSL grammar for pointer access.

Comes with a small test, which revealed a number of issues in the backends.

* Validate pointer arguments to functions to only have function/private/workgroup classes.

Comes with a small test. Also, "pointer-access.spv" test is temporarily disabled.
2021-09-27 18:49:28 -04:00
Jim Blandy
3fdd8592fc [wgsl-in] Rework Load Rule handling and indirection.
Make the parser code more closely follow the spec's grammar around
`unary_expression`, `postfix_expression`, and `singular_expression`.

Change the handling of postfix expressions (indexing, member/component access,
and swizzling) to apply the indirection at the appropriate time, resulting in
code improvements on all output formats. For example, where we used to generate
the following MSL:

    metal::float4 _e13 = bar.matrix[3];
    float b = _e13.x;

we now generate, simply:

    float b = bar.matrix[3].x;

Propagate WGSL reference types correctly, so that parenthesizing expressions no
longer causes the Load Rule to be applied.

Together with #1332 (already landed), this is a replacement for #1312, and
unblocks #1352.

Fixes #1351.
2021-09-14 16:17:57 -04:00
Jim Blandy
5b1c2e59f6 [spv-out] Write debug names for all types, not just structs.
This affects a lot of snapshots, so it's in its own commit, for easier review.
2021-08-30 13:24:41 -04:00
Dzmitry Malyshau
1e9f2b9287 Add atomicSubtract support 2021-08-26 11:50:21 -04:00
Dzmitry Malyshau
1121a815ac Separate enum for atomic binary operations 2021-08-10 21:48:02 -04:00
Dzmitry Malyshau
88c1c9037d Add atomic exchange function 2021-08-10 21:48:02 -04:00
Dzmitry Malyshau
8c371e8063 Atomic expressions, support in backends except HLSL and the validator. 2021-08-10 21:48:02 -04:00
Dzmitry Malyshau
284cfcce47 hlsl: storage writes 2021-07-26 01:29:42 -04:00
Dzmitry Malyshau
4b6846d5da hlsl: storage reads support, array length 2021-07-26 01:29:42 -04:00
Gordon-F
6cdd332cef Reorganize test snapshot folder 2021-06-19 10:19:04 -04:00