-
Notifications
You must be signed in to change notification settings - Fork 136
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
wgpu Adapter and Surface might not be compatible #224
Comments
Thanks for reporting this. The intent behind separating surface and device creation is to support multiple windows (which may come and go, particularly in UI contexts) that can share resources on a single device. If the current design is failing on dual GPU setups, it’s definitely something that we need to address even if that makes the API less pleasant. I am curious about the error message. Is it general surface incompatibility or is the format (we unconditionally choose Bgra8Unorm) incompatible? |
The error message is |
IMO it would be good to have error handling at surface creation time, to request an adapter that is compatible with the new surface if the current adapter is not, and then continue using both adapters for their respective surfaces. This means that if I have 2 cards with 1 display each then my app can draw to surfaces on both displays simultaneously without incompatibility issues, which might not be possible if vello only keeps one adapter around. Helpfully, it also solves the original problem :P Here's hoping it's not too hard to add multi-adapter support? |
some `RenderContext` stuff is now `DeviceHandle` stuff, and device handles are created alongside surfaces to ensure compatibility, but are reused if possible. Fixes linebender#224 wgpu Adapter and Surface might not be compatible
some `RenderContext` stuff is now `DeviceHandle` stuff, and device handles are created alongside surfaces to ensure compatibility, but are reused if possible. Fixes linebender#224 wgpu Adapter and Surface might not be compatible
some `RenderContext` stuff is now `DeviceHandle` stuff, and device handles are created alongside surfaces to ensure compatibility, but are reused if possible. Fixes linebender#224 wgpu Adapter and Surface might not be compatible
Just a little note, I had a similar report recently, and while at first glance use of a |
Looks like you did that by using the fifo present mode, but vello was already using that before my change, and still didn't work. FWIW if I "remove" my nvidia vulkan driver, vello works fine (albeit very slowly) regardless of Wayland, X11, #227 or no #227. Maybe that's the bigger problem - wgpu is selecting the nvidia driver very aggressively. Even with |
Since
RequestAdapterOptions
fieldcompatible_surface
is not specified (see here), wgpu may not give an adapter that can render to the display. But the current API means the Instance and Adapter are constructed at the same time and the Surface is constructed later, so without changing the API (which admittedly seems pretty natural how it is), it's not possible to fix this. Maybe it's worth separating Instance and Adapter creation? Or making the user provide Instance and Surface themselves?FWIW I ran into this incompatibility on my intel+nvidia laptop, but the default
PowerPreference
should select intel, so I might just not have any compatible combinations. Still might be worth allowing this for other machines.The text was updated successfully, but these errors were encountered: