Change the validator to enforce WGSL's requirement that all variables
in the `function` and `private` address spaces must have constructible
types.
Mark the `RayQuery` type as `CONSTRUCTIBLE`, since it is intended to
be used for local variables.
Add a regression test.
Change printlns in the backend functions to say "generating" instead
of "writing" before calling the Naga backends. "Writing" suggests
writing output to a file; "generating" seems more accurate for calling
a backend.
Add a new type, `Input`, representing a particular Naga input file,
with methods to generate related paths - output files with a
particular extension, parameter files, and the input file itself.
Use this throughout `snapshots.rs` to generate paths.
Give `Input` utility methods for reading and writing files.
Rather than adding a `-glsl` suffix to the name, just rely on
`check_targets`' standard naming behavior, treating
`tests/in/variations.glsl` like any other snapshot input.
Remove the call to `Validator::validate` in `convert_spv`, since it
directly follows the call to `check_targets`, which also called
`Validator::validate`.
The only difference between the two is whether `Parameters::god_mode`
is respected, but this difference doesn't seem to have been
deliberate: at the time the call to `check_targets` was added to
`convert_spv` (5f21cf360, 2021-02-17), the two calls were exactly the
same.
Use `FastIndexSet`, rather than `FastHashSet`, for tracking global
declarations' dependencies, so that the order in which functions are
inserted into the `Module` is not dependent on the hash function.
Add a new Naga feature, `"compact"`, which adds a new function
`naga::compact::compact`, which removes unused expressions, types, and
constants from a `Module`.
Re-implement `naga` development workflows using [`cargo xtask`]. Convert
`make` logic and shader test configuration as file with Bash variables
into an `xtask` crate and YAML files, respectively.
Pros:
* We now have a _portable_ workflow everywhere, which means Windows
folks and people who don't install `make` don't have to suffer.
😮💨
* Workflow logic is now relatively easy to inspect and change. Whew!
💁🏻♂️💦
* Contributors can use their existing Rust knowledge to contribute to
developer experience. 🎉
* `cargo xtask` is a relatively well-known convention for workflows in
the ecosystem.
* We can do fancy things like allow folks to run at different log levels
for workflows, depending on their tastes.
Cons:
* There's now a non-trivial compile step to project workflow.
Incremental rebuilds seem to be pretty short, though!
* Code is much more verbose than the (very) terse `make` implementation.
[`cargo xtask`]: https://github.com/matklad/cargo-xtask
There are a few keywords like "pass" in HLSL that are actually case-insensitive for FXC. This can be disabled with strict mode, but even if you do that FXC will continue to give an error if you try to use them in identifiers (at all, with any casing).
This changes the namer code to escape these keywords even if the casing is different.
If you're wondering where I got the list from: I looked at the list of strings in D3DCompiler_47.dll.