Commit Graph

2127 Commits

Author SHA1 Message Date
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
Matus Talcik
7a43c78e29 Add storage formats (#167)
Add GLSL backend


Add SPIR-V back + front
2020-08-28 14:55:30 -04:00
Pelle Johnsen
c824287fd5 [glsl-new] Refactor type handling (#166)
* [glsl-new] Refactor type handling

* [glsl-new] Fix clippy error
2020-08-28 12:09:57 -04:00
Dzmitry Malyshau
1b17030d05 Split wgsl into sub-modules, and gate by a feature (#165) 2020-08-27 23:30:53 -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
Matúš Talčík
447e2483f9 Format, clippy
pub(super)
2020-08-27 17:08:25 -04:00
Dzmitry Malyshau
bd9efe5915 Allow struct members without an origin 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau
b5d99e133b [spirv] fix binary operators, support more extensions 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau
462c82fb71 As expressions 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau
35e14378b3 [spirv] register function parameters, handle return values 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau
cf6002be01 [spirv] dot product and a few more GLSL ops 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
91a7bdf7e7 [spirv] handle LOD and BIAS image operands 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau
58b35f13ba [spirv] refactor builtin handling 2020-08-27 11:49:38 -04:00
Pelle Johnsen
e41dc6958c Make CI test on multiple rust versions (#159)
Use 1.41.0 and nightly
2020-08-27 10:30:04 -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
Matus Talcik
df8364f92c Add kill, unreachable + switch (#156) 2020-08-26 20:29:18 -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
Pelle Johnsen
6a3af2fe87 Add dependency on serialize for Rosetta tests (#150)
* Add dependency on serialize for Rosetta tests

Fixes #149

* Also run default cargo test on CI
2020-08-25 13:51:27 -04:00
Pelle Johnsen
92c1ffb588 Add initial Rosetta testing (#148)
* Add initial Rosetta testing

* Make rosetta tests run as part of cargo test

* Fix rosetta test failure
2020-08-24 00:09:37 -04:00
Matus Talcik
c12c9a9fac init control flow graph (#122)
format

major refactor


Change spirv to spirv_headers


Remove files


First translation to naga + format


Fix Int Constant error


Don't add unnecessary blocks.


Some cleanups


format


remove constructs


docs


fix debug leftovers


format, clippy


satisfy clippy
2020-08-23 23:14:51 -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
Pelle Johnsen
cf39a88f21 [glsl-new] match wgsl expression order (#147) 2020-08-21 10:13:36 -04:00
Lachlan Sneff
e9d00d38a4 Make "None" interpolation mean default or nothing, depending on context (#146)
* Make no interpolation mean default or nothing, depending on context

* Re-add Interpolation::Perspective
2020-08-21 00:41:14 -04:00
Lachlan Sneff
6026e57404 [wgsl] Add more complete function calling support (#144)
* Add function calling support to wgsl frontend

* Fix external namespace with multiple namespaces

* changes after code review

* Don't re-tokenize std_namespace every time
2020-08-21 00:13:25 -04:00
Lachlan Sneff
5035362ee6 Better floating point support for wgsl (#142)
* Add custom consume_number function for consuming numbers into tokens to wgsl frontend

* clippy
2020-08-20 01:41:24 -04:00
Lachlan Sneff
bd276bf4a4 Add more builtins to wgsl frontend (#143) 2020-08-20 01:39:27 -04:00
Lachlan Sneff
88fb1bb22a [wgsl] Support for composite constant expressions. (#141)
* Add composite constant expression support to wgsl

* remove matching on reference

* Re-fix reference matching
2020-08-19 20:48:09 -04:00
Lachlan Sneff
8c0b1636ea Interpolation support for wgsl, glsl, glsl-new, spirv (front and back), and glsl-out (#140)
* Add interpolation support to naga core and wgsl

* Add glsl-new fragment shader support to examples/convert.rs

* Add interpolation support to glsl_new

* Add interpolation support to spirv frontend

* Add interpolation support to spirv backend

* Add interpolation support to glsl backend

* Add interpolation support to old glsl backend

* Fix interpolation field syntax in glsl backend

* Formatting fix

* thanks clippy

* Add wgsl struct interpolation decoration

* Change wgsl interpolation syntax

* Modify interpolation enum

* Changes responding to review

* Remove interpolation struct member qualifier

* code changes after review
2020-08-19 20:22:21 -04:00
Lachlan Sneff
d6b172ddcb Add support for array stride to wgsl frontend (#137)
* Add support for array stride to wgsl frontend

* rename
2020-08-19 14:09:28 -04:00
Pelle Johnsen
b0f1f6285a [glsl-new] set global_usgae on functions (#138) 2020-08-19 14:06:24 -04:00
Pelle Johnsen
c5a302b769 [glsl-new] Use Empty statement (#139) 2020-08-19 14:05:24 -04:00
Timo de Kort
58dd54f938 [spirv-out] Refactor lookup (#88) 2020-08-17 18:16:31 -04:00
Lachlan Sneff
b03e874646 Make type handling more generic in glsl-new (#134)
* Make type handling more generic in glsl-new

* Remove commented-out code
2020-08-17 15:35:05 -04:00
Lachlan Sneff
4677b74928 Add more scalar and vector types to glsl-new (#133)
* Add more scalar and vector types to glsl-new

* Formatting
2020-08-17 13:35:18 -04:00
Pelle Johnsen
34cf97cb91 [glsl-new] disable constant expression (#131) 2020-08-17 09:37:11 -04:00
Dzmitry Malyshau
50cd2b1bc2 Bump version to 0.2, add changelog naga-v0.2.0 2020-08-16 23:49:48 -04:00
Pelle Johnsen
7902bd54a8 [glsl-new] Fix expression ordering for compose (#130) 2020-08-16 09:38:07 -04:00
Lachlan Sneff
fccefaccde Add support for initialization of local variables to glsl backend (#129)
* Add support for initialization of local variables to glsl backend

* Cleanup
2020-08-15 01:46:10 -04:00
Pelle Johnsen
7f780e8efc [glsl-new] put validation errors behind featureUsing glsl-validate feature (#127) 2020-08-13 16:27:12 -04:00
Pelle Johnsen
b4e1775b9e [glsl-new] Handle local vars scopes (#126)
* [glsl-new] Handle local vars scopes

* [glsl-new] scope fixes

- Check loacl vars before globals

- Rename add_scope > push_scope

- Remove unnecessary ref in lookup functions
2020-08-13 15:36:51 -04:00
Lachlan Sneff
466cd1b728 Serialize and Deserialize Module (#125)
* Add serialize and deserialize features with examples

* Fix formatting

* Make some types (de)serialize transparently

* Fix more formatting

* Remove new examples and add (de)serialization support to the convert example

* Remove extraneous file

* Rename param file
2020-08-13 12:27:10 -04:00
João Capucho
a16204456e WIP: glsl 450 backend and common glsl module (#123)
* Initial backend implementation

* Refractored glsl450 backend to have a common module between further glsl backends
Implemented more missing functionality

* Error handling

* Implemented most of the suggestions

* Addresed all comments
Fixed some bugs

* Made code style consistent
2020-08-11 16:20:23 -04:00
Pelle Johnsen
b96b7449db [gls-new] handle local vars 2020-08-10 10:57:31 -04:00
Pelle Johnsen
41c1c713dc [glsl-new] handle global vars in external_decl 2020-08-10 10:57:31 -04:00
Pelle Johnsen
ede04ba4dc [glsl-new] Simplify declaration code
- Fix clippy issues
2020-08-09 10:57:41 -04:00
Pelle Johnsen
482c6d042d [glsl.new] Add initial declaration support
Focus on handling global in/out vars
2020-08-09 10:57:41 -04:00