Commit Graph

1215 Commits

Author SHA1 Message Date
bors[bot]
6182495102
Merge #838
838: wait for buffer to be done in the player r=cwfitzgerald a=kvark

**Connections**
Fixes our code enough to replay #834 without issues. Doesn't help to solve the original problem though.

**Description**
There are two things in here:
  1. don't deduplicate the BGLs if we are not generating new IDs at this layer. This helps Servo/Gecko/player. cc @kunalmohan 
  2. have an option in `buffer_destroy` to *actually* kill it, at the cost of blocking on GPU sometimes. This is required for the player, since the very next command may try to reuse the ID.

**Testing**
Tested on the trace in #834 

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-24 22:57:04 +00:00
bors[bot]
645b43b0c7
Merge #839
839: Fix push constant pipeline invalidation r=kvark a=cwfitzgerald

**Connections**

Fixes #821

**Description**

We need to invalidate everything if push constants change. This code is kinda ugly but this is try three and it's the least terrible I got.

**Testing**

Pinging @Wumpf :)

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-07-24 22:26:30 +00:00
Connor Fitzgerald
b9498952a1 Fix push constant pipeline invalidation 2020-07-24 18:19:36 -04:00
bors[bot]
102d69eb58
Merge #832
832: Return errors from device functions r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Lots of changes, but they should be easily reviewable commit-by-commit.

- Error types for most of the fallible resource creation errors in `device/mod.rs`

- Removed assertions and replaced them with error types

- All of the `BufferMap`, `BufferNotMapped` etc. errors were united in a single `BufferAccessError`, since it was pretty weird to have so many overlapping error types.

- Removed all `unwrap`s of `gfx-hal` errors - they are now returned to the caller.

**Testing**
Checked with core and tested with `wgpu-rs` (see https://github.com/gfx-rs/wgpu-rs/pull/469)

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-24 20:43:56 +00:00
Gabriel Majeri
7cf9970121 Error handling for device functions 2020-07-24 22:56:51 +03:00
Dzmitry Malyshau
7e4ce4a4fe wait for buffer to be done in the player 2020-07-24 14:34:18 -04:00
bors[bot]
0591c48fd2
Merge #833
833: Switch pipeline flag to mutation of depth/stencil r=startoaster a=kvark

**Connections**
Reported on the matrix

**Description**
If the pass mutates depth/stencil, but the pipeline doesn't, it's not a bug!

**Testing**
on it...

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-24 02:26:50 +00:00
Dzmitry Malyshau
33d6eff6c9 Switch pipeline flag to mutation of depth/stencil 2020-07-23 22:24:21 -04:00
bors[bot]
8a2ee26fff
Merge #831
831: Carry RefCount in future suspects in order to prevent early removal r=cwfitzgerald a=kvark

**Connections**
Fixes  #830

**Description**
see https://github.com/gfx-rs/wgpu/issues/830#issuecomment-662825775

**Testing**
Tested on harmony + Sponza

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-23 16:09:02 +00:00
Dzmitry Malyshau
da34c918d3 Carry RefCount in future suspects in order to prevent early removal 2020-07-23 01:38:32 -04:00
bors[bot]
487e378653
Merge #829
829: Fix typo in BufferUsage docs r=kvark a=cwfitzgerald

**Connections**

A couple people have bugged me about this in the past.

**Description**

Docs were wrong, they are now right.

**Testing**

Read it again :)


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-07-23 02:38:23 +00:00
Connor Fitzgerald
308e72b521 Fix typo in BufferUsage docs 2020-07-22 20:55:08 -04:00
bors[bot]
ffc8251bc5
Merge #827
827: Make RenderBundleEncoder derive Debug r=kvark a=Andful

**Connections**
This pull request originated from https://github.com/gfx-rs/wgpu-rs/pull/466. This change is needed to make public types in `wgpu-rs` derive debug.

**Description**
Make RenderBundleEncoder derive Debug.

**Testing**


Co-authored-by: Andrea Nardi <buongiorno19972@gmail.com>
2020-07-22 20:14:20 +00:00
Andrea Nardi
e8a9d70a72 implemented Debug for RenderBundleEncoder
Signed-off-by: Andrea Nardi <buongiorno19972@gmail.com>
2020-07-22 18:29:42 +02:00
bors[bot]
685522cf59
Merge #826
826: Detach MultiRefCount from RefCount completely r=cwfitzgerald a=kvark

