1332: Validate min/max blending factors r=kvark a=kvark
**Connections**
Based on #1325
Matches https://github.com/gpuweb/gpuweb/pull/1635
**Description**
This PR refactors the color state errors, giving them more detailed context, and having a dedicated enum for them.
It also adds the check for the blend factors to be (1, 1) for the min/max operations.
**Testing**
Untested
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1341: Mark unused implicit BGL ids as vacant r=kvark a=kvark
**Connections**
Fixes https://github.com/gfx-rs/wgpu/issues/1340
**Description**
This is not an ideal solution. We aren't marking the IDs as errors. But it's an improvement, and it resolves the crash in FF, supposedly.
**Testing**
Tested on wgpu-rs examples with implicit layouts
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
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.
1331: Validate filtering r=cwfitzgerald a=kvark
**Connections**
See https://github.com/gpuweb/gpuweb/pull/1223
**Description**
This PR implements validation of sampler filtering (property in BGL), as well as the ability to filter non-filterable textures.
**Testing**
Untested
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1325: Relax and imporve vertex attribute validation r=cwfitzgerald a=kvark
**Connections**
None
**Description**
Improves our validation of vertex attributes in the following ways:
1. Relaxes the size matching, so that we allow the shaders to default some of the values we don't provide
2. Require interpolation to match
3. Make the error messages more detailed:
> In Device::create_render_pipeline
error in stage VERTEX
error matching the stage input at 1 (Uint32x2 interpolated as None) against the previous stage outputs
input type is not compatible with the provided Float32x2
**Testing**
Tested on wgpu-rs examples.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
* 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.
861: Remove glslangvalidator requirements from water example r=kvark a=Gordon-F
`glslangvalidator` is no longer needed because the example uses WGSL.
Co-authored-by: Igor Shaposhnik <Gordon-F@users.noreply.github.com>
859: Fix typos - it's -> its r=cwfitzgerald a=ashpil
As I was reading the documentation, I found an instance where "it's" should actually be "its", as it is used as a possessive, not a contraction. I fixed that and `grep`ed for other instances, of which I found one and fixed as well.
Co-authored-by: ashpil <shpilenok2001@gmail.com>