Commit Graph
362 Commits
Author SHA1 Message Date
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
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
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
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
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
Pelle Johnsen 7902bd54a8 [glsl-new] Fix expression ordering for compose (#130) 2020-08-16 09:38:07 -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
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
Pelle Johnsen f98054afdd [glsl-new] add vec2 and vec3 2020-08-09 10:57:41 -04:00
Timo de Kort 6db5b373f8 Add support for other matrices keywords (#121)
Add mat2x3, mat2x4, mat3x2, mat3x4, mat4x2, and mat4x3 keywords
2020-08-09 09:32:22 -04:00
Pelle Johnsen 745ef6a6d6 [glsl-new] Add float consts (#119) 2020-08-05 09:45:42 -04:00
Pelle Johnsen 747535906f [glsl-new] Add ExpressionRule for expr/stmts (#118)
- Initial work for handling expressions that also generates statements
2020-08-04 15:45:55 -04:00
Pelle Johnsen 1eb637038d [glsl-new] Add initial handling of stmts and exprs (#116)
* [glsl-new] Add initial handling of stmts and exprs

* [glsl-new] use &'static str for NotImplemented msg

* [glsl-new] Don't lazy create function context
2020-07-28 22:48:05 -04:00
Pelle Johnsen 3884921f4e [glsl-new] handle gl_Position builtin (#114)
* [glsl-new] handle gl_Position builtin

- Also fix width of vec4 type

* [glsl-new] add shader stage as arg to program ctor
2020-07-23 11:52:10 -04:00
Gabriel Majeri ccab9f7c38 Implement Error for wgsl::ParseError (#113) 2020-07-21 14:52:18 -04:00
Pelle Johnsen 41ca3834f5 [glsl-new] store int constants in module (#111) 2020-07-20 10:56:10 -04:00
Pelle Johnsen d26f754853 Add more glsl-new handling of funcs and types (#110) 2020-07-14 08:56:18 -04:00
Pelle Johnsen 244c587457 Glsl new handle version (#109)
* Fix TokenMetadata for #version

* Add glsl-new #version parsing

* Fix clippy issues

* glsl-new only core profile, allow 440-460

* Cleanup glsl-new profile matching
2020-07-13 13:40:12 -04:00
Kristoffer Søholm 6c062087fa Initial GLSL constant evaluation implementation (#94)
Adds constant evaluation for addition, and uses it for globals and array
specifiers.
2020-07-09 20:52:13 -04:00
Pelle Johnsen c9fea37430 Add inital ast for glsl-new (#107)
* Add inital ast for glsl-new

* Fix clippy for glsl-new

Deref instead of cloning
2020-07-08 08:46:31 -04:00
Dzmitry Malyshau 28f22810a0 [spv] first steps in control flow graph 2020-07-06 14:10:38 -04:00
Dzmitry Malyshau 39998a4c38 Differenciate between local and external function calls at IR level 2020-07-06 14:10:38 -04:00
Paul Kernfeld ec52598d61 Deny on panics with clippy 2020-07-06 00:13:51 -04:00
LaughingMan 106cd6d188 WGSL front end: Add basic lexer tests 2020-07-06 00:12:26 -04:00
LaughingMan 1acd12334a WGSL front end: Only accept ASCII chars in identifiers
Previously the lexer would accept any alphanumeric character as part of an
identifier. The spec only allowes identifiers to consist of ASCII alphanumeric
characters though.
2020-07-06 00:12:26 -04:00
Pelle Johnsen cf62dc3d8c Glsl new multi line comments (#103)
* Add multi line comment support to glsl-new

* Fix glsl-new TokenMetadata for multi line comments
2020-07-05 09:35:20 -04:00
Dzmitry Malyshau 4a769c10b5 [spv] remove the pointer indirection to variables 2020-07-05 09:33:07 -04:00
Dzmitry Malyshau 33fe3a3dba Struct member origin enum 2020-07-04 11:10:37 -04:00
Dzmitry Malyshau 5d6406b018 Add DepthImage IR type.
Fix all the usage of Bytes type to really mean bytes.
Have logic in the SPIR-V front-end to detect the comparison properties of samplers and images.
2020-07-04 11:10:37 -04:00
Pelle Johnsen 2ffbeba8c6 Fix illegal chars in identifier for glsl-new 2020-07-04 10:58:29 -04:00