Commit Graph
8897 Commits
Author SHA1 Message Date
bors[bot]andDzmitry Malyshau e913cefcc6 [rs] Merge #768
768: Update naga to gfx-12 r=kvark a=kvark

See https://github.com/gfx-rs/wgpu/pull/1226

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-21 17:07:53 +00:00
Dzmitry Malyshau cb58bc214d [rs] Update naga to gfx-12 2021-02-21 12:07:26 -05:00
bors[bot]andDzmitry Malyshau 2d0142a2e7 Merge #1226
1226: Update gfx and naga to gfx-12 r=kvark a=kvark

**Connections**
Picks up https://github.com/gfx-rs/gfx/pull/3650
Fixes #1225

**Description**
Also fixes our playtests, interestingly. One of the changes here was that now `Analysis` is needed for everything, including the SPV-out backend of Naga. And we can only get it via validating the `naga::Module`.

What we used to was: if validation isn't enabled, we'd carry the module around, and then still try to produce a SPIR-V from it, if there is no original SPIR-V. This precise thing was happening in the tests. However, we had `dummy` backend depending on the `wgpu-core/cross` feature, which means the playtests were actually built and run with spirv-cross enabled!
Another factor here is the introduction of `ShaderModule::flags` instead of a single boolean, which was done in #1093. The problem here was that the playtest RON files weren't updated accordingly, they still had `experimental_translation: true` in them, which got ignored now.
So with this combination of events, the playtests ended up generating SPIR-V from Naga modules, without validation(!), and passing the SPIR-V to gfx-rs and SPIRV-Cross... Which still worked, as we'd expect, but definitely not want here.

So this PR fixes everything. It makes it required to have the validation for a module, and we force-validate if there is no SPV source to fall back on. And it disables "cross" feature implicitly enabled in testing.

**Testing**
Tested on wgpu-rs examples.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-21 16:36:54 +00:00
Dzmitry Malyshau 91f5329b33 Update gfx and naga to gfx-12 2021-02-21 11:25:45 -05:00
Matúš Talčík fa7d4d8b51 spv-in: fix if condition when merge node == false node
format
2021-02-20 10:41:54 -05:00
Dzmitry Malyshau 2a5c478b21 Fix type resolves of matrix by vectors 2021-02-20 00:02:28 -05:00
Dzmitry Malyshau f03a99d6a3 Implement Debug for arena and handle 2021-02-19 23:20:11 -05:00
Dzmitry Malyshau 26e6c2bdac Use source attribute of errors 2021-02-19 22:10:25 -05:00
Dzmitry Malyshau 99c1add358 [msl] fake bindings 2021-02-19 19:20:21 -05:00
Dzmitry Malyshau 0e3f745fb2 [msl] derive thiserror 2021-02-19 16:56:45 -05:00
Dzmitry Malyshau db0a8875d9 TypifyError with the expression handle 2021-02-19 16:56:45 -05:00
bors[bot]andDzmitry Malyshau c0b217a273 [rs] Merge #766
766: Blend state API update r=kvark a=kvark

Based on https://github.com/gfx-rs/wgpu/pull/1224

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-19 21:16:58 +00:00
Dzmitry Malyshau 5c680a1629 [rs] Blend state API update 2021-02-19 16:16:19 -05:00
bors[bot]andDzmitry Malyshau 53bab9d68f Merge #1224
1224: Update the blend API to upstream r=kvark a=kvark

**Connections**
Matches https://github.com/gpuweb/gpuweb/pull/1134

**Description**
Makes blending state ON/OFF explicit.

**Testing**
Simple enough!

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-19 17:38:16 +00:00
Dzmitry Malyshau ff31911760 Update the blend API to upstream 2021-02-19 12:07:47 -05:00
bors[bot]andDzmitry Malyshau b75f6118bb [rs] Merge #765
765: Update naga to gfx-11 r=cwfitzgerald a=kvark

Gets us https://github.com/gfx-rs/wgpu/pull/1220

Note that "cross" feature is not optional here. We could lift it up and add to `default = []` but that would make the Web backend to always unconditionally depend on `wgpu-core` (since enabling a feature on it automatically enables it). So we ideally need a way for Cargo to allow platform-specific default features...

About the shadow example - the experimental translation works on the main pipeline, but fails on the baking pipeline because of https://github.com/gfx-rs/naga/issues/483. Fortunately, it falls back to SPIRV-Cross gracefully here.

