1 #![allow(unused_imports)]
2 use super::*;
3 use wasm_bindgen::prelude::*;
4 #[cfg(web_sys_unstable_apis)]
5 #[wasm_bindgen]
6 extern "C" {
7     # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUProgrammableStage)]
8     #[derive(Debug, Clone, PartialEq, Eq)]
9     #[doc = "The `GpuProgrammableStage` dictionary."]
10     #[doc = ""]
11     #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`*"]
12     #[doc = ""]
13     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
14     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
15     pub type GpuProgrammableStage;
16 }
17 #[cfg(web_sys_unstable_apis)]
18 impl GpuProgrammableStage {
19     #[cfg(feature = "GpuShaderModule")]
20     #[doc = "Construct a new `GpuProgrammableStage`."]
21     #[doc = ""]
22     #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`, `GpuShaderModule`*"]
23     #[doc = ""]
24     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
25     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
new(entry_point: &str, module: &GpuShaderModule) -> Self26     pub fn new(entry_point: &str, module: &GpuShaderModule) -> Self {
27         #[allow(unused_mut)]
28         let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
29         ret.entry_point(entry_point);
30         ret.module(module);
31         ret
32     }
33     #[cfg(web_sys_unstable_apis)]
34     #[doc = "Change the `entryPoint` field of this object."]
35     #[doc = ""]
36     #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`*"]
37     #[doc = ""]
38     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
39     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
entry_point(&mut self, val: &str) -> &mut Self40     pub fn entry_point(&mut self, val: &str) -> &mut Self {
41         use wasm_bindgen::JsValue;
42         let r = ::js_sys::Reflect::set(
43             self.as_ref(),
44             &JsValue::from("entryPoint"),
45             &JsValue::from(val),
46         );
47         debug_assert!(
48             r.is_ok(),
49             "setting properties should never fail on our dictionary objects"
50         );
51         let _ = r;
52         self
53     }
54     #[cfg(web_sys_unstable_apis)]
55     #[cfg(feature = "GpuShaderModule")]
56     #[doc = "Change the `module` field of this object."]
57     #[doc = ""]
58     #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`, `GpuShaderModule`*"]
59     #[doc = ""]
60     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
module(&mut self, val: &GpuShaderModule) -> &mut Self62     pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self {
63         use wasm_bindgen::JsValue;
64         let r =
65             ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val));
66         debug_assert!(
67             r.is_ok(),
68             "setting properties should never fail on our dictionary objects"
69         );
70         let _ = r;
71         self
72     }
73 }
74