#[cfg(all(feature = "gpu", not(target_arch = "wasm32")))]
pub fn block_on<F: std::future::Future>(f: F) -> F::Output {
pollster::block_on(f)
}
#[cfg(not(target_arch = "wasm32"))]
pub const fn sync_available() -> bool {
true
}
#[cfg(target_arch = "wasm32")]
pub const fn sync_available() -> bool {
false
}
#[cfg(all(feature = "gpu-wasm", target_arch = "wasm32"))]
pub fn spawn_local<F>(f: F)
where
F: std::future::Future<Output = ()> + 'static,
{
wasm_bindgen_futures::spawn_local(f);
}
#[cfg(all(feature = "gpu-wasm", target_arch = "wasm32"))]
pub fn console_log(s: &str) {
web_sys::console::log_1(&s.into());
}
#[cfg(not(target_arch = "wasm32"))]
pub fn console_log(s: &str) {
eprintln!("{}", s);
}