-
Notifications
You must be signed in to change notification settings - Fork 953
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 (#5104)
- Loading branch information
1 parent
e1481b6
commit f9454d1
Showing
4 changed files
with
22 additions
and
5 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
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,23 @@ | ||
#[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\" ] | ||
rustdocflags = [ \"--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