Separate valid internal IDs from external ones#857
Merged
bors[bot] merged 1 commit intogfx-rs:masterfrom Aug 4, 2020
Merged
Conversation
kunalmohan
reviewed
Aug 4, 2020
bors bot
added a commit
to gfx-rs/wgpu-rs
that referenced
this pull request
Aug 4, 2020
494: Update wgpu with the error model changes r=cwfitzgerald a=kvark Depends on gfx-rs/wgpu#857 Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
cwfitzgerald
approved these changes
Aug 4, 2020
Member
cwfitzgerald
left a comment
There was a problem hiding this comment.
A lot of great changes in here! Skimmed everything, but looked at the core parts and saw nothing obviously wrong or smelly!
LGTM!
| .expect("Unable to find an adapter for selected backend"); | ||
|
|
||
| let info = gfx_select!(adapter => global.adapter_get_info(adapter)); | ||
| let info = gfx_select!(adapter => global.adapter_get_info(adapter)).unwrap(); |
Member
There was a problem hiding this comment.
Not in scope, but we likely want an unwrap_pretty type thing here too.
Member
Author
There was a problem hiding this comment.
These are actually not expected to fail at all, unless we are hand-writing them.
I would be happy to accept such PR anyway though :)
Member
Author
|
bors r=cwfitzgerald |
Contributor
bors bot
added a commit
to gfx-rs/wgpu-rs
that referenced
this pull request
Aug 5, 2020
494: Update wgpu with the error model changes r=cwfitzgerald a=kvark Depends on gfx-rs/wgpu#857 Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
kvark
added a commit
to kvark/wgpu
that referenced
this pull request
Jun 3, 2021
494: Update wgpu with the error model changes r=cwfitzgerald a=kvark Depends on gfx-rs#857 Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
kvark
pushed a commit
to kvark/wgpu
that referenced
this pull request
Jun 3, 2021
857: updated wgpu with more copyable types r=kvark a=adamnemecek Co-authored-by: adamnemecek <adamnemecek@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Connections
Closes #638
wgpu-rs update - gfx-rs/wgpu-rs#494
Description
The core change here is to allow user-specified IDs to be in the "Error" state that was introduced in #776 .
This is done by defining an internal
Valid<I>wrapper. Now, the hub storages can be indexed by this valid wrapper only. For regular IDs, we have to go throughstorage.get(index), which returns aResult. It still panics if the ID is totally garbage though, we don't want to handle what can't be expected here.All the other changes come mostly as a consequence of that:
command/draw.rsmodule for stuff shared between render passes and bundlescomb->cmd_bufThe expected use by wgpu-rs is unchanged. So far, I don't think we'd be generating Error IDs, but we can always reconsider.
For browsers though, if
device_create_xxxfailed, they would generate and error ID. It will occupy the slot up until the corresponding JS object is dropped.Testing
Tested on wgpu-rs examples