Closed zakorgy closed 3 years ago
Fixes #3704 PR checklist:
make
make reftests
Tested it with the following patch:
diff --git a/examples/quad/main.rs b/examples/quad/main.rs index 8989a75ef..676e5a198 100644 --- a/examples/quad/main.rs +++ b/examples/quad/main.rs @@ -114,13 +114,18 @@ fn main() { .append_child(&winit::platform::web::WindowExtWebSys::canvas(&window)) .unwrap(); - let instance = back::Instance::create("gfx-rs quad", 1).expect("Failed to create an instance!"); - let surface = unsafe { - instance - .create_surface(&window) - .expect("Failed to create a surface!") - }; + let other_thread = std::thread::spawn(move || { + let instance = back::Instance::create("gfx-rs quad", 1).expect("Failed to create an instance!"); + let surface = unsafe { + instance + .create_surface(&window) + .expect("Failed to create a surface!") + }; + (instance, surface) + }); + + let (instance, surface) = other_thread.join().unwrap(); let adapter = { let mut adapters = instance.enumerate_adapters();
Build succeeded:
Fixes #3704 PR checklist:
make
succeeds (on *nix)make reftests
succeedsTested it with the following patch: