Skip to content
This repository was archived by the owner on Jun 18, 2021. It is now read-only.

Unwrap errors from transfer API #430

Merged
merged 1 commit into from
Jul 13, 2020

Conversation

GabrielMajeri
Copy link
Contributor

wgpu-rs part of gfx-rs/wgpu#773

bors bot added a commit to gfx-rs/wgpu that referenced this pull request Jul 11, 2020
773: Error handling for data transfer API r=kvark a=GabrielMajeri

**Connections**
Work on the error model described in #376 

**Description**
Removes assertions from the transfer functions, instead returning a custom error type.

**Testing**
Checked with `player` and `wgpu-rs`: gfx-rs/wgpu-rs#430

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
@GabrielMajeri GabrielMajeri force-pushed the transfer-commands-error-handling branch from 05166e9 to ee3f5d4 Compare July 11, 2020 06:19
@GabrielMajeri
Copy link
Contributor Author

GabrielMajeri commented Jul 11, 2020

I've updated this to use the latest revision of wgpu. It compiles, but running any example leads to a panic in wgpu-core. I will open an issue there.

@GabrielMajeri GabrielMajeri force-pushed the transfer-commands-error-handling branch 4 times, most recently from b69325e to 79fac64 Compare July 11, 2020 18:49
bors bot added a commit to gfx-rs/wgpu that referenced this pull request Jul 11, 2020
782: Add check while trying to remove uninserted Ids r=kvark a=kunalmohan

**Connections**
_Link to the issues addressed by this PR, or dependent PRs in other repositories_
An attempt to fix #781 
regression from #776 

**Description**
_Describe what problem this is solving, and how it's solved._
When we used `VecMap`, it simply returned `None` for even out of bounds access to the map (We depended on it returning `None`). After #776 , we get a panic. So adding a simple index check before accessing it fixes this issue.

**Testing**
_Explain how this change is tested._
Tested on wgpu-rs examples with the changes in gfx-rs/wgpu-rs#430. All examples run fine except the `cube` which segfaults.
<!--
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 #666 for an example.
If you can add a unit/integration test here in `wgpu`, that would be best.
-->


Co-authored-by: Kunal Mohan <kunalmohan99@gmail.com>
@GabrielMajeri GabrielMajeri force-pushed the transfer-commands-error-handling branch from 79fac64 to 1381c03 Compare July 12, 2020 06:36
@GabrielMajeri GabrielMajeri marked this pull request as ready for review July 12, 2020 06:36
@GabrielMajeri
Copy link
Contributor Author

I'm going to mark this as ready for review, because it no longer crashes for me. I've been able to run the examples successfully.

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
bors r+

bors bot added a commit that referenced this pull request Jul 12, 2020
430: Unwrap errors from transfer API r=kvark a=GabrielMajeri

`wgpu-rs` part of gfx-rs/wgpu#773

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jul 12, 2020

Build failed:

bors bot added a commit to gfx-rs/wgpu that referenced this pull request Jul 12, 2020
788: Make register methods public again r=kvark a=kvark

Fixup after #783
Should unblock gfx-rs/wgpu-rs#430

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
@kvark
Copy link
Member

kvark commented Jul 12, 2020

@GabrielMajeri sorry about that! Should be fixed once gfx-rs/wgpu#788 is merged (and the revision here is updated)

@GabrielMajeri GabrielMajeri force-pushed the transfer-commands-error-handling branch from 1381c03 to 009d062 Compare July 13, 2020 11:13
@GabrielMajeri
Copy link
Contributor Author

@kvark No problem, should be all OK now.

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 13, 2020

@bors bors bot merged commit a8cc309 into gfx-rs:master Jul 13, 2020
@GabrielMajeri GabrielMajeri deleted the transfer-commands-error-handling branch July 13, 2020 14:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants