Commit Graph

9013 Commits

Author SHA1 Message Date
Dzmitry Malyshau
332de311e0 [rs] Update naga to gfx-17 2021-03-19 16:36:30 -04:00
bors[bot]
c831c5512a Merge #1273
1273: Properly return native shader module errors to users r=kvark a=Gordon-F

**Testing**
Disable `cross` feature, break `naga` and see what happens 😄 

```log
wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
    Internal error in stage VERTEX: Error compiling the shader "\"Compilation failed: \\n\\nprogram_source:1:1: error: unknown type name \\\'sadgasdgasdgasdg\\\'\\nsadgasdgasdgasdg aasdgadsgb>\\n^\\nprogram_source:1:28: error: expected \\\';\\\' after top level declarator\\nsadgasdgasdgasdg aasdgadsgb>\\n   
```



Co-authored-by: Gordon-F <ishaposhnik@icloud.com>
2021-03-19 18:13:28 +00:00
Gordon-F
d20c0199d7 Properly return native shader module errors to users 2021-03-19 21:09:54 +03:00
bors[bot]
92936954d8 Merge #1274
1274: Update naga to gfx-17 r=kvark a=kvark

**Connections**
Includes https://github.com/gfx-rs/gfx/pull/3688

**Description**
Here comes the "gfx-17" naga train!

**Testing**
Tested on wgpu-rs examples

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2021-03-19 17:44:28 +00:00
Dzmitry Malyshau
c52dad9d47 Update naga to gfx-17 2021-03-19 13:43:11 -04:00
Dzmitry Malyshau
d5fbb193c3 Validate Select and Relational expressions 2021-03-19 10:39:54 -04:00
Dzmitry Malyshau
c2f70aaf80 Validate binary expressions 2021-03-19 10:39:54 -04:00
Dzmitry Malyshau
daab319dc0 Validate Expression::Compose 2021-03-19 10:39:54 -04:00
bors[bot]
a2d8e10c7d [rs] Merge #792
792: Use implicit layout for hello-compute r=kvark a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-19 14:34:13 +00:00
bors[bot]
b3bc3d02e0 [rs] Merge #803
803: Shader fixes with binary expressions r=kvark a=kvark

Goes along with https://github.com/gfx-rs/naga/pull/599

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2021-03-19 05:36:54 +00:00
Dzmitry Malyshau
b9c60811f8 [rs] Shader fixes with binary expressions 2021-03-19 01:34:19 -04:00
Dzmitry Malyshau
d58f9bdfde Merge sample mask in/out builtins 2021-03-18 21:57:48 -04:00
Dzmitry Malyshau
67ca0e7e7f First bits of expression validation 2021-03-18 11:43:00 -04:00
Dzmitry Malyshau
72ede02888 Reduce the typifier error sizes 2021-03-18 10:26:26 -04:00
Dzmitry Malyshau
8c4598a141 [msl-out] test put_expession stack footprint in debug
Also change io::Error to fmt::Error
2021-03-18 10:26:26 -04:00
Dzmitry Malyshau
6e71366bd3 Test typifier error sizes 2021-03-18 10:26:26 -04:00
bors[bot]
c45ea6f5b1 [rs] Merge #800
800: Schedule event waits after redraw events are cleared r=kvark a=kvark

As @adamnemecek pointed out, our examples were busy waiting.
I investigated a bit and figured that our `WaitScheduled` was always interrupted by `RedrawEventsCleared`. So scheduling the wait in it works. Tested on Linux and macOS. CPU time of the cube example drops from 100% to single-digit.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-18 03:00:21 +00:00
Dzmitry Malyshau
070688a84d [rs] Schedule event waits after redraw events are cleared 2021-03-17 22:58:35 -04:00
Dzmitry Malyshau
dd2cd92331 [msl-out] fix varying input structures 2021-03-17 16:59:23 -04:00
Dzmitry Malyshau
f18728ed92 Enable more SPIR-V capabilities in the frontend 2021-03-17 16:33:21 -04:00
bors[bot]
ba6015e2c7 Merge #1272
1272: Add sample count to framebuffer key r=kvark a=kvark

**Connections**
Fixes #1271

**Description**
The framebuffer is created for a pass, so naturally the hashmap key for a framebuffer has to include the pass key. Otherwise, we'd be overwriting the framebuffer entry, or using a framebuffer from a different pass. The sample count was missing from our FB key.

**Testing**
Tested on a trace from #1271 that I hand-ported to latest master.

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2021-03-17 16:15:30 +00:00
Dzmitry Malyshau
9673635125 Add sample count to framebuffer key 2021-03-17 12:13:11 -04:00
Dzmitry Malyshau
9390aa472d [glsl-out] make varying names to match 2021-03-17 10:37:10 -04:00
bors[bot]
0542ad585a [rs] Merge #798
798: Fix all the clippy lints r=kvark a=HalfVoxel

Clippy is now happy

Co-authored-by: Aron Granberg <aron.granberg@gmail.com>
2021-03-17 14:02:03 +00:00
Aron Granberg
162fe18e7d [rs] Fix all the clippy lints and add clippy/fmt CI 2021-03-17 14:40:25 +01:00
Gordon-F
6736bcefa6 [glsl-out] Explicitly set location bindings 2021-03-17 09:40:06 -04:00
bors[bot]
af38afd58d [rs] Merge #799
799: Update naga to gfx-16 r=kvark a=kvark

