Skip to content

Commit 9a584e9

Browse files
authored
Update WebGPU (#4062)
- Appropriately mark WebGPU functions with `[Throws]`. - Add support for `AllowSharedBufferSource`. - Add support for optional arguments followed by non-optional ones.
1 parent 2ea6ab1 commit 9a584e9

23 files changed

+546
-274
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@
135135
* Removed `impl Deref for JsStatic` when compiling with `cfg(target_feature = "atomics")`, which was unsound.
136136
[#4057](https://github.com/rustwasm/wasm-bindgen/pull/4057)
137137

138+
* Updated the WebGPU WebIDL to the current draft as of 2024-08-05.
139+
[#4062](https://github.com/rustwasm/wasm-bindgen/pull/4062)
140+
138141
### Fixed
139142

140143
* Copy port from headless test server when using `WASM_BINDGEN_TEST_ADDRESS`.

crates/cli/tests/reference/raw.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,6 @@ export function __wbg_set_wasm(val) {
66
}
77

88

9-
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
10-
11-
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
12-
13-
cachedTextDecoder.decode();
14-
15-
let cachedUint8ArrayMemory0 = null;
16-
17-
function getUint8ArrayMemory0() {
18-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
19-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
20-
}
21-
return cachedUint8ArrayMemory0;
22-
}
23-
24-
function getStringFromWasm0(ptr, len) {
25-
ptr = ptr >>> 0;
26-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
27-
}
28-
299
const heap = new Array(128).fill(undefined);
3010

3111
heap.push(undefined, null, true, false);
@@ -45,6 +25,26 @@ function takeObject(idx) {
4525
dropObject(idx);
4626
return ret;
4727
}
28+
29+
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
30+
31+
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
32+
33+
cachedTextDecoder.decode();
34+
35+
let cachedUint8ArrayMemory0 = null;
36+
37+
function getUint8ArrayMemory0() {
38+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
39+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
40+
}
41+
return cachedUint8ArrayMemory0;
42+
}
43+
44+
function getStringFromWasm0(ptr, len) {
45+
ptr = ptr >>> 0;
46+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
47+
}
4848
/**
4949
* @param {number} test
5050
* @returns {number}
@@ -110,11 +110,11 @@ export function __wbg_test2_39fe629b9aa739cf() {
110110
return addHeapObject(ret);
111111
};
112112

113-
export function __wbindgen_throw(arg0, arg1) {
114-
throw new Error(getStringFromWasm0(arg0, arg1));
115-
};
116-
117113
export function __wbindgen_object_drop_ref(arg0) {
118114
takeObject(arg0);
119115
};
120116

117+
export function __wbindgen_throw(arg0, arg1) {
118+
throw new Error(getStringFromWasm0(arg0, arg1));
119+
};
120+

crates/web-sys/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,8 @@ GpuBufferMapState = []
495495
GpuCanvasAlphaMode = []
496496
GpuCanvasConfiguration = []
497497
GpuCanvasContext = []
498+
GpuCanvasToneMapping = []
499+
GpuCanvasToneMappingMode = []
498500
GpuColorDict = []
499501
GpuColorTargetState = []
500502
GpuCommandBuffer = []

crates/web-sys/src/features/gen_GpuAdapter.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ extern "C" {
4141
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
4242
pub fn limits(this: &GpuAdapter) -> GpuSupportedLimits;
4343
#[cfg(web_sys_unstable_apis)]
44+
#[cfg(feature = "GpuAdapterInfo")]
45+
# [wasm_bindgen (structural , method , getter , js_class = "GPUAdapter" , js_name = info)]
46+
#[doc = "Getter for the `info` field of this object."]
47+
#[doc = ""]
48+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/info)"]
49+
#[doc = ""]
50+
#[doc = "*This API requires the following crate features to be activated: `GpuAdapter`, `GpuAdapterInfo`*"]
51+
#[doc = ""]
52+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
53+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
54+
pub fn info(this: &GpuAdapter) -> GpuAdapterInfo;
55+
#[cfg(web_sys_unstable_apis)]
4456
# [wasm_bindgen (structural , method , getter , js_class = "GPUAdapter" , js_name = isFallbackAdapter)]
4557
#[doc = "Getter for the `isFallbackAdapter` field of this object."]
4658
#[doc = ""]
@@ -61,6 +73,7 @@ extern "C" {
6173
#[doc = ""]
6274
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
6375
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
76+
#[deprecated]
6477
pub fn request_adapter_info(this: &GpuAdapter) -> ::js_sys::Promise;
6578
#[cfg(web_sys_unstable_apis)]
6679
# [wasm_bindgen (method , structural , js_class = "GPUAdapter" , js_name = requestDevice)]

crates/web-sys/src/features/gen_GpuBlendFactor.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@ pub enum GpuBlendFactor {
2424
SrcAlphaSaturated = "src-alpha-saturated",
2525
Constant = "constant",
2626
OneMinusConstant = "one-minus-constant",
27+
Src1 = "src1",
28+
OneMinusSrc1 = "one-minus-src1",
29+
Src1Alpha = "src1-alpha",
30+
OneMinusSrc1Alpha = "one-minus-src1-alpha",
2731
}

crates/web-sys/src/features/gen_GpuBuffer.rs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ extern "C" {
8484
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
8585
pub fn destroy(this: &GpuBuffer);
8686
#[cfg(web_sys_unstable_apis)]
87-
# [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)]
87+
# [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)]
8888
#[doc = "The `getMappedRange()` method."]
8989
#[doc = ""]
9090
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"]
@@ -93,9 +93,9 @@ extern "C" {
9393
#[doc = ""]
9494
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
9595
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
96-
pub fn get_mapped_range(this: &GpuBuffer) -> ::js_sys::ArrayBuffer;
96+
pub fn get_mapped_range(this: &GpuBuffer) -> Result<::js_sys::ArrayBuffer, JsValue>;
9797
#[cfg(web_sys_unstable_apis)]
98-
# [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)]
98+
# [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)]
9999
#[doc = "The `getMappedRange()` method."]
100100
#[doc = ""]
101101
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"]
@@ -104,9 +104,12 @@ extern "C" {
104104
#[doc = ""]
105105
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
106106
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
107-
pub fn get_mapped_range_with_u32(this: &GpuBuffer, offset: u32) -> ::js_sys::ArrayBuffer;
107+
pub fn get_mapped_range_with_u32(
108+
this: &GpuBuffer,
109+
offset: u32,
110+
) -> Result<::js_sys::ArrayBuffer, JsValue>;
108111
#[cfg(web_sys_unstable_apis)]
109-
# [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)]
112+
# [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)]
110113
#[doc = "The `getMappedRange()` method."]
111114
#[doc = ""]
112115
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"]
@@ -115,9 +118,12 @@ extern "C" {
115118
#[doc = ""]
116119
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
117120
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
118-
pub fn get_mapped_range_with_f64(this: &GpuBuffer, offset: f64) -> ::js_sys::ArrayBuffer;
121+
pub fn get_mapped_range_with_f64(
122+
this: &GpuBuffer,
123+
offset: f64,
124+
) -> Result<::js_sys::ArrayBuffer, JsValue>;
119125
#[cfg(web_sys_unstable_apis)]
120-
# [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)]
126+
# [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)]
121127
#[doc = "The `getMappedRange()` method."]
122128
#[doc = ""]
123129
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"]
@@ -130,9 +136,9 @@ extern "C" {
130136
this: &GpuBuffer,
131137
offset: u32,
132138
size: u32,
133-
) -> ::js_sys::ArrayBuffer;
139+
) -> Result<::js_sys::ArrayBuffer, JsValue>;
134140
#[cfg(web_sys_unstable_apis)]
135-
# [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)]
141+
# [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)]
136142
#[doc = "The `getMappedRange()` method."]
137143
#[doc = ""]
138144
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"]
@@ -145,9 +151,9 @@ extern "C" {
145151
this: &GpuBuffer,
146152
offset: f64,
147153
size: u32,
148-
) -> ::js_sys::ArrayBuffer;
154+
) -> Result<::js_sys::ArrayBuffer, JsValue>;
149155
#[cfg(web_sys_unstable_apis)]
150-
# [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)]
156+
# [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)]
151157
#[doc = "The `getMappedRange()` method."]
152158
#[doc = ""]
153159
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"]
@@ -160,9 +166,9 @@ extern "C" {
160166
this: &GpuBuffer,
161167
offset: u32,
162168
size: f64,
163-
) -> ::js_sys::ArrayBuffer;
169+
) -> Result<::js_sys::ArrayBuffer, JsValue>;
164170
#[cfg(web_sys_unstable_apis)]
165-
# [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)]
171+
# [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)]
166172
#[doc = "The `getMappedRange()` method."]
167173
#[doc = ""]
168174
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"]
@@ -175,7 +181,7 @@ extern "C" {
175181
this: &GpuBuffer,
176182
offset: f64,
177183
size: f64,
178-
) -> ::js_sys::ArrayBuffer;
184+
) -> Result<::js_sys::ArrayBuffer, JsValue>;
179185
#[cfg(web_sys_unstable_apis)]
180186
# [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = mapAsync)]
181187
#[doc = "The `mapAsync()` method."]

crates/web-sys/src/features/gen_GpuCanvasConfiguration.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,26 @@ extern "C" {
7575
#[wasm_bindgen(method, setter = "format")]
7676
pub fn set_format(this: &GpuCanvasConfiguration, val: GpuTextureFormat);
7777
#[cfg(web_sys_unstable_apis)]
78+
#[cfg(feature = "GpuCanvasToneMapping")]
79+
#[doc = "Get the `toneMapping` field of this object."]
80+
#[doc = ""]
81+
#[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuCanvasToneMapping`*"]
82+
#[doc = ""]
83+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
84+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
85+
#[wasm_bindgen(method, getter = "toneMapping")]
86+
pub fn get_tone_mapping(this: &GpuCanvasConfiguration) -> Option<GpuCanvasToneMapping>;
87+
#[cfg(web_sys_unstable_apis)]
88+
#[cfg(feature = "GpuCanvasToneMapping")]
89+
#[doc = "Change the `toneMapping` field of this object."]
90+
#[doc = ""]
91+
#[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuCanvasToneMapping`*"]
92+
#[doc = ""]
93+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
94+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
95+
#[wasm_bindgen(method, setter = "toneMapping")]
96+
pub fn set_tone_mapping(this: &GpuCanvasConfiguration, val: &GpuCanvasToneMapping);
97+
#[cfg(web_sys_unstable_apis)]
7898
#[doc = "Get the `usage` field of this object."]
7999
#[doc = ""]
80100
#[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`*"]
@@ -149,6 +169,13 @@ impl GpuCanvasConfiguration {
149169
self
150170
}
151171
#[cfg(web_sys_unstable_apis)]
172+
#[cfg(feature = "GpuCanvasToneMapping")]
173+
#[deprecated = "Use `set_tone_mapping()` instead."]
174+
pub fn tone_mapping(&mut self, val: &GpuCanvasToneMapping) -> &mut Self {
175+
self.set_tone_mapping(val);
176+
self
177+
}
178+
#[cfg(web_sys_unstable_apis)]
152179
#[deprecated = "Use `set_usage()` instead."]
153180
pub fn usage(&mut self, val: u32) -> &mut Self {
154181
self.set_usage(val);

crates/web-sys/src/features/gen_GpuCanvasContext.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ extern "C" {
2929
pub fn canvas(this: &GpuCanvasContext) -> ::js_sys::Object;
3030
#[cfg(web_sys_unstable_apis)]
3131
#[cfg(feature = "GpuCanvasConfiguration")]
32-
# [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = configure)]
32+
# [wasm_bindgen (catch , method , structural , js_class = "GPUCanvasContext" , js_name = configure)]
3333
#[doc = "The `configure()` method."]
3434
#[doc = ""]
3535
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/configure)"]
@@ -38,10 +38,13 @@ extern "C" {
3838
#[doc = ""]
3939
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
4040
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
41-
pub fn configure(this: &GpuCanvasContext, configuration: &GpuCanvasConfiguration);
41+
pub fn configure(
42+
this: &GpuCanvasContext,
43+
configuration: &GpuCanvasConfiguration,
44+
) -> Result<(), JsValue>;
4245
#[cfg(web_sys_unstable_apis)]
4346
#[cfg(feature = "GpuTexture")]
44-
# [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = getCurrentTexture)]
47+
# [wasm_bindgen (catch , method , structural , js_class = "GPUCanvasContext" , js_name = getCurrentTexture)]
4548
#[doc = "The `getCurrentTexture()` method."]
4649
#[doc = ""]
4750
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/getCurrentTexture)"]
@@ -50,7 +53,7 @@ extern "C" {
5053
#[doc = ""]
5154
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
5255
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53-
pub fn get_current_texture(this: &GpuCanvasContext) -> GpuTexture;
56+
pub fn get_current_texture(this: &GpuCanvasContext) -> Result<GpuTexture, JsValue>;
5457
#[cfg(web_sys_unstable_apis)]
5558
# [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = unconfigure)]
5659
#[doc = "The `unconfigure()` method."]
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#![allow(unused_imports)]
2+
#![allow(clippy::all)]
3+
use super::*;
4+
use wasm_bindgen::prelude::*;
5+
#[cfg(web_sys_unstable_apis)]
6+
#[wasm_bindgen]
7+
extern "C" {
8+
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCanvasToneMapping)]
9+
#[derive(Debug, Clone, PartialEq, Eq)]
10+
#[doc = "The `GpuCanvasToneMapping` dictionary."]
11+
#[doc = ""]
12+
#[doc = "*This API requires the following crate features to be activated: `GpuCanvasToneMapping`*"]
13+
#[doc = ""]
14+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16+
pub type GpuCanvasToneMapping;
17+
#[cfg(web_sys_unstable_apis)]
18+
#[cfg(feature = "GpuCanvasToneMappingMode")]
19+
#[doc = "Get the `mode` field of this object."]
20+
#[doc = ""]
21+
#[doc = "*This API requires the following crate features to be activated: `GpuCanvasToneMapping`, `GpuCanvasToneMappingMode`*"]
22+
#[doc = ""]
23+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
25+
#[wasm_bindgen(method, getter = "mode")]
26+
pub fn get_mode(this: &GpuCanvasToneMapping) -> Option<GpuCanvasToneMappingMode>;
27+
#[cfg(web_sys_unstable_apis)]
28+
#[cfg(feature = "GpuCanvasToneMappingMode")]
29+
#[doc = "Change the `mode` field of this object."]
30+
#[doc = ""]
31+
#[doc = "*This API requires the following crate features to be activated: `GpuCanvasToneMapping`, `GpuCanvasToneMappingMode`*"]
32+
#[doc = ""]
33+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
35+
#[wasm_bindgen(method, setter = "mode")]
36+
pub fn set_mode(this: &GpuCanvasToneMapping, val: GpuCanvasToneMappingMode);
37+
}
38+
#[cfg(web_sys_unstable_apis)]
39+
impl GpuCanvasToneMapping {
40+
#[doc = "Construct a new `GpuCanvasToneMapping`."]
41+
#[doc = ""]
42+
#[doc = "*This API requires the following crate features to be activated: `GpuCanvasToneMapping`*"]
43+
#[doc = ""]
44+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
45+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
46+
pub fn new() -> Self {
47+
#[allow(unused_mut)]
48+
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
49+
ret
50+
}
51+
#[cfg(web_sys_unstable_apis)]
52+
#[cfg(feature = "GpuCanvasToneMappingMode")]
53+
#[deprecated = "Use `set_mode()` instead."]
54+
pub fn mode(&mut self, val: GpuCanvasToneMappingMode) -> &mut Self {
55+
self.set_mode(val);
56+
self
57+
}
58+
}
59+
#[cfg(web_sys_unstable_apis)]
60+
impl Default for GpuCanvasToneMapping {
61+
fn default() -> Self {
62+
Self::new()
63+
}
64+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#![allow(unused_imports)]
2+
#![allow(clippy::all)]
3+
use wasm_bindgen::prelude::*;
4+
#[cfg(web_sys_unstable_apis)]
5+
#[wasm_bindgen]
6+
#[doc = "The `GpuCanvasToneMappingMode` enum."]
7+
#[doc = ""]
8+
#[doc = "*This API requires the following crate features to be activated: `GpuCanvasToneMappingMode`*"]
9+
#[doc = ""]
10+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
11+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
12+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
13+
pub enum GpuCanvasToneMappingMode {
14+
Standard = "standard",
15+
Extended = "extended",
16+
}

0 commit comments

Comments
 (0)