From 87eef7c73bcfd566a97d0fab6a0c4548c21b8913 Mon Sep 17 00:00:00 2001 From: Wojciech Danilo Date: Fri, 12 May 2023 16:58:42 +0200 Subject: [PATCH] Init --- lib/rust/web/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/rust/web/src/lib.rs b/lib/rust/web/src/lib.rs index de5ec2ba41ac..86ae15ba4fe7 100644 --- a/lib/rust/web/src/lib.rs +++ b/lib/rust/web/src/lib.rs @@ -686,6 +686,8 @@ ops! { HtmlCanvasElementOps for HtmlCanvasElement fn get_webgl2_context(&self) -> Option { let options = Object::new(); Reflect::set(&options, &"antialias".into(), &false.into()).unwrap(); + // See: https://developer.chrome.com/blog/desynchronized + Reflect::set(&options, &"desynchronized".into(), &true.into()).unwrap(); let context = self.get_context_with_context_options("webgl2", &options).ok().flatten(); context.and_then(|obj| obj.dyn_into::().ok()) }