Commit Graph

203 Commits

Author SHA1 Message Date
Dzmitry Malyshau
a561c7cacb validator: try resolving the types 2020-09-15 07:51:45 -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
Pelle Johnsen
094e4fdd17 Fix lexer operator issues (with tests) (#188)
* Fix lexer operator issues (with tests)

* [glsl-in] Don't convet to string in lexer tests

* [glsl-in] cleanup lexer tests further

- Consolidate use statements

- Iterate lex directly, check for None at end
2020-09-14 01:16:12 -04:00
Pelle Johnsen
a9355f928f [glsl-in] Add gl_VertexIndex (#189)
* [glsl-in] Add gl_VertexIndex

Refactor variable handling out of parser.rs

* [glsl-in] Fixes for gl_VertexIndex

- Make lookup_variable a method of Program

- Try to cleanup conditional logic

* [glsl-in] Error on gl_ builtin in wrong stage

Wrapped in glsl-validate feature
2020-09-13 21:20:46 -04:00
Dzmitry Malyshau
089d0dd4f8 Minor fixes in feature checks (#194) 2020-09-13 21:03:00 -04:00
Pelle Johnsen
0235c4a86c [glsl-in] Fix unused braces in parser.rs (#190) 2020-09-13 00:22:06 -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
2ea0310b63 [glsl] Promote glsl-new to glsl (#184)
* [glsl] Promote glsl-new to glsl

* [glsl-in] rename feature glsl > glsl-in
2020-09-10 01:11:52 -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
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
c122e064a7 Move storage class from image type into the global declaration (#182) 2020-09-09 13:59:29 -04:00
Pelle Johnsen
789d624710 [rosetta] Add explicit return (#180) 2020-09-08 01:18:07 -04:00
Pelle Johnsen
43bad8ee50 [glsl-new] Add jump statements (#179)
* [glsl-new] Add jump statements

- continue
- break
- return
- discard

* [glsl-new] Fix clippy error for return statement
2020-09-07 01:28:13 -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
Pelle Johnsen
2cdb54e266 [glsl-new] Update last exprs to ExpressionRule (#173)
* [glsl-new] Update last exprs to ExpressionRule

Refactor out binary_expr to keep parser.rs 'small' and readable

* [glsl-new] Change binary_expr to method on Program

* [glsl-new] Make binary_expr a proper method
2020-09-02 01:34:39 -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
Pelle Johnsen
f97c62b0e6 [glsl-new] Add bool consts, update logical exprs (#171) 2020-09-01 00:52:07 -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
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