-
Notifications
You must be signed in to change notification settings - Fork 952
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Error on missing web_sys_unstable_apis
- Loading branch information
Showing
3 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
#[cfg(webgpu)] | ||
#[cfg(all(webgpu, web_sys_unstable_apis))] | ||
mod webgpu; | ||
#[cfg(webgpu)] | ||
#[cfg(all(webgpu, web_sys_unstable_apis))] | ||
pub(crate) use webgpu::{get_browser_gpu_property, ContextWebGpu}; | ||
|
||
#[cfg(all(webgpu, not(web_sys_unstable_apis)))] | ||
compile_error!( | ||
"webgpu feature used without web_sys_unstable_apis config: | ||
Here are some ways to resolve this: | ||
* If you wish to use webgpu backend, create a .cargo/config.toml in the root of the repo containing: | ||
[build] | ||
rustflags = [ \"--cfg=web_sys_unstable_apis\" ] | ||
* If you wish to disable webgpu backend and instead use webgl backend, change your wgpu Cargo.toml entry to: | ||
wgpu = { version = \"\", default-features = false, features = [\"webgl\"] } | ||
" | ||
); | ||
|
||
#[cfg(wgpu_core)] | ||
mod wgpu_core; | ||
|
||
#[cfg(wgpu_core)] | ||
pub(crate) use wgpu_core::ContextWgpuCore; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters