-
Notifications
You must be signed in to change notification settings - Fork 960
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
EGL failed to create surface when all backends enabled #2384
Comments
How does wgpu react to this? Are we panicking, or handling this situation gracefully? |
We got invalid surface:
By if I requesting only GL backend everything is fine. |
Well that sucks. Both Instance and Surface in wgpu are for all of the active backends, simlultaneously. It looks like the Vulkan surface was created here, and it's blocking EGL surface. So my question is - what is the reason Vulkan isn't used there? Could you enable |
My device doesn't supports DEPTH_STENCIL_ATTACHMENT for VK_FORMAT_D32_SFLOAT.
|
Bevy should fall back to using |
I still have this error on bevy 0.10.0 in the mobile example, Android 8.1.
Then:
I tried setting WGPU_BACKEND=gl and rebuilding but that did not make a difference. On Android 12 it crashes on:
Should I just forget about Bevy/wgpu for my commercial project? |
Still having this issue.
I tried to debug wgpu line for line at some point but I don't remember being able to pinpoint the issue, except that it's in the EGL backend. I am able to run glow + winit. |
@fr-an-k The problem is here:
Unfortunately, there is no easy way to fix this. This issue is not Android specific, or GL/Vulkan specific. We can easily retest this on Windows, for example. env_logger::init();
let event_loop = winit::event_loop::EventLoop::new().unwrap();
let window = winit::window::WindowBuilder::new()
.build(&event_loop)
.unwrap();
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: wgpu::Backends::all(),
..Default::default()
});
// We have Vulkan, DX12 and GL adapters
let adapters: Vec<wgpu::Adapter> = instance.enumerate_adapters(wgpu::Backends::all()).collect();
log::warn!("Available adapters:");
for (id, a) in adapters.iter().enumerate() {
log::warn!("Adapter info[{}]: {:?}", id, a.get_info());
}
// Surface is created by vulkan adapter, since we request all backends for instance
let surface = instance.create_surface(&window).unwrap();
log::warn!(
"Surface capabilities [0]: {:?}",
surface.get_capabilities(&adapters[0])
);
// Surface can work only with Vulkan adapter :(
log::warn!(
"Surface capabilities [1]: {:?}",
surface.get_capabilities(&adapters[1])
);
event_loop
.run(move |event, event_loop_window_target| event_loop_window_target.exit())
.unwrap();
For now, the only way to get around this error is to recreate instance with specific backend: ...
drop(surface);
drop(adapters);
drop(instance);
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: wgpu::Backends::DX12,
..Default::default()
}); |
Does the job, thanks! |
@Gordon-F what is the cause of this - once a vulkan surface is made other platforms are unable to use it as well? |
Based on tests (Windows/Linux/Android) - only Vulkan adapter can use it. Surface created by DX12 cannot be used by GL. let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: wgpu::Backends::DX12 | wgpu::Backends::GL,
..Default::default()
});
|
Alright, I wonder if we actually need to slightly rethink the surface api. |
Description
Repro steps
Platform
Android 8
Found it here: bevyengine/bevy#3639. Maybe not a wgpu-hal error, still trying to investigate.
The text was updated successfully, but these errors were encountered: