@@ -48,19 +48,16 @@ gles = ["wgpu-core?/gles"]
48
48
49
49
# # Enables the WebGPU backend on WebAssembly.
50
50
webgpu = [
51
+ " web" ,
51
52
" naga?/wgsl-out" ,
52
53
" dep:wasm-bindgen-futures" ,
53
- " dep:wasm-bindgen" ,
54
- " dep:js-sys" ,
55
- " dep:web-sys" ,
56
54
" web-sys/Document" ,
57
55
" web-sys/Event" ,
58
56
" web-sys/Navigator" ,
59
57
" web-sys/NodeList" ,
60
58
" web-sys/Window" ,
61
59
" web-sys/WorkerGlobalScope" ,
62
60
" web-sys/WorkerNavigator" ,
63
- " wgpu-types/web" ,
64
61
]
65
62
66
63
# ! ### Conditional Backends
@@ -72,14 +69,7 @@ angle = ["wgpu-core?/angle"]
72
69
vulkan-portability = [" wgpu-core?/vulkan-portability" ]
73
70
74
71
# # Enables the GLES backend on WebAssembly only.
75
- webgl = [
76
- " wgpu-core/webgl" ,
77
- " dep:wgpu-hal" ,
78
- " dep:smallvec" ,
79
- " dep:wasm-bindgen" ,
80
- " dep:js-sys" ,
81
- " dep:web-sys" ,
82
- ]
72
+ webgl = [" web" , " wgpu-core/webgl" , " dep:wgpu-hal" , " dep:smallvec" ]
83
73
84
74
# # Enables the noop backend for testing.
85
75
# #
@@ -159,6 +149,13 @@ fragile-send-sync-non-atomic-wasm = [
159
149
" wgpu-types/fragile-send-sync-non-atomic-wasm" ,
160
150
]
161
151
152
+ # # Use web-specific libraries on WASM
153
+ # #
154
+ # # Those libraties (wasm-bindgen, web-sys, js-sys) can only be used when there is a JavaScript
155
+ # # context around the WASM VM, e.g., when the WASM binary is used in a browser.
156
+ web = [" dep:wasm-bindgen" , " dep:js-sys" , " dep:web-sys" , " wgpu-types/web" ]
157
+
158
+
162
159
# ########################
163
160
# Standard Dependencies #
164
161
# ########################
0 commit comments