Commit Graph
159 Commits
Author SHA1 Message Date
Jim Blandy 99a9e1e78e Change Binding::Location to a struct-style enum variant.
This commit makes no other changes. This is in preparation for adding a third
field, at which point tuple variants start to get obscure.
2021-04-19 09:42:00 -04:00
Dzmitry Malyshau 604e10e19b Rewrite IR to have member offsets, full structure span and alignment 2021-04-08 23:15:03 -04:00
Dzmitry Malyshau 7326ba6ddb New struct layout IR 2021-04-08 23:15:03 -04:00
Dzmitry Malyshau 372b2d314e Adjust lints for Rust clippy 1.51 2021-03-25 12:34:25 -04:00
Dzmitry Malyshau 08eaad89db Implement default layout in the IR and WGSL 2021-03-15 22:27:35 -04:00
Dzmitry Malyshau ebcd815250 Update IR to have entry points with inputs/outputs 2021-03-13 23:26:19 -05:00
Dzmitry Malyshau 9e5cc4c9e4 Prevent matching on a reference once and for all 2021-03-12 11:35:09 -05:00
Dzmitry Malyshau 2045a4a7be Use BOOL_WIDTH everywhere 2021-03-06 11:01:14 -05:00
Pelle Johnsen 51cbd4c112 [glsl-in] Add initial support for glslpp-rs (#513)
* [glsl-in] Add initial support for glslpp-rs

* [glsl-in] Add remaining Punct mappings

Fix some tests.

* [glsl-in] Add basic error handling for glslpp-rs

* [glsl-in] Fix clippy issues

* [glsl.in] Add pp-rs floats

* [glsl-in] Remove old lex and preprocessor

* [glsl-in] Improve lexer token code

* [glsl-in] Rename lex_pp > lex

Also LexerPP > Lexer

* [glsl-in] glslpp-rs review feedback

* [glsl-in] Use rev for pp-rs dep

* [glsl-in] Parse on lexer err
2021-02-24 12:07:09 -05:00
Dzmitry Malyshau 8a0382a89d Move global use flags into FunctionInfo 2021-02-17 15:37:37 -05:00
Pelle Johnsen 408002815f [glsl-in] Multi entry points - address comments 2021-02-17 10:05:40 -05:00
Pelle Johnsen 1861fca4ba [glsl-in] Support multiple entrypoints 2021-02-17 10:05:40 -05:00
Joshua Groves f42dc0c377 Fix some typos 2021-02-14 22:50:12 -05:00
Pelle Johnsen c04c971907 [glsl-in] Fix StorageClass for texture and sampler 2021-02-11 10:33:21 -05:00
Dzmitry Malyshau 6f50ca6bee Push constant support 2021-02-07 11:54:56 -05:00
João Capucho 993521965d Add support for unary ops to glsl 2021-02-06 22:23:09 -05:00
João Capucho e0005211a3 Fix the way equality is handled in glsl 2021-02-06 16:04:24 -05:00
João Capucho 68bbf00249 Added support for initalizers and constants 2021-02-02 11:17:34 -05:00
João Capucho df3759ebff Fix double constant lexing and lex uint constants 2021-01-31 21:20:59 -05:00
João Capucho b55aa51f65 Add support for function declarations with arguments
Change ParseError to be public
Change globals to default to private instead of throwing error
2021-01-30 13:44:39 -05:00
92f970a69d Change ErrorKind::SemanticError to use Cow<'static, str> instead of &'static str (#356)
* Changed front::glsl::error::ErrorKind::Semantic to use Cow

* cargo fmt

* appeasing clippy

* Update src/front/glsl/functions.rs

Co-authored-by: monocodus[bot] <49363530+monocodus[bot]@users.noreply.github.com>

* Fixed more clippy errors

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
Co-authored-by: monocodus[bot] <49363530+monocodus[bot]@users.noreply.github.com>
2021-01-15 09:33:48 -05:00
Pelle Johnsen 6710f5954e Fix clippy issues 2021-01-04 09:51:32 -05:00
Pelle Johnsen 511000d022 [glsl-in] Extract function logic out of parser 2020-12-23 14:54:53 -05:00
Dzmitry Malyshau 001336b457 Tidy up constants IR 2020-12-20 17:42:00 +01:00
Dzmitry Malyshau b95346877a Remove MemberOrigin in favor of spans 2020-12-18 16:11:12 -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 eeb479ae94 [wgsl] support const locals 2020-12-10 10:20:56 -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
Pelle Johnsen 0f98357223 [glsl-in] Skip gl_PerVertex 2020-11-20 09:54:01 +01:00
Pelle Johnsen 437b33d536 [glsl-in] use TypeInner::scalar_kind for casts (#279)
* [glsl-in] use TypeInner::scalar_kind for casts

* [glsl-in] Use .ok_or for casts
2020-11-16 11:57:34 -05:00
Pelle Johnsen 9041cd4b10 [glsl-in] Handle simple casts 2020-11-16 12:58:19 +01:00
Dzmitry Malyshau 8b56f3ef96 [ir] support function argument names (#270) 2020-11-11 21:34:37 +01:00
Pelle Johnsen 249e0bd4ac [glsl-in] Make sure functions ends with return 2020-11-11 08:01:43 -05:00
Dzmitry Malyshau 41b3865e5b Make variable initializers to be const 2020-11-04 16:38:55 -05:00
Kristoffer Søholm bb5c9567b5 [glsl-in] Add xor, small refactor 2020-11-02 19:34:01 -05:00
Kristoffer Søholm 973cfbc5d3 [glsl-in] Add support for interface blocks 2020-11-02 19:34:01 -05:00
Pelle Johnsen 0101ea7319 [glsl-in] Handle assign ops: +=, *=, etc 2020-11-02 10:06:01 -05:00
Pelle Johnsen 602367c062 [glsl-in] Add initial texture handling 2020-11-01 14:52:11 -05:00
Kristoffer Søholm 4a10aab5f6 [glsl-in] Add iteration statements
while, do-while and for loops
2020-10-30 21:29:53 -04:00
Kristoffer Søholm 3b8b7e28dd [glsl-in] Add selection statements
i.e. if-else and switch-case
2020-10-30 21:29:53 -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 773408663b [glsl-in] make consume_token a lexer method (#227)
* [glsl-in] make consume_token a lexer method

* [glsl-in] fix lex for 1.41
2020-10-06 10:31:41 -04:00
Pelle Johnsen df9834258f [glsl-in] Implement swizzle for r-values (#213)
* [glsl-in] Implement swizzle for r-values

Related to #210

* [glsl-in] Just return Result from field_selection

Removed unneccessary Otion in return type

* [glsl-in] Always match on type in field_selection

* [glsl.in] Borrow by value in field_selection
2020-09-25 10:32:50 -04:00
Pelle Johnsen e5d17e878b [glsl-in] Support anonymous global uniforms (#211)
* [glsl-in] Support anonymous global uniforms

Partly fixes #210

* [glsl-in] Handle anon global structs in fn prelude
2020-09-22 11:52:51 -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
Dzmitry Malyshau 14feb9ac01 Validation of global variables and entry points 2020-09-17 16:12:56 -04:00
Pelle Johnsen 1c3f4513de [glsl.in] Implement field lookup 2020-09-17 14:11:09 -04:00