Commit Graph

92 Commits

Author SHA1 Message Date
Dzmitry Malyshau
d949d58f7b Statement for void function call 2021-02-06 10:42:54 -05:00
João Capucho
647dd76dba Moved the ConstantSolver to the glsl frontend 2021-02-06 00:25:30 -05:00
João Capucho
88eee833d7 Add binary op support for the ConstantSolver 2021-02-06 00:25:30 -05:00
Dzmitry Malyshau
50f0ad6249 Image queries 2021-02-05 15:26:45 -05:00
Dzmitry Malyshau
ac27a1abaa Don't break upon a void function in the typifier 2021-02-05 10:08:34 -05:00
tfgast
71fdaedcec FragDepth is a Write Property
FragDepth is written to in a fragment shader, not read.
2021-02-03 22:29:42 -05:00
João Capucho
bb88aac937 Add matrix access to ConstantSolver 2021-02-02 11:17:34 -05:00
João Capucho
fcbf2aa4c4 Add support for unary ops to the constant solver
Fix wrong result when casting to bool
Add tests
2021-02-02 11:17:34 -05:00
João Capucho
53bd721895 Add support for casts in constant expressions 2021-02-02 11:17:34 -05:00
João Capucho
68bbf00249 Added support for initalizers and constants 2021-02-02 11:17:34 -05:00
Dzmitry Malyshau
5def021b6e [spv] replace the internal type inferrence with the typifier (#403)
Also, fix the Typifier's handling of logical operations.
See https://github.com/gfx-rs/naga/pull/404 for v0.3 branch.
2021-02-01 09:33:28 -05:00
Dzmitry Malyshau
cb36c642ea [wgsl] refactor constants processing, add support for array sizes 2021-01-31 18:27:08 -05:00
Dzmitry Malyshau
3b9f517446 [mtl] implement continuing, fix Greater op and scoping 2021-01-30 15:14:38 +01:00
Dzmitry Malyshau
ea64ab0431 Check host shared decorations in the validator 2021-01-29 21:22:04 +01:00
Dzmitry Malyshau
a5184fba49 Check for the block decorator in the validator 2021-01-25 09:06:32 -05:00
Dzmitry Malyshau
04b0f2443e Validate local and argument types 2021-01-22 08:58:02 -05:00
Dzmitry Malyshau
b441a25956 Rename GlobalUse variants 2021-01-22 08:58:02 -05:00
Dzmitry Malyshau
bc66f784c1 Refactor builtin usage validation 2021-01-22 08:58:02 -05:00
Dzmitry Malyshau
da51f29d42 [spv] emit proper member layout decorations (#360) 2021-01-22 08:54:28 -05:00
Dzmitry Malyshau
6f5ff27701 Sample mask support 2021-01-15 01:08:15 -05:00
Dzmitry Malyshau
c6658e775d Typifier support for vector * matrix multiplication 2021-01-09 21:06:28 -05:00
Dzmitry Malyshau
08b6c416a3 Unlock arbitrary binding indices in the validator 2021-01-09 20:59:51 -05:00
Dzmitry Malyshau
bd998f6c32 Validate constant array sizes 2021-01-07 15:04:31 -05:00
Dzmitry Malyshau
001336b457 Tidy up constants IR 2020-12-20 17:42:00 +01:00
Dzmitry Malyshau
1e70432691 [validator] refactor type checks into a function 2020-12-20 17:42:00 +01:00
Dzmitry Malyshau
c0dfb247b6 Sizing processor 2020-12-18 16:11:12 -05:00
Dzmitry Malyshau
98857f09a2 Move Transpose into math functions 2020-12-13 00:41:23 -05:00
Dzmitry Malyshau
211bec44a1 Improve texture sampling IR, update WGSL parsing of it 2020-12-13 00:41:23 -05:00
Dzmitry Malyshau
dafca34877 Add block boolean to the structure types in IR
Also update WGSL syntax for structures.
Move the boids code into snapshots.
2020-12-12 12:46:24 -05:00
Dzmitry Malyshau
edf5d857b1 Add workgroup id and size builtins 2020-12-10 09:38:56 -03:30
Dzmitry Malyshau
b35e901249 Add all standard library functions to the IR 2020-12-09 15:43:36 -05:00
Dzmitry Malyshau
f7ca7f2aff Refactor Switch statement, implement on WGSL 2020-12-05 00:22:39 -05:00
Dzmitry Malyshau
5fe9429a63 Terminator processor, used in WGSL and GLSL frontends 2020-12-04 17:23:13 -05:00
Dzmitry Malyshau
f18443a79d Validate builtin types 2020-12-04 16:13:14 -05:00
Capucho
dd5021234d [glsl-out] Reworked the backend
The backend now works in a similar way to the msl backend
Should require less loops, allocations and backtracking
Overall just better to work with it

Added a build script which reads a file with the glsl keywords and
generates a slice to be used in the Namer

Added a way to build a call graph
2020-11-22 14:45:12 -05:00
Dzmitry Malyshau
4ed91330cf Derive PartialEq for validation errors 2020-11-19 23:19:10 -05:00
Dzmitry Malyshau
5e77653c55 [ir] select expression 2020-11-12 17:43:33 +01:00
Dzmitry Malyshau
8b56f3ef96 [ir] support function argument names (#270) 2020-11-11 21:34:37 +01:00
Dzmitry Malyshau
a54800afc1 Naming processor, used for [msl] 2020-11-11 12:39:42 -05:00
Dzmitry Malyshau
ac5e91b31a Fix and refactor the constant array sizes 2020-11-11 08:02:06 -05:00
Dzmitry Malyshau
41b3865e5b Make variable initializers to be const 2020-11-04 16:38:55 -05:00
Dzmitry Malyshau
b61b100fa3 [ir] LocalVariableError 2020-11-04 16:38:55 -05:00
Kristoffer Søholm
8618a8a207 [ir] Make the interface visitor traverse local variable initializers
Otherwise the backends will panic on e.g. `vec4 local = Global;` if the global
isn't used anywere else in the function.
2020-11-02 19:34:01 -05:00
Dzmitry Malyshau
80bdd23fd4 Add scalar_kind() accessor to IR Type (#251) 2020-10-30 21:25:55 -04:00
Dzmitry Malyshau
ce49afa391 Clean up the storage classes (#245) 2020-10-27 09:10:55 -04:00
Dzmitry Malyshau
c1830901c7 Simplify bitshift IR (#244) 2020-10-27 09:05:14 -04:00
Pelle Johnsen
6fb195cdc8 [clippy] Fix clippy issues after upgrading to 1.47 (#237)
* [clippy] disable match_like_matches_macro for now

* [wgsl-in] Return error instead of panic

* [typifier] Convert panics to return error

Still one panic in clone impl for Resolution,
disabled clippy for that one

* [spv-in] REturn error instead of panic'ing

* [spv-out] Return error instead of panic'ing

* [typifier] Use IncompatibleOperand(s) error

Instead of just Other

* [typifier] Use Expression for op in Error

For IncompatibleOperands

* [typifier] revert last commit
2020-10-13 17:14:40 -04:00
Dzmitry Malyshau
aa35110471 Allow output variables to be read 2020-10-07 16:08:05 -04:00
Timo de Kort
4420258001 [ir] Remove Matrix Kind from the IR (#230) 2020-10-06 17:19:29 -04:00
Capucho
34e46d0a76 Added support for matrix access on the typifier 2020-10-05 16:11:41 -04:00