**Connections**
Fixes #823

**Description**
The old way of trying to mix the new `MultiRefCount` with bits of existing infra with `RefCount` was not correct at all. We'd get into a situation where the refcount was already deleted, but the object is alive, for example. This PR detaches them completely.
To clarify: it's not great at all that we have manual refcounting on BGLs. And this de-duplication crap caused much more trouble than it's worth...

**Testing**
Tested on the wonderful example provided by @tiberiusferreira

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-22 15:28:16 +00:00
Dzmitry Malyshau
0c00df71b8 Detach MultiRefCount from RefCount completely 2020-07-22 11:27:47 -04:00
bors[bot]
b904d1ee4a
Merge #825
825: Add depth clamping support r=cwfitzgerald a=kvark

**Connections**
Implements https://github.com/gpuweb/gpuweb/pull/900

**Description**
Depth clamping is useful for shadow mapping and stuff. We'd want to use it in our `shadow` example.

**Testing**
Untested, should work though :)

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-07-22 15:16:20 +00:00
bors[bot]
c970315ef4
Merge #824
824: Naga update, remove spirv_headers dependency r=cwfitzgerald a=kvark

**Connections**
Many changes went into Naga, including https://github.com/gfx-rs/naga/pull/81

**Description**
We'll get better SPIR-V parsing and even a bit of WGSL validation.

