Make changes suggested in #2075, but put off to a separate PR because they would interfere with reviewing the change:
- Split the new WGSL front end into modules in a logical way.
- Rename `Parser` to `Frontend`.
* use strip_prefix
* make fn const (resolving TODO)
* make use of nested OR patterns in match arms
* warn on clippy::missing_const_for_fn
* constify functions
* ignore clippy::missing_const_for_fn for into_inner functions
* Rewrite front/back doc summaries
- Use line comments instead of block comments
- Standardize language for each front/backend
- Add reference link for each format
- Minor punctuation changes
* Add documentation for keywords module
* Clarify contents of keywords module in summary
* Refer to modules by their type name
* Add basic summary for valid module
* Adjust EarlyDepthTest and ConservativeDepth docs
* Remove "in" from list
* Adjust wording
* Standardize format of docstrings
* Adjust module links to be consistent with other links
* Add summary for reserved keywords list
* Remove extraneous doc spaces with `cargo fmt`
* Correct spelling of whether and rewrite some lines
* Fill out GLSL backend docs
* Remove unnecessary link targets
* Fill out DOT backend docs
* Change module line comments to block comments
* Remove unnecessary spaces
* Fix mistake during rebasing
The new api allows for reuse while keeping some allocations and to
please the borrow checker in future work, it also splits the parser into
logical modules to make it easier to work on.
WGSL will require this. Note that this still might
cause some issues with multi-entry-point GLSL
that I didn't know how to handle. That is, we will
handle unused builtin inputs but not unused
builtin outputs correctly right now. This is an existing
issue though, not a regression.
This is also provided as an option, but I feel like
the more correct approach is to never strip linkage
variables. We'll see though.
* [glsl-in] Add initial pre-processor
* [glsl-in] Tweak preprocessor after review
- Add IfState struct
- Use FastHashMap to pre-defines
- Use ok-or() for some errors
* [glsl-in] Remove Option in defines arg
* [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
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
* 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