Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a primary backend that can be set #876

Merged
merged 2 commits into from
May 17, 2021
Merged

Conversation

Cupnfish
Copy link
Contributor

I’ve found that some machines don’t have some backend ( For example, win10, but there is no DX12 ) , and that setting it to a fixed backend can cause problems, so it makes sense to add the option to support fallback within the configurable backend.

Setting an environment variable does make me feel good during development, but the need to set such an environment variable later on when loading the application to the user makes things weird.

I now use dotenv to help me set up environment variables so that I don’t have to deal with the environment variables inside the user system, but it still requires some cumbersome setup.

Therefore, while submitting this PR, I also hope that someone can think about whether there is a more elegant way to deal with this issue.

The current idea of ​​optional backend is only somewhat useful under the windows platform, because wgpu is currently only supported by vulkan and metal on linux and mac, so this issue is not very important.

Add a primary backend that can be set
@Cupnfish
Copy link
Contributor Author

I have an another requirement that if I set the default backend to PRIMARY, I want to get what the current backend is for display on the UI.
And I found this on the WGPU:

// https://docs.rs/wgpu/0.8.1/wgpu/struct.Adapter.html#method.get_info
pub fn get_info(&self) -> AdapterInfo

I wonder if it is possible to expose a similar method in iced?

wgpu/src/settings.rs Show resolved Hide resolved
@hecrj hecrj merged commit 0ce6a2d into iced-rs:master May 17, 2021
@hecrj hecrj added the feature New feature or request label May 17, 2021
@hecrj hecrj added this to the 0.4.0 milestone May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants