Commit Graph

1708 Commits

Author SHA1 Message Date
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
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
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
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
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
Wumpf
717c2d73e7 Add CONSERVATIVE_RASTERIZATION native feature (#1263)
* Add CONSERVATIVE_RASTERIZATION native feature

* update gfx to cd3042d8c02d9dc7fc74ac8c292099c9789f6d43

* error for polygon mode not fill +conservative raster
2021-03-14 20:43:02 -04:00
bors[bot]
5e15980bb5 Merge #1262
1262: Update to naga-14 r=kvark a=kvark

**Connections**
Depends on https://github.com/gfx-rs/naga/pull/552 and https://github.com/gfx-rs/gfx/pull/3675

**Description**
Just an update of Naga

**Testing**
Tested on wgpu-rs examples

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-14 05:28:46 +00:00
Dzmitry Malyshau
280c066e65 Update to naga-14 2021-03-14 00:27:57 -05:00
bors[bot]
7af0f3137d Merge #1258
1258: Lint all the things r=kvark a=kvark

**Connections**
Fixes #1250

**Description**
Refactors the code to satisfy the linter, configures it, and enables on CI.

**Testing**
`cargo clippy` saves the dau

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-12 17:40:57 +00:00
Dzmitry Malyshau
231bba03a1 Lint all the things 2021-03-12 12:39:04 -05:00
bors[bot]
763c14a6d9 Merge #1254
1254: Fix swapchain resize in the player r=kvark a=kvark

**Connections**
Fixes 1253

**Description**
I was fixing this recently, and I'm not sure how it worked, because there is a big inner `loop` that I didn't notice before 😅 .
So now we exit the inner loop upon resize.

**Testing**
Tested on the supplied API trace

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-10 20:37:37 +00:00
Dzmitry Malyshau
eef4a75454 Fix swapchain resize in the player 2021-03-10 15:34:21 -05:00
bors[bot]
0fa52d3826 Merge #1252
1252: Fix Vulkan Portability check r=kvark a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-10 05:23:59 +00:00
Dzmitry Malyshau
80fe0d8fdd Fix Vulkan Portability check 2021-03-10 00:23:09 -05:00
Anthony Cowley
f01feacc2e Update gfx and naga to gfx-13 tag (#1248)
* wgpu-core: update gfx-hal usage related to sparse resources

* wgpu-core: support naga gfx-13

* Update gfx and naga dependencies to gfx-13 tag

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-10 00:04:16 -05:00
bors[bot]
6f49f041d3 Merge #1251
1251: Don't panic on pipeline creation errors r=kvark a=kvark

**Connections**
Related to Gecko crashes.

**Description**
We shouldn't ever panic in `wgpu`. The panic can only occur if there is internal inconsistency. For any invalid workloads, submitted by the user, we should produce errors instead.

**Testing**
Not tested

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-10 03:29:52 +00:00
Dzmitry Malyshau
4f7cd45ea7 Don't panic on pipeline creation errors 2021-03-09 22:24:57 -05:00
bors[bot]
37dbe5e32e Merge #1247
1247: Add license to the memory init tracker r=kvark a=kvark

**Connections**
Gecko's code lints complain...

**Description**
Add a license header like all the other files

**Testing**
should work!

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2021-03-04 15:43:42 +00:00
Dzmitry Malyshau
11af3d1286 Add license to the memory init tracker 2021-03-04 10:42:18 -05:00
bors[bot]
02f2d49ec0 Merge #1246
1246: Fix link to the "debugging tips" page r=kvark a=maroider

**Description**
The link was broken.

**Testing**
I used the link :P


Co-authored-by: Markus Røyset <maroider@protonmail.com>
2021-03-04 15:12:35 +00:00
Markus Røyset
c6b2f89254 Fix link to the "debugging tips" page 2021-03-04 11:03:52 +01:00
bors[bot]
b4672c1ef2 Merge #1245
1245: Trace pipeline creation before it actually happens r=kvark a=kvark

**Connections**
Fixes #1174

**Description**
We want to add descriptors to the trace before panicking if anything goes wacky.

**Testing**
tested on wgpu-rs examples

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-04 01:00:47 +00:00
Dzmitry Malyshau
10245cece9 Early tracing of swapchain-related things, clean up the hub API 2021-03-03 19:59:29 -05:00
Dzmitry Malyshau
fb1b98ebb1 Early tracing of the other device things 2021-03-03 17:24:09 -05:00
Dzmitry Malyshau
20bcb44c85 Early tracing of buffer, texture, and view creation 2021-03-03 16:54:38 -05:00
Dzmitry Malyshau
7c1db12cdc Refactor implicit BGLs to support early tracing 2021-03-03 16:48:23 -05:00
Dzmitry Malyshau
f7e1304c38 Expose CA surface creation 2021-03-03 15:43:55 -05:00
Dzmitry Malyshau
199e7e5f3b Trace pipeline creation before it actually happens 2021-03-03 15:18:48 -05:00
bors[bot]
c3e95273ff Merge #1243
1243: Force-drop the token before calling fire_map_callbacks r=kvark a=kvark

**Connections**
Related to WebGPU update in Gecko

**Description**
Since the token was alive, technically, we saw an assertion firing up about concurrent access to the token root.

**Testing**
Tested in Gecko

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2021-03-02 19:12:58 +00:00
bors[bot]
8a5668e0da Merge #1241
1241: Update Extent3d::depth and Limits to latest upstream r=grovesNL a=kvark

**Connections**
- https://github.com/gpuweb/gpuweb/pull/1390
- https://github.com/gpuweb/gpuweb/pull/1328
- https://github.com/gpuweb/gpuweb/pull/1163
- https://github.com/gpuweb/gpuweb/pull/1274

**Description**
Just an API update up to spec.

**Testing**
Tested on wgpu-rs examples

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-02 04:09:19 +00:00
Dzmitry Malyshau
d20ab66741 Force-drop the token before calling fire_map_callbacks 2021-03-01 16:34:07 -05:00
Dzmitry Malyshau
62ca24580d Add limits for textures sizes and vertex imputs 2021-03-01 12:10:40 -05:00
Dzmitry Malyshau
103e7763a3 Rename depth to depth_or_array_layers 2021-03-01 11:08:17 -05:00
bors[bot]
3bb2835fb5 Merge #1240
1240: Fix issue with multiple queued mappings where the last one is not cancelled r=kvark a=Imberflur


**Connections**
Follow up from #1239

**Description**
In #1239 I missed the case where there are multiple rounds of mapping/unmapping with the last map not being cancelled. In practice it doesn't occur very often, but I did encounter it with settings/a scene that created a heavy GPU load.

Sorry for not catching this earlier!

**Testing**
Using `wgpu-rs` capture example, after the first `map_async` I added in an `unmap` followed by another `map_async`.
<!--
Non-trivial functional changes would need to be tested through:
  - [wgpu-rs](https://github.com/gfx-rs/wgpu-rs) - test the examples.
  - [wgpu-native](https://github.com/gfx-rs/wgpu-native/) - check the generated C header for sanity.

Ideally, a PR needs to link to the draft PRs in these projects with relevant modifications.
See https://github.com/gfx-rs/wgpu/pull/666 for an example.
If you can add a unit/integration test here in `wgpu`, that would be best.
-->


Co-authored-by: Imbris <imbrisf@gmail.com>
2021-03-01 03:53:57 +00:00
Imbris
2c153f5d50 Fix issue with multiple queued mappings where the last one is not cancelled 2021-02-28 00:56:17 -05:00
bors[bot]
ecbddedfaf Merge #1239
1239: Avoid panic when requesting to unmap a buffer that is pending mapping r=kvark a=Imberflur

**Connections**
Fix for #1238 

**Description**
This might not be the cleanest fix but it is quite minimal. I'm not sure what the exact intent is with the organization of things and with the async status enum, would be happy to hear critiques.

**Testing**
Tested against example in #1238 
<!--
Non-trivial functional changes would need to be tested through:
  - [wgpu-rs](https://github.com/gfx-rs/wgpu-rs) - test the examples.
  - [wgpu-native](https://github.com/gfx-rs/wgpu-native/) - check the generated C header for sanity.

Ideally, a PR needs to link to the draft PRs in these projects with relevant modifications.
See https://github.com/gfx-rs/wgpu/pull/666 for an example.
If you can add a unit/integration test here in `wgpu`, that would be best.
-->


Co-authored-by: Imbris <imbrisf@gmail.com>
2021-02-28 03:18:35 +00:00
Imbris
c82a3a77d2 Avoid panic when requesting to unmap a buffer that is pending mapping 2021-02-27 17:38:53 -05:00
bors[bot]
c3a18c3d8b Merge #1235
1235: Update VertexFormat variants r=grovesNL a=kvark

**Connections**
Matches https://github.com/gpuweb/gpuweb/pull/1322 and https://github.com/gpuweb/gpuweb/pull/1469

**Description**
Just updates us to recent upstream API.
Also breaks lots of user code!

**Testing**
Not functional


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-27 16:05:04 +00:00
bors[bot]
29058e03b0 Merge #1237
1237: Move `#[error]` attributes after the corresponding `#[derive]` r=kvark a=Aaron1011

**Connections**
See https://github.com/rust-lang/rust/issues/79202

**Description**
Fixes Nightly future-incompat warnings

**Testing**
There are no behavior changes intended.

Co-authored-by: Aaron Hill <aa1ronham@gmail.com>
2021-02-26 01:09:41 +00:00
bors[bot]
39aa01d1b1 Merge #1236
1236: Update gfx to 0a201d1c406b5119ec11068293a40e50ec0be4c8 r=kvark a=Aaron1011

**Connections**
wgpu issue: #246
GFX PR: https://github.com/gfx-rs/gfx/pull/3653
Underlying libloading issue: https://github.com/nagisa/rust_libloading/issues/41

**Description**

Pulls in https://github.com/gfx-rs/gfx/pull/3653,
which fixes a segfault when using wgpu from a non-main thread.

**Testing**

The example in https://github.com/gfx-rs/wgpu/issues/246 should run successfully. I'm not certain how to add an integration test to the repository.

Co-authored-by: Aaron Hill <aa1ronham@gmail.com>
2021-02-26 01:03:12 +00:00
Aaron Hill
12b086d92d Move #[error] attributes after the corresponding #[derive]
This fixes Nightly warnings

See https://github.com/rust-lang/rust/issues/79202
2021-02-25 15:40:11 -05:00
Dzmitry Malyshau
cf165f9a3e Update VertexFormat variants 2021-02-25 15:25:56 -05:00
Aaron Hill
8b4bec5d9a Update gfx to 0a201d1c406b5119ec11068293a40e50ec0be4c8
Fixes #246

Pulls in https://github.com/gfx-rs/gfx/pull/3653,
which fixes a segfault when using wgpu from a non-main thread.
2021-02-25 15:25:40 -05:00