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 = GPURenderPipelineDescriptor ) ]
8     #[derive(Debug, Clone, PartialEq, Eq)]
9     #[doc = "The `GpuRenderPipelineDescriptor` dictionary."]
10     #[doc = ""]
11     #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"]
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 GpuRenderPipelineDescriptor;
16 }
17 #[cfg(web_sys_unstable_apis)]
18 impl GpuRenderPipelineDescriptor {
19     #[cfg(all(
20         feature = "GpuPipelineLayout",
21         feature = "GpuPrimitiveTopology",
22         feature = "GpuProgrammableStageDescriptor",
23     ))]
24     #[doc = "Construct a new `GpuRenderPipelineDescriptor`."]
25     #[doc = ""]
26     #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayout`, `GpuPrimitiveTopology`, `GpuProgrammableStageDescriptor`, `GpuRenderPipelineDescriptor`*"]
27     #[doc = ""]
28     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
29     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
new( layout: &GpuPipelineLayout, color_states: &::wasm_bindgen::JsValue, primitive_topology: GpuPrimitiveTopology, vertex_stage: &GpuProgrammableStageDescriptor, ) -> Self30     pub fn new(
31         layout: &GpuPipelineLayout,
32         color_states: &::wasm_bindgen::JsValue,
33         primitive_topology: GpuPrimitiveTopology,
34         vertex_stage: &GpuProgrammableStageDescriptor,
35     ) -> Self {
36         #[allow(unused_mut)]
37         let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
38         ret.layout(layout);
39         ret.color_states(color_states);
40         ret.primitive_topology(primitive_topology);
41         ret.vertex_stage(vertex_stage);
42         ret
43     }
44     #[cfg(web_sys_unstable_apis)]
45     #[doc = "Change the `label` field of this object."]
46     #[doc = ""]
47     #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"]
48     #[doc = ""]
49     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50     #[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 Self51     pub fn label(&mut self, val: &str) -> &mut Self {
52         use wasm_bindgen::JsValue;
53         let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val));
54         debug_assert!(
55             r.is_ok(),
56             "setting properties should never fail on our dictionary objects"
57         );
58         let _ = r;
59         self
60     }
61     #[cfg(web_sys_unstable_apis)]
62     #[cfg(feature = "GpuPipelineLayout")]
63     #[doc = "Change the `layout` field of this object."]
64     #[doc = ""]
65     #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayout`, `GpuRenderPipelineDescriptor`*"]
66     #[doc = ""]
67     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
68     #[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 Self69     pub fn layout(&mut self, val: &GpuPipelineLayout) -> &mut Self {
70         use wasm_bindgen::JsValue;
71         let r =
72             ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val));
73         debug_assert!(
74             r.is_ok(),
75             "setting properties should never fail on our dictionary objects"
76         );
77         let _ = r;
78         self
79     }
80     #[cfg(web_sys_unstable_apis)]
81     #[doc = "Change the `alphaToCoverageEnabled` field of this object."]
82     #[doc = ""]
83     #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"]
84     #[doc = ""]
85     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
86     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
alpha_to_coverage_enabled(&mut self, val: bool) -> &mut Self87     pub fn alpha_to_coverage_enabled(&mut self, val: bool) -> &mut Self {
88         use wasm_bindgen::JsValue;
89         let r = ::js_sys::Reflect::set(
90             self.as_ref(),
91             &JsValue::from("alphaToCoverageEnabled"),
92             &JsValue::from(val),
93         );
94         debug_assert!(
95             r.is_ok(),
96             "setting properties should never fail on our dictionary objects"
97         );
98         let _ = r;
99         self
100     }
101     #[cfg(web_sys_unstable_apis)]
102     #[doc = "Change the `colorStates` field of this object."]
103     #[doc = ""]
104     #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"]
105     #[doc = ""]
106     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
107     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
color_states(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self108     pub fn color_states(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
109         use wasm_bindgen::JsValue;
110         let r = ::js_sys::Reflect::set(
111             self.as_ref(),
112             &JsValue::from("colorStates"),
113             &JsValue::from(val),
114         );
115         debug_assert!(
116             r.is_ok(),
117             "setting properties should never fail on our dictionary objects"
118         );
119         let _ = r;
120         self
121     }
122     #[cfg(web_sys_unstable_apis)]
123     #[cfg(feature = "GpuDepthStencilStateDescriptor")]
124     #[doc = "Change the `depthStencilState` field of this object."]
125     #[doc = ""]
126     #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`, `GpuRenderPipelineDescriptor`*"]
127     #[doc = ""]
128     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
129     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
depth_stencil_state(&mut self, val: &GpuDepthStencilStateDescriptor) -> &mut Self130     pub fn depth_stencil_state(&mut self, val: &GpuDepthStencilStateDescriptor) -> &mut Self {
131         use wasm_bindgen::JsValue;
132         let r = ::js_sys::Reflect::set(
133             self.as_ref(),
134             &JsValue::from("depthStencilState"),
135             &JsValue::from(val),
136         );
137         debug_assert!(
138             r.is_ok(),
139             "setting properties should never fail on our dictionary objects"
140         );
141         let _ = r;
142         self
143     }
144     #[cfg(web_sys_unstable_apis)]
145     #[cfg(feature = "GpuProgrammableStageDescriptor")]
146     #[doc = "Change the `fragmentStage` field of this object."]
147     #[doc = ""]
148     #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStageDescriptor`, `GpuRenderPipelineDescriptor`*"]
149     #[doc = ""]
150     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
151     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
fragment_stage(&mut self, val: &GpuProgrammableStageDescriptor) -> &mut Self152     pub fn fragment_stage(&mut self, val: &GpuProgrammableStageDescriptor) -> &mut Self {
153         use wasm_bindgen::JsValue;
154         let r = ::js_sys::Reflect::set(
155             self.as_ref(),
156             &JsValue::from("fragmentStage"),
157             &JsValue::from(val),
158         );
159         debug_assert!(
160             r.is_ok(),
161             "setting properties should never fail on our dictionary objects"
162         );
163         let _ = r;
164         self
165     }
166     #[cfg(web_sys_unstable_apis)]
167     #[cfg(feature = "GpuPrimitiveTopology")]
168     #[doc = "Change the `primitiveTopology` field of this object."]
169     #[doc = ""]
170     #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveTopology`, `GpuRenderPipelineDescriptor`*"]
171     #[doc = ""]
172     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
173     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
primitive_topology(&mut self, val: GpuPrimitiveTopology) -> &mut Self174     pub fn primitive_topology(&mut self, val: GpuPrimitiveTopology) -> &mut Self {
175         use wasm_bindgen::JsValue;
176         let r = ::js_sys::Reflect::set(
177             self.as_ref(),
178             &JsValue::from("primitiveTopology"),
179             &JsValue::from(val),
180         );
181         debug_assert!(
182             r.is_ok(),
183             "setting properties should never fail on our dictionary objects"
184         );
185         let _ = r;
186         self
187     }
188     #[cfg(web_sys_unstable_apis)]
189     #[cfg(feature = "GpuRasterizationStateDescriptor")]
190     #[doc = "Change the `rasterizationState` field of this object."]
191     #[doc = ""]
192     #[doc = "*This API requires the following crate features to be activated: `GpuRasterizationStateDescriptor`, `GpuRenderPipelineDescriptor`*"]
193     #[doc = ""]
194     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
195     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
rasterization_state(&mut self, val: &GpuRasterizationStateDescriptor) -> &mut Self196     pub fn rasterization_state(&mut self, val: &GpuRasterizationStateDescriptor) -> &mut Self {
197         use wasm_bindgen::JsValue;
198         let r = ::js_sys::Reflect::set(
199             self.as_ref(),
200             &JsValue::from("rasterizationState"),
201             &JsValue::from(val),
202         );
203         debug_assert!(
204             r.is_ok(),
205             "setting properties should never fail on our dictionary objects"
206         );
207         let _ = r;
208         self
209     }
210     #[cfg(web_sys_unstable_apis)]
211     #[doc = "Change the `sampleCount` field of this object."]
212     #[doc = ""]
213     #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"]
214     #[doc = ""]
215     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
216     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
sample_count(&mut self, val: u32) -> &mut Self217     pub fn sample_count(&mut self, val: u32) -> &mut Self {
218         use wasm_bindgen::JsValue;
219         let r = ::js_sys::Reflect::set(
220             self.as_ref(),
221             &JsValue::from("sampleCount"),
222             &JsValue::from(val),
223         );
224         debug_assert!(
225             r.is_ok(),
226             "setting properties should never fail on our dictionary objects"
227         );
228         let _ = r;
229         self
230     }
231     #[cfg(web_sys_unstable_apis)]
232     #[doc = "Change the `sampleMask` field of this object."]
233     #[doc = ""]
234     #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"]
235     #[doc = ""]
236     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
237     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
sample_mask(&mut self, val: u32) -> &mut Self238     pub fn sample_mask(&mut self, val: u32) -> &mut Self {
239         use wasm_bindgen::JsValue;
240         let r = ::js_sys::Reflect::set(
241             self.as_ref(),
242             &JsValue::from("sampleMask"),
243             &JsValue::from(val),
244         );
245         debug_assert!(
246             r.is_ok(),
247             "setting properties should never fail on our dictionary objects"
248         );
249         let _ = r;
250         self
251     }
252     #[cfg(web_sys_unstable_apis)]
253     #[cfg(feature = "GpuProgrammableStageDescriptor")]
254     #[doc = "Change the `vertexStage` field of this object."]
255     #[doc = ""]
256     #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStageDescriptor`, `GpuRenderPipelineDescriptor`*"]
257     #[doc = ""]
258     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
259     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
vertex_stage(&mut self, val: &GpuProgrammableStageDescriptor) -> &mut Self260     pub fn vertex_stage(&mut self, val: &GpuProgrammableStageDescriptor) -> &mut Self {
261         use wasm_bindgen::JsValue;
262         let r = ::js_sys::Reflect::set(
263             self.as_ref(),
264             &JsValue::from("vertexStage"),
265             &JsValue::from(val),
266         );
267         debug_assert!(
268             r.is_ok(),
269             "setting properties should never fail on our dictionary objects"
270         );
271         let _ = r;
272         self
273     }
274     #[cfg(web_sys_unstable_apis)]
275     #[cfg(feature = "GpuVertexStateDescriptor")]
276     #[doc = "Change the `vertexState` field of this object."]
277     #[doc = ""]
278     #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`, `GpuVertexStateDescriptor`*"]
279     #[doc = ""]
280     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
281     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
vertex_state(&mut self, val: &GpuVertexStateDescriptor) -> &mut Self282     pub fn vertex_state(&mut self, val: &GpuVertexStateDescriptor) -> &mut Self {
283         use wasm_bindgen::JsValue;
284         let r = ::js_sys::Reflect::set(
285             self.as_ref(),
286             &JsValue::from("vertexState"),
287             &JsValue::from(val),
288         );
289         debug_assert!(
290             r.is_ok(),
291             "setting properties should never fail on our dictionary objects"
292         );
293         let _ = r;
294         self
295     }
296 }
297