Commit Graph

342 Commits

Author SHA1 Message Date
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
Andrea Nardi
e8a9d70a72 implemented Debug for RenderBundleEncoder
Signed-off-by: Andrea Nardi <buongiorno19972@gmail.com>
2020-07-22 18:29:42 +02: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
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
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
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
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
Gabriel Majeri
a27b24215d Convert the existing error types to thiserror 2020-07-18 07:29:20 +03: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
Gabriel Majeri
ce5bcf86f1 Use thiserror for validation module 2020-07-17 20:21:19 +03:00
Rukai
de0ac2ccb7 Fix rods error check 2020-07-17 19:31:45 +10:00
Dzmitry Malyshau
76e136e375 add the preferred format query 2020-07-16 11:27:05 -04:00
bors[bot]
71e853d6ce Merge #798
798: Fixed storage buffer counting towards storage textures for binding validation r=kvark a=Wumpf

See title.
(broke my group layout creation since my compute shaders need quite a few storage buffers _and_ storage textures bound... ;-))

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2020-07-16 14:33:40 +00:00
Andreas Reich
ace186623e Fixed storage buffer counting towards storage textures for binding validation 2020-07-15 22:56:30 +02:00
bors[bot]
a0ed09a6a8 Merge #796
796: Safe error handling for command API r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Initially started to remove assertions from the `bundle.rs` file, but ended up implementing safe error handling for the whole `command` module.

**Testing**
Checked with core and player.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-15 20:54:32 +00:00
Gabriel Majeri
6f6893244a Rename InvalidBufferUsage 2020-07-15 17:09:53 +03:00
Gabriel Majeri
8e9a7bd3a9 Detailed error messages for compute errors 2020-07-15 17:06:46 +03:00
Gabriel Majeri
a8608d8bcd Rename error variants 2020-07-15 17:06:36 +03:00
Gabriel Majeri
151e300635 Detailed messages for RenderPassError 2020-07-15 16:48:58 +03:00
Gabriel Majeri
7df69b2740 Error message display for RenderCommandError 2020-07-15 15:59:36 +03:00
Gabriel Majeri
52922a7a8f Detailed error messages for render bundle creation 2020-07-15 14:34:18 +03:00
Gabriel Majeri
b7dd6a194f Implement Display for BindError 2020-07-15 14:32:07 +03:00
bors[bot]
fc4baa3107 Merge #795
795: Move `RenderPass*AttachmentDescriptor` types into core r=kvark a=GabrielMajeri

**Connections**
Follow up to #791.

**Description**
I had the impression that these two types were already shared between `wgpu-core` and `wgpu-rs`, considering they were generic. Further investigation reveals that not to be the case.

This PR moves these types into `wgpu-core`, since they're specific to this crate.

**Testing**
Checked with core, player and `wgpu-rs`.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-14 12:52:27 +00:00
Gabriel Majeri
1b03fbe9be Safe error handling for commands API 2020-07-14 11:40:54 +03:00
Gabriel Majeri
39ed7a008c Move RenderPass*AttachmentDescriptor types into core 2020-07-14 08:11:20 +03:00
Connor Fitzgerald
c8bcc50ed6 Implement PUSH_CONSTANTS feature 2020-07-13 12:47:09 -04:00
bors[bot]
2208048a89 Merge #789
789: Panic on using a pending buffer r=kvark a=kvark

**Connections**
Validates the use case of https://github.com/gfx-rs/wgpu-rs/issues/436

**Description**
We didn't detect if a buffer had pending *initial* mapping, previously, on submit.

**Testing**
Untested

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-13 15:51:50 +00:00
bors[bot]
d7ee89018b Merge #791
791: Unify `wgpu-core` and `wgpu-rs` types r=kvark a=GabrielMajeri

**Connections**
Closes #689.

**Description**
Moves a lot of types from `wgpu-rs` which were duplicated in `wgpu-core` to `wgpu-types`.

**Testing**
Checked with core, player and `wgpu-rs`.

Corresponding `wgpu-rs` PR: https://github.com/gfx-rs/wgpu-rs/pull/437

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-13 15:45:09 +00:00
Gabriel Majeri
f3b80f1d8d Unify wgpu-core and wgpu-rs types 2020-07-13 18:39:49 +03:00
bors[bot]
08c873969c Merge #790
790: core: make DeviceType repr(u8) r=kvark a=DavidPeicho

**Connections**

This PR will make gfx-rs/wgpu-native#43 mergeable.

**Description**

`DeviceType` wasn't made to be used in FFI. The enum is now set to `#[repr(u8)]`.

**Testing**

It's not tested 💯 


Co-authored-by: David Peicho <david.peicho@gmail.com>
2020-07-13 13:55:35 +00:00
David Peicho
257151b9a4 core: make DeviceType repr(u8) 2020-07-13 10:45:47 +01:00
Dzmitry Malyshau
b7695ceac3 Panic on using a pending buffer 2020-07-13 00:54:24 -04:00
Dzmitry Malyshau
dd38c7ba03 Make register methods public again 2020-07-12 14:39:38 -04:00