File tree 4 files changed +22
-5
lines changed
4 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -5,3 +5,6 @@ xtask = "run --manifest-path xtask/Cargo.toml"
5
5
rustflags = [
6
6
" --cfg=web_sys_unstable_apis"
7
7
]
8
+ rustdocflags = [
9
+ " --cfg=web_sys_unstable_apis"
10
+ ]
Original file line number Diff line number Diff line change 56
56
RUST_BACKTRACE : full
57
57
PKG_CONFIG_ALLOW_CROSS : 1 # allow android to work
58
58
RUSTFLAGS : --cfg=web_sys_unstable_apis -D warnings
59
- RUSTDOCFLAGS : -Dwarnings
59
+ RUSTDOCFLAGS : --cfg=web_sys_unstable_apis -D warnings
60
60
WASM_BINDGEN_TEST_TIMEOUT : 300 # 5 minutes
61
61
CACHE_SUFFIX : c # cache busting
62
62
Original file line number Diff line number Diff line change 1
- #[ cfg( webgpu) ]
1
+ #[ cfg( all ( webgpu, web_sys_unstable_apis ) ) ]
2
2
mod webgpu;
3
- #[ cfg( webgpu) ]
3
+ #[ cfg( all ( webgpu, web_sys_unstable_apis ) ) ]
4
4
pub ( crate ) use webgpu:: { get_browser_gpu_property, ContextWebGpu } ;
5
5
6
+ #[ cfg( all( webgpu, not( web_sys_unstable_apis) ) ) ]
7
+ compile_error ! (
8
+ "webgpu feature used without web_sys_unstable_apis config:
9
+ Here are some ways to resolve this:
10
+ * If you wish to use webgpu backend, create a .cargo/config.toml in the root of the repo containing:
11
+ [build]
12
+ rustflags = [ \" --cfg=web_sys_unstable_apis\" ]
13
+ rustdocflags = [ \" --cfg=web_sys_unstable_apis\" ]
14
+ * If you wish to disable webgpu backend and instead use webgl backend, change your wgpu Cargo.toml entry to:
15
+ wgpu = { version = \" \" , default-features = false, features = [\" webgl\" ] }
16
+ "
17
+ ) ;
18
+
6
19
#[ cfg( wgpu_core) ]
7
20
mod wgpu_core;
21
+
8
22
#[ cfg( wgpu_core) ]
9
23
pub ( crate ) use wgpu_core:: ContextWgpuCore ;
Original file line number Diff line number Diff line change @@ -1812,7 +1812,7 @@ impl Instance {
1812
1812
) ;
1813
1813
}
1814
1814
1815
- #[ cfg( webgpu) ]
1815
+ #[ cfg( all ( webgpu, web_sys_unstable_apis ) ) ]
1816
1816
{
1817
1817
let is_only_available_backend = !cfg ! ( wgpu_core) ;
1818
1818
let requested_webgpu = _instance_desc. backends . contains ( Backends :: BROWSER_WEBGPU ) ;
@@ -3086,7 +3086,7 @@ impl<'a> BufferSlice<'a> {
3086
3086
/// this function directly hands you the ArrayBuffer that we mapped the data into in js.
3087
3087
///
3088
3088
/// This is only available on WebGPU, on any other backends this will return `None`.
3089
- #[ cfg( webgpu) ]
3089
+ #[ cfg( all ( webgpu, web_sys_unstable_apis ) ) ]
3090
3090
pub fn get_mapped_range_as_array_buffer ( & self ) -> Option < js_sys:: ArrayBuffer > {
3091
3091
self . buffer
3092
3092
. context
You can’t perform that action at this time.
0 commit comments