* Implement the wrapping in Expression::Load instead
* Add changes to stack size
* stable and nightly can't seem to agree on a stack size
* Apply suggestions
* Add a comment about unexpected path
* Update skybox snapshot
* should_pack_struct_member returns an Option<ScalarKind>
* Remove accidental file
When validating IR, verify that all `Binding`s for vertex shader outputs and
fragment shader inputs, whether directly in the argument or result, or applied
to a struct member, has specified an interpolation and sampling, not `None`.
This ensures that front ends explicitly state their policies, rather than
coasting through on back ends' default behavior.
In practice, all our front ends have very similar defaults, so provide a utility
function on `Module` to apply these rules. Use this utility function in the
SPIR-V and WGSL front ends; GLSL seems to already fill in interpolation as
required.
* Add struct instantiation support to wgsl-in
* Readd type matching and move struct test
* rebase onto master and update tests
* Update tests to upstream
* Fix merge errors
* Rebase onto master
* [wgsl-in] delay composite type creation
* Use the new WGSL construction syntax in the tests
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
* Impl `Hash` for `msl::Options`
* Remove ordered float
* [msl] derive everything on Options manually
* [msl] switch from Arena to Vec for the options
* Fix the clippy error by allowing derive_hash_xor_eq
* Fix skybox test
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
Add a Option<u16> to the snapshot `Params` to let snapshots request specific
Desktop GLSL versions. The default is GLSL ES 3.10.
It would be more general to let the params select any GLSL version, but that
would entail making glsl::Version implement Deserialize and all that, which
seems like overkill.
Use `back::glsl::features::FeaturesManager` to detect which qualifiers the given
module actually uses, and check them against the requested GLSL version.
The `linear` and `sample` qualifiers for fragment shader inputs are not
supported in all versions of GLSL that Naga can generate.
Non-exhaustive matches on `Expression` make it harder to review changes that add
new enum variants, because the compiler can't tell you that you've missed a
case.
Although I believe Clippy is able to do so, I don't think we should make a
blanket rule of forbidding wildcard match arms against `Expression`. There are a
few matches that are only concerned with a handful of variants, or a single
variant. For example, variant, naga::front::spv::Parser::next_block is only
concerned with whether an expression is a constant or not. In principle, these
sites should also be checked when adding a new variant, but it seems too
burdensome to require them to list all the `Expression` variants they don't care
about. The principle should be applied only to matches that are already handling
most variants.
At the moment, there is only one such match on `Expression` in the code base,
and it's only missing a few variants, so this is quick to fix.
The snapshot files in tests/out start with headers like this:
---
source: tests/snapshots.rs
expression: dis
---
; SPIR-V
; Version: 1.0
; Generator: rspirv
...
The Makefile's `validate-foo` targets trim off those lines with `tail -n +5`
before submitting their test to the validators.
However, some versions of the `insta` crate seem to generate headers with an
extra blank line, like this:
---
source: tests/snapshots.rs
expression: dis
---
This makes the `validate-foo` targets unhappy.
This commit changes the `validate-foo` targets to use `sed` to cope with both
kinds of headers.