-
Notifications
You must be signed in to change notification settings - Fork 909
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
Allow checking type of wgpu::Instance's context #5142
Labels
area: api
Issues related to API surface
Comments
This was referenced Jan 26, 2024
emilk
pushed a commit
to emilk/egui
that referenced
this issue
Jan 29, 2024
…GL was enabled. (#3895) * Filed this in relation to the changes here gfx-rs/wgpu#5142 * Fixes rerun-io/rerun#4915 Draft until fully confirmed this works on Linux Chrome
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I ran into a situation where WebGPU adapter creation fails and I want to retry with WebGL (Chrome Linux 121 advertises WebGPU support but can't create adapters -.-)
Turns out though it's actually not easily possible to programmatically determine that this was the error: If the instance is created with both WebGPU & WebGL enabled and adapter creation fails subsequently,it might mean that either of the context type (webgpu or wgpu-core) was picked and failed. Only in the case of a webgpu-instance do I want to retry instance creation.
One hacky way to check for this is the result of
as_hal
, but this method is only available when wgpu_core compilation is enabled, and in the context I'm in (egui's guts) I don't know this.Proposing to add this simple method on
wgpu::Instance
:is_webgpu_instance() -> bool
The text was updated successfully, but these errors were encountered: