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

Handle error case for SwapChain::get_next_texture #115

Merged
merged 1 commit into from
Nov 6, 2019

Conversation

antonok-edm
Copy link
Contributor

Updates SwapChain::get_next_texture to account for gfx-rs/wgpu#369. Otherwise, an invalid Id is returned and may cause confusing errors.

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+

},
swap_chain_id: &self.id,
if output.view_id == wgn::Id::ERROR {
Err(())
Copy link
Member

Choose a reason for hiding this comment

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

we should follow up with a better error here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we're treating a zero-valued Id as an error, I'm not sure how you'd distinguish between any different errors that might occur. I figured the doc comment snippet is good enough until there's a more specific error-reporting mechanism in wgpu-native.

bors bot added a commit that referenced this pull request Nov 6, 2019
115: Handle error case for SwapChain::get_next_texture r=kvark a=antonok-edm

Updates `SwapChain::get_next_texture` to account for gfx-rs/wgpu#369. Otherwise, an invalid `Id` is returned and may cause confusing errors.

Co-authored-by: Anton Lazarev <antonok35@gmail.com>
@bors
Copy link
Contributor

bors bot commented Nov 6, 2019

Build succeeded

@bors bors bot merged commit dd23e8f into gfx-rs:master Nov 6, 2019
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