Move backend selection to Instance::new()#730
Merged
bors[bot] merged 1 commit intogfx-rs:masterfrom Jun 18, 2020
Merged
Conversation
Contributor
Author
|
So, this doesn't currently compile because I'm not sure how to address some issue in |
Kimundi
commented
Jun 17, 2020
kvark
reviewed
Jun 18, 2020
Member
kvark
left a comment
There was a problem hiding this comment.
Thank you!
Just one note here, looks great overall!
wgpu-core/src/instance.rs
Outdated
| impl Instance { | ||
| pub fn new(name: &str, version: u32) -> Self { | ||
| pub fn new(name: &str, version: u32, backends: BackendBit) -> Self { | ||
| let inputs = AdapterInputs::Mask(backends, |_| ()); |
Member
There was a problem hiding this comment.
we don't need this. Instead, each constructor would check if backends.contains(...) { Some(...) } else {None}
kvark
reviewed
Jun 18, 2020
Member
kvark
left a comment
There was a problem hiding this comment.
Please squash!
Also, if you want to play with a macro, that would be neat :)
Keep `inputs` parameter in `pick_adapter()`
Contributor
Author
|
I squashed it for now, the macro gets involved enough that I don't want to block on it here. :) |
Contributor
bors bot
added a commit
to gfx-rs/wgpu-rs
that referenced
this pull request
Jun 19, 2020
385: Move `backends: BackendBit` parameter to `Instance::new()` r=kvark a=Kimundi Fixes #337 Blocked on gfx-rs/wgpu#730. Co-authored-by: Marvin Löbel <loebel.marvin@gmail.com>
kvark
pushed a commit
to kvark/wgpu
that referenced
this pull request
Jun 3, 2021
385: Move `backends: BackendBit` parameter to `Instance::new()` r=kvark a=Kimundi Fixes gfx-rs#337 Blocked on gfx-rs#730. Co-authored-by: Marvin Löbel <loebel.marvin@gmail.com>
kvark
added a commit
to kvark/wgpu
that referenced
this pull request
Jun 3, 2021
730: Fix the web backend in code and CI r=grovesNL a=kvark Fixes gfx-rs#729 Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.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
Addresses gfx-rs/wgpu-rs#337
Corresponding wgpu-rs PR: gfx-rs/wgpu-rs#385
Description
This makes early backend selection possible in
Instance::new, by only attempting to instantiate requested backends. The actual selection inpick_adapter()(necessarily) remains unchanged, and can be used to further restrict the request.Testing
Unsure what to do here