The new validation detected a flaw in our shader (comparison sampler mismatch), yay!

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-19 05:03:27 +00:00
João Capucho 19e7f456c4 Remove the call graph processor
Uses the GlobalUse in glsl-out to check for function availability
2021-02-18 11:43:18 -05:00
Systemcluster 9f113bdd95 [wgsl] limit allowed for statement initializer statements 2021-02-18 10:55:16 -05:00
Systemcluster e49910bb0a [wgsl] allow empty for statement headers 2021-02-18 10:55:16 -05:00
Dzmitry Malyshau 5f21cf360f Refactor snapshot testing to include some IR 2021-02-18 10:19:25 -05:00
Dzmitry Malyshau 4c5a1ba054 Global usage tests in the analyzer 2021-02-17 16:22:19 -05:00
Dzmitry Malyshau 8a0382a89d Move global use flags into FunctionInfo 2021-02-17 15:37:37 -05:00
Pelle Johnsen 9f0cdfe9e5 [glsl-in] Multi entry, don't use find on hashmap 2021-02-17 10:05:40 -05:00
Pelle Johnsen 408002815f [glsl-in] Multi entry points - address comments 2021-02-17 10:05:40 -05:00
Pelle Johnsen 1861fca4ba [glsl-in] Support multiple entrypoints 2021-02-17 10:05:40 -05:00
Systemcluster dea3e0e1e1 Add MIT license 2021-02-17 09:34:17 -05:00
Systemcluster 59479f137d [wgsl] support nested type parameters 2021-02-16 16:57:34 -05:00
Dzmitry Malyshau 06b04a49e9 [rs] Update naga to gfx-11 2021-02-16 10:55:29 -05:00
Systemcluster 321420c019 Set default SPIR-V version in convert example 2021-02-16 10:25:02 -05:00
bors[bot]andDzmitry Malyshau 5afe832c3c Merge #1220
1220: Update naga to gfx-11, make spirv-cross optional r=kvark a=kvark

**Connections**
https://github.com/gfx-rs/gfx/pull/3642
https://github.com/gfx-rs/gfx/pull/3641

**Description**
Gets us the latest Naga updates, plus the ability to make spirv-cross optional (on Linux and Windows only for now).

**Testing**
Will be tested on wgpu-rs

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-16 15:24:03 +00:00
Dzmitry Malyshau fdd50e10fd Update naga to gfx-11 2021-02-16 09:46:22 -05:00
Dzmitry Malyshau 847d127ec8 Optimize Interface with a bitmask to avoid re-visiting expressions 2021-02-16 09:08:05 -05:00
Dzmitry Malyshau e37268e60c [msl] fix support for private globals 2021-02-16 09:08:05 -05:00
Dzmitry Malyshau 35ba4dac66 Fix the ClipDistance validation - expect an array 2021-02-16 09:08:05 -05:00
Systemcluster 539db1a317 [wgsl] support for statement 2021-02-15 23:51:19 -05:00
Dzmitry Malyshau e6251a23fe [wgsl] fix boolean types and bang parsing 2021-02-15 22:59:04 -05:00
bors[bot]andDzmitry Malyshau 94ee3d6c33 Merge #1219
1219: Validate texture bindings r=cwfitzgerald a=kvark

**Connections**
It was mentioned/requested somewhere, but I can't find the place...

**Description**
Fairly straightforward - just check the view properties against the bind group layout.

**Testing**
Tested on wgpu-rs examples

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-16 02:42:23 +00:00
Dzmitry Malyshau 9bf47dd772 Validate texture bindings 2021-02-15 20:14:23 -05:00
Dzmitry Malyshau 91a1f581e0 Fix insta dependency to 1.5.2 2021-02-15 11:13:11 -05:00
Dzmitry Malyshau 6d0c608626 [glsl-out] use existing Analysis instead of implementing Visitor 2021-02-15 11:13:11 -05:00
Joshua Groves f42dc0c377 Fix some typos 2021-02-14 22:50:12 -05:00
Dzmitry Malyshau ad423124c0 Support constants in the naming processor 2021-02-14 20:43:50 -05:00
Dzmitry Malyshau 61d711b58f Remove the Header from IR 2021-02-14 20:23:31 -05:00
Systemcluster 7a124550d4 [glsl-in] support inverse function 2021-02-14 12:34:26 -05:00
Systemcluster b642c5b89b [spv-in] support string instruction 2021-02-14 11:57:26 -05:00
Systemcluster dcd269782a [wgsl] restrict type casts to matching container types 2021-02-14 11:56:49 -05:00
Dzmitry Malyshau 18853ab149 Add warnings for trivial casts and clean them up in the code 2021-02-14 11:55:35 -05:00
Dzmitry Malyshau 8e96085caf [spv-in] support image load/store ops 2021-02-14 11:55:35 -05:00
Dzmitry Malyshau de5bd77279 ImageStore statement in IR 2021-02-14 11:55:35 -05:00
Systemcluster 5de69f7276 Specify line endings in ron snapshot tests 2021-02-14 11:29:25 -05:00