**Testing**
Working on it...

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-22 15:09:52 +00:00
Dzmitry Malyshau
82d149b871 Naga update, remove spirv_headers dependency 2020-07-22 11:05:42 -04:00
Dzmitry Malyshau
21be559a9f Add depth clamping support 2020-07-22 11:03:36 -04:00
Marvin Löbel
4ed2c0a313
Replace borrowed slices in Descriptor structs with copy on write slices (#822)
* Replace &[T] in descriptor structs with Cow<[T]>

* Changed label fields to use Cow<'a, str>

* Deduplicate types across the tracing API

Introduce the ToStatic trait

* Deduplicate trace::RenderBundleDescriptor

* Remove ugly ToOwned bounds

* Simplifiy Action variants

* Make Clone bounds on type defs less verbose

* Fix a error in play.rs

* Remove ToStatic, and Make Action<'a> borrow descriptors instead
2020-07-20 12:31:05 -04:00
bors[bot]
3c6ee8766a
Merge #816
816: Error types for buffer mapping API r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Adds safe error handling for buffer mapping/unmapping functions.

**Testing**
Checked with core, and ran tests with player.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-20 14:55:13 +00:00
bors[bot]
10c1f85e9a
Merge #819
819: swap_chain_present returns SwapChainStatus r=kvark a=rukai

**Connections**
Needed by https://github.com/gfx-rs/wgpu-rs/pull/452

**Description**
For `swap_chain_present` moves the PresentError cases out of the Err and into the Ok.
This means we can `.unwrap()` the result in wgpu and it will only panic on an error that the user cant handle.

**Testing**
Ran the wgpu-rs examples.


Co-authored-by: Rukai <rubickent@gmail.com>
2020-07-20 14:48:46 +00:00
Rukai
3fe9d8872f swap_chain_present returns SwapChainStatus 2020-07-20 21:13:22 +10:00
Gabriel Majeri
ec12d9547d Error types for buffer mapping API 2020-07-20 07:22:52 +03:00
bors[bot]
73b230871e
Merge #814
814: Error type for texture creation r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Creates an error type for texture creation functions.

**Testing**
Checked with core and player.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-20 00:16:56 +00:00
Gabriel Majeri
cbca43258f Convert MAX_MIP_LEVELS to u32 2020-07-19 20:42:33 +03:00
Gabriel Majeri
e53aa70b9a Error type for texture creation 2020-07-19 20:42:31 +03:00
bors[bot]
d73683e35e
Merge #813
813: Add buffer creation error type r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Adds an error type for the buffer creation functions.

**Testing**
Checked with core and ran test on player.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-19 17:19:01 +00:00
Gabriel Majeri
e4fd871f49 Unwrap error when trying to map buffer on creation 2020-07-19 06:43:01 +03:00
bors[bot]
1a647775ae
Merge #815
815: Remove error logging from `binding_model` r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Removes some `log::error!` calls from `binding_model.rs`, instead encoding the messages in the error type.

**Testing**
Checked with core.


Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-18 22:18:22 +00:00
bors[bot]
8cfe8bb56d
Merge #812
812: Error type for `WaitIdle` r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Adds an error type for the `wait_idle` function.

**Testing**
Checked with core.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-18 22:12:37 +00:00
Gabriel Majeri
1b563c8e3d
Safe error handling in instance module (#817)
* Safe error handling in instance module

* Revert alignment checks back to assertions
2020-07-18 18:11:04 -04:00
Gabriel Majeri
fc460f4eab Propagate WaitIdleError up through the API 2020-07-18 20:39:11 +03:00
bors[bot]
6ea8e3ec51
Merge #811
811: Error type for `command_encoder_finish` r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Makes `command_encoder_finish` return an error type.

**Testing**
Checked with core.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-18 16:55:31 +00:00
Gabriel Majeri
3d3cb2b55d Remove error logging from binding_model 2020-07-18 11:30:59 +03:00
Gabriel Majeri
2ac778b312 Add buffer creation error type 2020-07-18 11:12:15 +03:00
Gabriel Majeri
0ff7bb4dec Error type for WaitIdle 2020-07-18 10:58:46 +03:00
Gabriel Majeri
04b0b4d3a5 Error type for command_encoder_finish 2020-07-18 10:46:47 +03:00
bors[bot]
a689aea3f2
Merge #810
810: Convert the existing error types to `thiserror` r=kvark a=GabrielMajeri

**Connections**
Part of #638

**Description**
Converts the crate's existing error types from a manual `Display` implementation to using `thiserror`.

**Testing**
Tested with core and `wgpu-rs`.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-18 04:51:46 +00:00
Gabriel Majeri
a27b24215d Convert the existing error types to thiserror 2020-07-18 07:29:20 +03:00
bors[bot]
20a5611b2c
Merge #809
809: Safe error handling for swap chain r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Error types for swap chain functions, using `thiserror` to avoid boilerplate code.

**Testing**
Checked with core and player.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-18 03:37:41 +00:00
Gabriel Majeri
8bd33c2242 Replace transpose with a match 2020-07-18 06:36:10 +03:00
Gabriel Majeri
314074d13c Safe error handling for swap chain 2020-07-17 21:11:28 +03:00
bors[bot]
a753f578be
Merge #808
808: Use `thiserror` for validation module r=kvark a=GabrielMajeri

**Connections**
Part of #638

**Description**
_Describe what problem this is solving, and how it's solved._

**Testing**
Checked with core repo. This doesn't change any code, just adds an `Error`/`Display` implementation.


Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-17 17:37:58 +00:00
Gabriel Majeri
ce5bcf86f1 Use thiserror for validation module 2020-07-17 20:21:19 +03:00
bors[bot]
2455a653f2
Merge #803
803: Player-based GPU test framework r=cwfitzgerald a=kvark

**Connections**
Closes #786

**Description**
This change adds a GPU-based testing by re-using the Player from tracing infrastructure - #289.
It converts the player into a lib + binary, and adds an integration test into the crate that implements RON-specified testing.

Current implementation has a few requirements/gotchas that are listed in `test.rs`:
* in all the IDs, the backend is `Empty`
* all expected buffers have `MAP_READ` usage on them
* last action is `Submit`

I believe it's workable, and we can improve it down the road (e.g. with #792).

**Testing**
MUHAHAHA
`cargo test` nails it

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-17 15:03:49 +00:00
Dzmitry Malyshau
eb7bdcd012 playtest: move the actions together with expectations 2020-07-17 10:59:02 -04:00
bors[bot]
0c7f189134
Merge #806
806: Fix rods error check - fixes water example r=kvark a=rukai

**Description**
Fixes water example panic

**Testing**
Tested on every wgpu-rs example


Co-authored-by: Rukai <rubickent@gmail.com>
2020-07-17 13:39:02 +00:00
Rukai
de0ac2ccb7 Fix rods error check 2020-07-17 19:31:45 +10:00