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 = GPUComputePipelineDescriptor)]
8     #[derive(Debug, Clone, PartialEq, Eq)]
9     #[doc = "The `GpuComputePipelineDescriptor` dictionary."]
10     #[doc = ""]
11     #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"]
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 GpuComputePipelineDescriptor;
16 }
17 #[cfg(web_sys_unstable_apis)]
18 impl GpuComputePipelineDescriptor {
19     #[cfg(feature = "GpuProgrammableStage")]
20     #[doc = "Construct a new `GpuComputePipelineDescriptor`."]
21     #[doc = ""]
22     #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"]
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(compute: &GpuProgrammableStage) -> Self26     pub fn new(compute: &GpuProgrammableStage) -> Self {
27         #[allow(unused_mut)]
28         let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
29         ret.compute(compute);
30         ret
31     }
32     #[cfg(web_sys_unstable_apis)]
33     #[doc = "Change the `label` field of this object."]
34     #[doc = ""]
35     #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"]
36     #[doc = ""]
37     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
38     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
label(&mut self, val: &str) -> &mut Self39     pub fn label(&mut self, val: &str) -> &mut Self {
40         use wasm_bindgen::JsValue;
41         let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val));
42         debug_assert!(
43             r.is_ok(),
44             "setting properties should never fail on our dictionary objects"
45         );
46         let _ = r;
47         self
48     }
49     #[cfg(web_sys_unstable_apis)]
50     #[cfg(feature = "GpuPipelineLayout")]
51     #[doc = "Change the `layout` field of this object."]
52     #[doc = ""]
53     #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuPipelineLayout`*"]
54     #[doc = ""]
55     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
56     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
layout(&mut self, val: &GpuPipelineLayout) -> &mut Self57     pub fn layout(&mut self, val: &GpuPipelineLayout) -> &mut Self {
58         use wasm_bindgen::JsValue;
59         let r =
60             ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val));
61         debug_assert!(
62             r.is_ok(),
63             "setting properties should never fail on our dictionary objects"
64         );
65         let _ = r;
66         self
67     }
68     #[cfg(web_sys_unstable_apis)]
69     #[cfg(feature = "GpuProgrammableStage")]
70     #[doc = "Change the `compute` field of this object."]
71     #[doc = ""]
72     #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"]
73     #[doc = ""]
74     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
75     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
compute(&mut self, val: &GpuProgrammableStage) -> &mut Self76     pub fn compute(&mut self, val: &GpuProgrammableStage) -> &mut Self {
77         use wasm_bindgen::JsValue;
78         let r = ::js_sys::Reflect::set(
79             self.as_ref(),
80             &JsValue::from("compute"),
81             &JsValue::from(val),
82         );
83         debug_assert!(
84             r.is_ok(),
85             "setting properties should never fail on our dictionary objects"
86         );
87         let _ = r;
88         self
89     }
90 }
91