Require at least version 0.7.1 of ron, this version changed how floating points are
serialized by forcing them to always have the decimal part, this makes it backwards
incompatible with our tests because we do a syntatic diff and not a semantic one.
Some functions like abs only accept signed integers while naga's IR
accepts both signed and unsigned integers, this wasn't accounted for in
the glsl backend causing it to produce code that wouldn't type check.
This commit addresses it by performing casts from uint to int of the
function argument and then back from int to uint for the function
return.
GLSL allows the last case of a switch statement to not have a `break`
statement causing it to be marked as fall-trough, naga's IR on the other
hand doesn't allow the last case to be fall-trough, this is fixed by
force marking it in the glsl frontend as not fall-trough.
GLSL also allows empty switch statements and without default cases,
naga's IR requires there be a default case, this is fixed by adding an
empty default case in the glsl frontend if no default case was present
in the switch statement.
Glsl defines two overloads for smoothstep that accept `min` and `max` as
scalars and the value as a vector, naga's IR is stricter and only allows
operators with the same dimensions, so this inputs must be splatted.
The conversion from sampled images to depth changed the `argument` type
but didn't change the `parameter` type (`argument` without pointer
indirection) causing 2+ deep propagation of depth images with function
arguments to fail.
Introduce a new `TypeFlags::CONSTRUCTIBLE` flag, corresponding to
WGSL's "constructible types". Set this on the appropriate types.
Check for this flag on function return types.
Add `valid::Capabilities` flags for the `ClipDistance` and
`CullDistance` builtins, which are not supported by all back ends.
Have the CLI perform valation with only those capabilities that the
requested back ends support.
Fixes#1961.
The previous check compared rows to rows and columns to columns but
multiplication of matrices only needs the columns of the left matrix to
be equal to the rows of the right matrix.
* glsl-out: Implement bounds checks for `ImageLoad`
* Enable image bounds check snapshot tests for GLSL.
In addition to the snapshot.rs changes, this entails adding an entry
point function to `bounds-check-image-restrict.wgsl` and
`bounds-check-image-rzsw.wgsl`, including appropriate data in the
param.ron files.
* Apply comments
Snapshot test changes:
Co-authored-by: Jim Blandy <jimb@red-bean.com>