Commit Graph
648 Commits
Author SHA1 Message Date
Dzmitry Malyshau cf0a86afd4 [spv-in] move all the image-related logic into a sub-module 2021-02-08 15:59:47 -05:00
Dzmitry Malyshau 6b9d3eafc8 [spv-in] Rewrite the comparison image/sample handling.
Keep track of the comparison property per global variable instead of  type.
Only track images that can actually be comparison-sampled.
Instead of mutating the type, just add a new type in the end
if we detect it to be necessary, cloning the old name.
2021-02-08 15:59:47 -05:00
Dzmitry Malyshau 10867879d4 [spv-in] support projection sampling and sampling from arrays 2021-02-08 11:31:45 -05:00
Dzmitry Malyshau 6f50ca6bee Push constant support 2021-02-07 11:54:56 -05:00
Dzmitry Malyshau 960aabec20 [spv-in] Implement OpCompositeInsert 2021-02-07 11:49:52 -05:00
Dzmitry Malyshau 75427cf95c [spv-in] handle matrix decorations 2021-02-07 11:44:47 -05:00
João Capucho 993521965d Add support for unary ops to glsl 2021-02-06 22:23:09 -05:00
João Capucho 708751a805 Add support for relational functions to glsl-in 2021-02-06 16:57:30 -05:00
João Capucho da8f9ecbb9 Add support for more math functions in glsl-in 2021-02-06 16:57:30 -05:00
João Capucho e0005211a3 Fix the way equality is handled in glsl 2021-02-06 16:04:24 -05:00
Dzmitry Malyshau d0c84a5ffa [spv-in] support for void function calls 2021-02-06 10:42:54 -05:00
Dzmitry Malyshau 11a3ed9837 WGSL support for void function calls 2021-02-06 10:42:54 -05:00
João Capucho f9f41fc9bf Add support for more math functions in glsl 2021-02-06 00:41:00 -05:00
João Capucho 2f9c957198 Add support for pow and fix mix arguments 2021-02-06 00:41:00 -05:00
João Capucho ae72fb0933 Add support for component wise comparison to glsl 2021-02-06 00:41:00 -05:00
João Capucho 647dd76dba Moved the ConstantSolver to the glsl frontend 2021-02-06 00:25:30 -05:00
Dzmitry Malyshau b1fa7471d2 Basic image query support in SPV and WGSL frontends 2021-02-05 15:26:45 -05:00
Dzmitry Malyshau f563b5810b [spv-in] support OpImage, OpImageFetch, OpLogicalOr, OpLogicalAnd, relational functions, and fix OpUndef 2021-02-04 09:49:40 -05:00
Dzmitry Malyshau 423ccc2074 [spv-in] parse OpConstantNull and OpUndef 2021-02-04 09:49:40 -05:00
Dzmitry Malyshau 0970ef0ea5 [spv-in] derive the block status of a structure from its members 2021-02-04 09:49:40 -05:00
João Capucho 68bbf00249 Added support for initalizers and constants 2021-02-02 11:17:34 -05:00
João Capucho c12003f564 Populate ResolveContext with functions
Add support for more math functions
2021-01-31 21:21:51 -05:00
João Capucho daf18642d7 Add support for hexadecimal literals 2021-01-31 21:20:59 -05:00
João Capucho df3759ebff Fix double constant lexing and lex uint constants 2021-01-31 21:20:59 -05:00
Dzmitry Malyshau 4a3ecc774f [wgsl] remove function and constant lookup maps 2021-01-31 18:27:08 -05:00
Dzmitry Malyshau cb36c642ea [wgsl] refactor constants processing, add support for array sizes 2021-01-31 18:27:08 -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
Dzmitry Malyshau dc98305bb8 Print out detailed WGSL errors 2021-01-28 01:22:10 -05:00
Dzmitry Malyshau 4f517f4af3 [wgsl] include the expected string into the error 2021-01-28 01:22:10 -05:00
Dzmitry Malyshau 3e4cb21b90 [wgsl] support simple block statements 2021-01-27 21:31:04 +01:00
Dzmitry Malyshau ab2cf8b842 [wgsl] support vector type casts 2021-01-26 23:33:08 -05:00
Dzmitry Malyshau 9c74468f81 [wgsl] enable access via rgba 2021-01-26 17:04:11 -05:00
Dzmitry Malyshau 292304b66f [wgsl] fix postfix expression parsing 2021-01-26 16:44:19 -05:00
Dzmitry Malyshau 986550aff8 [wgsl] fix and update storage load 2021-01-26 15:57:48 -05:00
Dzmitry Malyshau c803240587 [wgsl] resolve types across functions 2021-01-25 00:59:30 -05:00
Dzmitry Malyshau 0ea8a0a3c2 [wgsl] support unsigned literals 2021-01-23 10:03:25 -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
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