Commit Graph
62 Commits
Author SHA1 Message Date
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
Dzmitry Malyshau 8323521b83 [valid] move out the integer interpolation check to the entry point 2020-09-28 10:15:35 -04:00
Dzmitry Malyshau d03c95a576 Add more methods recognized by the typifier 2020-09-28 10:15:35 -04:00
Dzmitry Malyshau 53627c5cd8 [valid] allow dynamic access into vectors 2020-09-28 10:15:35 -04:00
Dzmitry Malyshau e57d877dbc [spv] fix storage buffer detection 2020-09-28 10:15:35 -04:00
Dzmitry Malyshau 7e809c605a Remove validation error lifetime 2020-09-28 01:10:57 -04:00
Dzmitry Malyshau 0651eb8fab Complete expression/statement support in MSL, refactor conversion methods in WGSL, and remove Statement::Empty 2020-09-19 16:16:17 -04:00
João Capucho 0aae8ae6f8 glsl-out: More glsl versions (#191)
* Added support for glsl core version up to 400

* Added 330 to the list supported versions

* Added links to all extensions and fixed a extension being wrongfully activated

* Cleanup and check for image formats

* Removed useless extension and location on layout

* Added support for external functions and fixed global names

* Typefier allow Scalars in distance and length

* Addressed comments

* Fixed extension appearing after body

* Fixed entry point not being generated
2020-09-18 17:01:05 -04:00
Dzmitry Malyshau d25ab1b1e8 Refactor image sampling arguments, add textureLoad support to WGSL 2020-09-18 10:53:26 -04:00
Dzmitry Malyshau aa7005fdf3 [ir] Move scalar kind into the Sampled image class variant 2020-09-18 10:01:56 -04:00
Dzmitry Malyshau 7aff39784b [wgsl] texture operations 2020-09-18 10:01:56 -04:00
Dzmitry Malyshau 14feb9ac01 Validation of global variables and entry points 2020-09-17 16:12:56 -04:00
Dzmitry Malyshau 2ebaadaf0c Refactor entry point IR 2020-09-17 10:08:49 -04:00
Dzmitry Malyshau 74c4a3ce18 Add ArrayLength expression 2020-09-16 09:29:26 -04:00
Dzmitry Malyshau a561c7cacb validator: try resolving the types 2020-09-15 07:51:45 -04:00
Dzmitry Malyshau fb2c60b31c msl: use typifier in the backend 2020-09-15 07:51:45 -04:00
Dzmitry Malyshau f04a07c86c proc: make typifier work with gaps in the type graph 2020-09-15 07:51:45 -04:00
João Capucho 0129aa2ca6 [glsl-out]: combined image sampler (#177)
* Added generation of the texture mappings to the glsl backend

* Added a temporary workaround for the spirv shaders
Fixed some parts that were using vulkan glsl

* Made texture mapping not require a sampler

* Used interface to build the texture map

* Made global names mandatory except for sampler ones

* Addressed more comments

* Removed the temp fix for the spirv frontend

* Addressed the comments
2020-09-10 14:14:03 -04:00
Dzmitry Malyshau e64f28375e ir: bitcast expression 2020-09-10 13:19:17 -04:00
João Capucho e1e116537e Extended Interface to be used in more places (#183)
* Extended Interface to be used in more places

* Applied comments and added tests

* Removed the statement visitor

* Fixed remaining comments
2020-09-09 17:22:13 -04:00
Dzmitry Malyshau dc442343d6 Make TypeInner to be non-clonable 2020-08-28 19:37:39 -04:00
Dzmitry Malyshau d370686351 proc: support parameter types in Typifier 2020-08-28 19:37:39 -04:00
Dzmitry Malyshau 462c82fb71 As expressions 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau 4a61705201 Add matrix transposition expression 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau 4797773152 Image IR refactor (#153) 2020-08-26 13:26:51 -04:00
Gabriel Majeri ccab9f7c38 Implement Error for wgsl::ParseError (#113) 2020-07-21 14:52:18 -04:00
Dzmitry Malyshau 94802078c3 Derive Error for validation errors (#112) 2020-07-21 11:36:05 -04:00
Dzmitry Malyshau 39998a4c38 Differenciate between local and external function calls at IR level 2020-07-06 14:10:38 -04:00
Dzmitry Malyshau 33fe3a3dba Struct member origin enum 2020-07-04 11:10:37 -04:00
Dzmitry Malyshau 5d6406b018 Add DepthImage IR type.
Fix all the usage of Bytes type to really mean bytes.
Have logic in the SPIR-V front-end to detect the comparison properties of samplers and images.
2020-07-04 11:10:37 -04:00
Kristoffer Søholm 1f5008f673 Refactor error handling in GLSL frontend 2020-06-30 18:56:58 -04:00