Commit Graph
362 Commits
Author SHA1 Message Date
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
Dzmitry Malyshau 6f5ff27701 Sample mask support 2021-01-15 01:08:15 -05:00
Pelle Johnsen 61d624c82e [glsl-in] Implement function call (#354) 2021-01-13 08:07:43 +01:00
Dzmitry Malyshau 73cb6d4bdf [spv] Relax decoration checks for global variables 2021-01-11 09:32:27 -05:00
Dzmitry Malyshau bd998f6c32 Validate constant array sizes 2021-01-07 15:04:31 -05:00
Jay Oster 3bf7f41068 WGSL // comments
- Update parser to match the latest spec: https://github.com/gpuweb/gpuweb/pull/1326
2021-01-06 09:19:46 -05:00
Pelle Johnsen 6710f5954e Fix clippy issues 2021-01-04 09:51:32 -05:00
Pelle Johnsen 6c8cdea936 [glsl-in] Check number of function args 2020-12-23 14:54:53 -05:00
Pelle Johnsen 7d9054f2c1 [glsl-in] Implement more MathFunctions 2020-12-23 14:54:53 -05:00
Pelle Johnsen 9a51d82c39 [glsl-in] Implement ceil
Related to #330
2020-12-23 14:54:53 -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 fca72fd333 [wgsl] avoid recursion in token parsing 2020-12-18 16:11:12 -05:00
Pelle Johnsen 6bb40ce27b [glsl-in] Cast gl_VertexIndex to SInt (#332)
* [glsl-in] Cast gl_VertexIndex to SInt

* [glsl-in] Use conversion cast (gl_VertexIndex)

- Also cast gl_InstanceIndex

* [glsl-in] Simplify global var lookup

* [glsl-in] Fix missing comma
2020-12-15 09:24:48 -05:00
Dzmitry Malyshau 98857f09a2 Move Transpose into math functions 2020-12-13 00:41:23 -05:00
Dzmitry Malyshau 2d1006835a Fix WGSL variable storage classes, spv-out interface 2020-12-13 00:41:23 -05:00
Dzmitry Malyshau 211bec44a1 Improve texture sampling IR, update WGSL parsing of it 2020-12-13 00:41:23 -05:00
Dzmitry Malyshau 0efd6e75d7 [wgsl] update texture definitions and storage access
Add more tests, enhance the snapshot testing.
2020-12-12 12:46:24 -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 b7744a1ec5 [wgsl] function lookup, improve error reporting 2020-12-10 10:20:56 -05:00
Dzmitry Malyshau 82c5cff605 [wgsl] refactor type declarations and function calls to avoid backups 2020-12-10 10:20:56 -05:00
Dzmitry Malyshau eeb479ae94 [wgsl] support const locals 2020-12-10 10:20:56 -05:00
Dzmitry Malyshau edf5d857b1 Add workgroup id and size builtins 2020-12-10 09:38:56 -03:30
Dzmitry Malyshau b35e901249 Add all standard library functions to the IR 2020-12-09 15:43:36 -05:00
Dzmitry Malyshau 66d994566c [spv] force treating the built-in scalar types as unsigned 2020-12-08 22:55:21 -05:00
Dzmitry Malyshau 6c1f4ac590 [wgsl] populate standard functions 2020-12-08 09:28:24 -05:00
Dzmitry Malyshau 4f958bf658 [msl] refactor function call parsing 2020-12-06 23:30:52 -05:00
Dzmitry Malyshau b597bc5af6 [wgsl] add min/max support 2020-12-06 11:54:19 -05:00
Dzmitry Malyshau 5b14e26659 [wgsl] add a test module with units for if/loop/switch statements 2020-12-05 11:29: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 92de5851d0 [wgsl] update builtin names, have implicit function return type 2020-12-04 16:09:57 -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 4d4e1cd4cb [spv] support GLSL's Distance 2020-11-12 12:38:35 -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 ac5e91b31a Fix and refactor the constant array sizes 2020-11-11 08:02:06 -05: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
Matúš Talčík 173bb0de42 spv-in: more loop fixes 2020-10-31 10:02:47 -04: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 80bdd23fd4 Add scalar_kind() accessor to IR Type (#251) 2020-10-30 21:25:55 -04:00