@@ -48,19 +48,16 @@ gles = ["wgpu-core?/gles"]
4848
4949# # Enables the WebGPU backend on WebAssembly.
5050webgpu = [
51+ " web" ,
5152 " naga?/wgsl-out" ,
5253 " dep:wasm-bindgen-futures" ,
53- " dep:wasm-bindgen" ,
54- " dep:js-sys" ,
55- " dep:web-sys" ,
5654 " web-sys/Document" ,
5755 " web-sys/Event" ,
5856 " web-sys/Navigator" ,
5957 " web-sys/NodeList" ,
6058 " web-sys/Window" ,
6159 " web-sys/WorkerGlobalScope" ,
6260 " web-sys/WorkerNavigator" ,
63- " wgpu-types/web" ,
6461]
6562
6663# ! ### Conditional Backends
@@ -72,14 +69,7 @@ angle = ["wgpu-core?/angle"]
7269vulkan-portability = [" wgpu-core?/vulkan-portability" ]
7370
7471# # 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" ]
8373
8474# # Enables the noop backend for testing.
8575# #
@@ -159,6 +149,13 @@ fragile-send-sync-non-atomic-wasm = [
159149 " wgpu-types/fragile-send-sync-non-atomic-wasm" ,
160150]
161151
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+
162159# ########################
163160# Standard Dependencies #
164161# ########################
0 commit comments