File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
crates/viewer/re_renderer/src Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -456,6 +456,8 @@ pub fn supported_backends() -> wgpu::Backends {
456
456
// For changing the backend we use standard wgpu env var, i.e. WGPU_BACKEND.
457
457
wgpu:: Backends :: from_env ( )
458
458
. unwrap_or ( wgpu:: Backends :: VULKAN | wgpu:: Backends :: METAL | wgpu:: Backends :: GL )
459
+ } else if is_safari_browser ( ) {
460
+ wgpu:: Backends :: GL // TODO(#8559): Fix WebGPU on Safari
459
461
} else {
460
462
wgpu:: Backends :: GL | wgpu:: Backends :: BROWSER_WEBGPU
461
463
}
@@ -529,3 +531,20 @@ pub fn validate_graphics_backend_applicability(backend: wgpu::Backend) -> Result
529
531
}
530
532
Ok ( ( ) )
531
533
}
534
+
535
+ /// Are we running inside the Safari browser?
536
+ pub fn is_safari_browser ( ) -> bool {
537
+ #[ cfg( target_arch = "wasm32" ) ]
538
+ fn is_safari_browser_inner ( ) -> Option < bool > {
539
+ use web_sys:: wasm_bindgen:: JsValue ;
540
+ let window = web_sys:: window ( ) ?;
541
+ Some ( window. has_own_property ( & JsValue :: from ( "safari" ) ) )
542
+ }
543
+
544
+ #[ cfg( not( target_arch = "wasm32" ) ) ]
545
+ fn is_safari_browser_inner ( ) -> Option < bool > {
546
+ None
547
+ }
548
+
549
+ is_safari_browser_inner ( ) . unwrap_or ( false )
550
+ }
You can’t perform that action at this time.
0 commit comments