You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
375: Use callback for `request_adapter` r=kvark a=grovesNL
For now this is mostly a signature change which allows us to start using a callback for `request_adapter`. Once we have an event loop, the callback could be scheduled to make this asynchronous. At that point the examples and server would have to be updated, because they currently rely on the callback running immediately (inline).
The reason for this change is that `request_adapter` is supposed to return a `Promise` in JS, so we can represent it with callbacks at the C API, and `Future` in Rust (though we'll probably keep using callbacks initially).
I also changed `request_adapter` to provide an adapter with `AdapterId::ERROR` when no adapters are available, so we can add basic error handling to wgpu-rs (gfx-rs/wgpu-rs#117).
Co-authored-by: Joshua Groves <[email protected]>
0 commit comments