Commit Graph

99 Commits

Author SHA1 Message Date
João Capucho
d45d11e4c5 msl-out: Use io::Write instead of fmt::Write (#250)
* msl-out: Use io::Write instead of fmt::Write

* msl-out: merge std use
2020-10-30 16:51:50 -04:00
Dzmitry Malyshau
587dc01a2c [msl] refactor the options, add override stages 2020-10-28 00:30:22 -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
João Capucho
a718992acb Added new external functions to the glsl backend to make it on par with the typifier (#240) 2020-10-19 09:40:30 -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
João Capucho
b76dff9d9c Added the new method to the msl Writer (#236) 2020-10-12 11:49:53 -04:00
Timo de Kort
4420258001 [ir] Remove Matrix Kind from the IR (#230) 2020-10-06 17:19:29 -04:00
Timo de Kort
f67dfd251a [spv-out] Add multiply instructions (#219) 2020-10-06 16:57:30 -04:00
Timo de Kort
99f829b3cc [spv-out] Add check for global variables if name is set 2020-10-05 09:43:59 -04:00
Timo de Kort
90c56aca2f [spv-out] Add scalar conversion support 2020-10-03 19:50:09 -04:00
Timo de Kort
98167103c2 [spv-out] Remove instruction spec tests 2020-10-03 19:49:22 -04:00
Timo de Kort
e0f593f35f [spv-out] Add matrix construct support 2020-10-01 15:41:42 -04:00
Timo de Kort
b56c2ddbdc [spv-out] Fix write_function returning block id 2020-09-30 16:43:56 -04:00
Dzmitry Malyshau
6de675313b [spv] fix stack overflow in type writing 2020-09-28 23:29:23 -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
Timo de Kort
40f37c5c8c [spv-out] Combined all instruction spec tests to one test (#208) 2020-09-18 17:02:00 -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
081b90f117 Consolidate rosetta tests 2020-09-17 10:16:32 -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
d6cc17f051 Refactor feature names 2020-09-15 07:51:45 -04:00
Dzmitry Malyshau
e99c715160 glsl: use typifier in the backend 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
Dzmitry Malyshau
b278e10ea7 [spirv-in] make pointers totally transparent (#187) 2020-09-11 12:19:55 -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
Pelle Johnsen
2fa8eb596d [spv-out] Add initial Rosetta test (#181)
* [spv-out] Add initial Rosetta test

For now just check that spv-out succeeds

* [spv-out] Check spv output has len > 0
2020-09-10 00:32:02 -04:00
Dzmitry Malyshau
c122e064a7 Move storage class from image type into the global declaration (#182) 2020-09-09 13:59:29 -04:00
Timo de Kort
a3bac5ee0f [Spirv-out] Move instructions to own module (#174)
* [spirv-out] Move instructions to own module

* [spirv-out] Fix wrong function use of some instructions

* [spirv-out] Update instruction parameters

* [spirv-out] Update current instruction tests

* [spirv-out] Order current instruction tests

* [spirv-out] Add missing instruction tests
2020-09-06 00:35:59 -04:00
Timo de Kort
9ba075c990 [spirv-out] Implement FunctionCall 2020-09-01 23:56:43 -04:00
Timo de Kort
c56013b46e [spirv-out] Implement FunctionParameter 2020-09-01 23:56:43 -04:00
Timo de Kort
b7d834ed33 [spirv-out] Implement return value for functions 2020-09-01 23:56:43 -04:00
Timo de Kort
dc38fc115b [spirv-out] Add OpFunctionParameter 2020-09-01 23:56:43 -04:00
Matus Talcik
b67739034e Implement Execution Modes (#169)
Add documentation, make clippy happy


Compilation errors


Add some more docs


Few more compilation errors


Changes based on the review


glsl-new parser fix


Set default local size to (0, 0, 0)


final cleanup


Last design


New design
2020-08-31 14:34:38 -04:00
Dzmitry Malyshau
dc442343d6 Make TypeInner to be non-clonable 2020-08-28 19:37:39 -04:00
Matus Talcik
7a43c78e29 Add storage formats (#167)
Add GLSL backend


Add SPIR-V back + front
2020-08-28 14:55:30 -04:00
João Capucho
73204d094c glsl-out: fixes (#164)
* Fixed not generating wrong op on booleans
Correctly handle storage images and sampled images

* Fixed comments
2020-08-27 18:01:19 -04:00
Dzmitry Malyshau
bd9efe5915 Allow struct members without an origin 2020-08-27 11:49:38 -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
João Capucho
64bb2104cf glsl-out: Less allocations, handle struct member origin and correctly handle empty names (#160)
* Removed half of the clones
Fixed struct field names with invalid ident

* Fix struct member origin not being respected

* is_valid_ident handles empty names
2020-08-27 10:26:55 -04:00
Dzmitry Malyshau
4797773152 Image IR refactor (#153) 2020-08-26 13:26:51 -04:00
João Capucho
f7c5e4873e Made the output of glsl-out more human readable (#154) 2020-08-26 12:29:33 -04:00
João Capucho
ac66d149a4 Fixed names beginning with digits and arguments without names (#151) 2020-08-25 15:54:13 -04:00
João Capucho
5d9489871d Add support for glsl es in the glsl backend (#128)
* Initial glsl es 300 support

* Set float default precision

* Generate interface blocks and check storage class in es

* Added more checks on es and fixed uniform blocks with same name type

* Added image checks

* Added the test to the makefile

* applied comments
2020-08-22 10:50:54 -04:00