Makes WGSL constants much more ergonomic to write, and fixes the issues we had with the water example.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-17 13:37:45 +00:00
Dzmitry Malyshau
2fae02d8b2 [rs] Update naga to gfx-16 2021-03-17 09:35:54 -04:00
bors[bot]
f89244e3c3 [rs] Merge #797
797: Move from `tracing` to `log` + `profiling` r=kvark a=cwfitzgerald

Continuation of https://github.com/gfx-rs/wgpu/pull/1268 into wgpu-rs

This also includes the naga gfx-15 train.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-03-17 13:17:03 +00:00
Aron Granberg
aa45e7668b [rs] Fix excessive buffer padding (#795)
* Fix excessive buffer padding

* Prettify

* cargo fmt

* Simplify code

* Style
2021-03-17 09:09:58 -04:00
bors[bot]
bb9a5a85d2 Merge #1270
1270: Update naga to gfx-16 r=kvark a=kvark

**Connections**
Picks up https://github.com/gfx-rs/gfx/pull/3684

**Description**
Just an update

**Testing**
Tested on wgpu-rs examples

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-17 13:08:07 +00:00
Dzmitry Malyshau
b97f5a5b24 Update naga to gfx-16 2021-03-17 09:07:08 -04:00
Connor Fitzgerald
3a131f5f60 [rs] Move from tracing to log + profiling 2021-03-17 01:34:38 -04:00
bors[bot]
2f3b398e38 Merge #1268
1268: Move from `tracing` to `log` + `profiling` r=kvark a=cwfitzgerald

**Connections**

Fixes #1211. Fixes #1189.

**Description**

Moves from `tracing` to `log` + `profiling`. I also removed some of the offending spans that were only for pushing commands onto a vector of commands.

**Testing**

Tested on wgpu-rs

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-03-17 05:30:36 +00:00
Connor Fitzgerald
cf6f9c3ca8 Move from tracing to log + profiling 2021-03-17 01:22:30 -04:00
Dzmitry Malyshau
a17ae022c6 Make analysis errors carry the function handle 2021-03-17 01:03:00 -04:00
Dzmitry Malyshau
665ac49a01 Show expression uniformity in the Dot backend 2021-03-17 01:03:00 -04:00
Dzmitry Malyshau
e3818bb236 [spv-in] fix treating OpPhi variables as pointers 2021-03-17 01:03:00 -04:00
Dzmitry Malyshau
e715bda507 [msl-out] implement composing arrays and structs 2021-03-17 01:03:00 -04:00
Dzmitry Malyshau
9846a85174 [spv-in] patch calls from the entry points 2021-03-16 22:08:06 -04:00
Dzmitry Malyshau
c5fe1d53c7 [dot] function calls 2021-03-16 22:08:06 -04:00
Dzmitry Malyshau
259a56761f Consider dynamic arrays to have at least 1 element for the layout 2021-03-16 22:08:06 -04:00
Dzmitry Malyshau
2b888e4c09 Detect the forward function calls 2021-03-16 22:08:06 -04:00
bors[bot]
5d993efc85 Merge #1267
1267: Update naga to gfx-15 r=kvark a=kvark

**Connections**
Fixes #1228 (huge DX12 leak in command allocation)
Includes https://github.com/gfx-rs/gfx/pull/3676, https://github.com/gfx-rs/gfx/pull/3679, https://github.com/gfx-rs/gfx/pull/3680, https://github.com/gfx-rs/gfx/pull/3681, and the relevant Naga stuff.

**Description**
Updates Naga and gfx.

**Testing**
Tested on wgpu-rs examplse

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-16 17:07:20 +00:00
Luca Casonato
82932d1f59 chore: validate offset + size in get_mapped_range (#1266)
* chore: validate offset + size in get_mapped_range

This commit introduces out of bounds & offset validation for
buffer_get_mapped_range, like described in the WebGPU spec. See
https://gpuweb.github.io/gpuweb/#dom-gpubuffer-getmappedrange.

Closes #818

* review comments

* fmt

* fix test

* fix tests

* update error message

* review comment

* use wgt::BufferAddress

* clippy
2021-03-16 13:00:44 -04:00
Dzmitry Malyshau
3b1b11f441 Update naga to gfx-15 2021-03-16 12:52:32 -04:00
Dzmitry Malyshau
196523de78 Add v0.4 changelog 2021-03-15 22:34:56 -04:00
Dzmitry Malyshau
7de42d6f68 Don't panic too fast on failed analysis 2021-03-15 22:34:56 -04:00
Wumpf
2bda1508f1 [rs] Added example for conservative rasterization (#791)
* Example for conservative rasterization

* Update to wgpu-core/types 717c2d73e7

* conservative-raster example: fix wglsl const & readme

* conservative raster example: optional lines, no more interaction
2021-03-15 22:33:44 -04:00
Dzmitry Malyshau
08eaad89db Implement default layout in the IR and WGSL 2021-03-15 22:27:35 -04:00