Skip to main content

web_sys/features/
gen_GpuRenderPipelineDescriptor.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderPipelineDescriptor)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `GpuRenderPipelineDescriptor` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type GpuRenderPipelineDescriptor;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `label` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"]
21    #[doc = ""]
22    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
24    #[wasm_bindgen(method, getter = "label")]
25    pub fn get_label(this: &GpuRenderPipelineDescriptor) -> Option<::alloc::string::String>;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `label` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"]
30    #[doc = ""]
31    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
32    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
33    #[wasm_bindgen(method, setter = "label")]
34    pub fn set_label(this: &GpuRenderPipelineDescriptor, val: &str);
35    #[cfg(web_sys_unstable_apis)]
36    #[cfg(feature = "GpuPipelineLayout")]
37    #[doc = "Get the `layout` field of this object."]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayout`, `GpuRenderPipelineDescriptor`*"]
40    #[doc = ""]
41    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
42    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
43    #[wasm_bindgen(method, getter = "layout")]
44    pub fn get_layout(this: &GpuRenderPipelineDescriptor) -> ::wasm_bindgen::JsValue;
45    #[cfg(web_sys_unstable_apis)]
46    #[cfg(feature = "GpuPipelineLayout")]
47    #[doc = "Change the `layout` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayout`, `GpuRenderPipelineDescriptor`*"]
50    #[doc = ""]
51    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    #[wasm_bindgen(method, setter = "layout")]
54    pub fn set_layout(this: &GpuRenderPipelineDescriptor, val: &GpuPipelineLayout);
55    #[cfg(web_sys_unstable_apis)]
56    #[cfg(feature = "GpuAutoLayoutMode")]
57    #[doc = "Change the `layout` field of this object."]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `GpuAutoLayoutMode`, `GpuRenderPipelineDescriptor`*"]
60    #[doc = ""]
61    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
62    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
63    #[wasm_bindgen(method, setter = "layout")]
64    pub fn set_layout_gpu_auto_layout_mode(
65        this: &GpuRenderPipelineDescriptor,
66        val: GpuAutoLayoutMode,
67    );
68    #[cfg(web_sys_unstable_apis)]
69    #[cfg(feature = "GpuDepthStencilState")]
70    #[doc = "Get the `depthStencil` field of this object."]
71    #[doc = ""]
72    #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuRenderPipelineDescriptor`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
76    #[wasm_bindgen(method, getter = "depthStencil")]
77    pub fn get_depth_stencil(this: &GpuRenderPipelineDescriptor) -> Option<GpuDepthStencilState>;
78    #[cfg(web_sys_unstable_apis)]
79    #[cfg(feature = "GpuDepthStencilState")]
80    #[doc = "Change the `depthStencil` field of this object."]
81    #[doc = ""]
82    #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuRenderPipelineDescriptor`*"]
83    #[doc = ""]
84    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
85    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
86    #[wasm_bindgen(method, setter = "depthStencil")]
87    pub fn set_depth_stencil(this: &GpuRenderPipelineDescriptor, val: &GpuDepthStencilState);
88    #[cfg(web_sys_unstable_apis)]
89    #[cfg(feature = "GpuFragmentState")]
90    #[doc = "Get the `fragment` field of this object."]
91    #[doc = ""]
92    #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuRenderPipelineDescriptor`*"]
93    #[doc = ""]
94    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
95    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
96    #[wasm_bindgen(method, getter = "fragment")]
97    pub fn get_fragment(this: &GpuRenderPipelineDescriptor) -> Option<GpuFragmentState>;
98    #[cfg(web_sys_unstable_apis)]
99    #[cfg(feature = "GpuFragmentState")]
100    #[doc = "Change the `fragment` field of this object."]
101    #[doc = ""]
102    #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuRenderPipelineDescriptor`*"]
103    #[doc = ""]
104    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
105    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
106    #[wasm_bindgen(method, setter = "fragment")]
107    pub fn set_fragment(this: &GpuRenderPipelineDescriptor, val: &GpuFragmentState);
108    #[cfg(web_sys_unstable_apis)]
109    #[cfg(feature = "GpuMultisampleState")]
110    #[doc = "Get the `multisample` field of this object."]
111    #[doc = ""]
112    #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`, `GpuRenderPipelineDescriptor`*"]
113    #[doc = ""]
114    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
115    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
116    #[wasm_bindgen(method, getter = "multisample")]
117    pub fn get_multisample(this: &GpuRenderPipelineDescriptor) -> Option<GpuMultisampleState>;
118    #[cfg(web_sys_unstable_apis)]
119    #[cfg(feature = "GpuMultisampleState")]
120    #[doc = "Change the `multisample` field of this object."]
121    #[doc = ""]
122    #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`, `GpuRenderPipelineDescriptor`*"]
123    #[doc = ""]
124    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
125    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
126    #[wasm_bindgen(method, setter = "multisample")]
127    pub fn set_multisample(this: &GpuRenderPipelineDescriptor, val: &GpuMultisampleState);
128    #[cfg(web_sys_unstable_apis)]
129    #[cfg(feature = "GpuPrimitiveState")]
130    #[doc = "Get the `primitive` field of this object."]
131    #[doc = ""]
132    #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`, `GpuRenderPipelineDescriptor`*"]
133    #[doc = ""]
134    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
135    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
136    #[wasm_bindgen(method, getter = "primitive")]
137    pub fn get_primitive(this: &GpuRenderPipelineDescriptor) -> Option<GpuPrimitiveState>;
138    #[cfg(web_sys_unstable_apis)]
139    #[cfg(feature = "GpuPrimitiveState")]
140    #[doc = "Change the `primitive` field of this object."]
141    #[doc = ""]
142    #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`, `GpuRenderPipelineDescriptor`*"]
143    #[doc = ""]
144    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
145    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
146    #[wasm_bindgen(method, setter = "primitive")]
147    pub fn set_primitive(this: &GpuRenderPipelineDescriptor, val: &GpuPrimitiveState);
148    #[cfg(web_sys_unstable_apis)]
149    #[cfg(feature = "GpuVertexState")]
150    #[doc = "Get the `vertex` field of this object."]
151    #[doc = ""]
152    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`, `GpuVertexState`*"]
153    #[doc = ""]
154    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
155    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
156    #[wasm_bindgen(method, getter = "vertex")]
157    pub fn get_vertex(this: &GpuRenderPipelineDescriptor) -> GpuVertexState;
158    #[cfg(web_sys_unstable_apis)]
159    #[cfg(feature = "GpuVertexState")]
160    #[doc = "Change the `vertex` field of this object."]
161    #[doc = ""]
162    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`, `GpuVertexState`*"]
163    #[doc = ""]
164    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
165    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
166    #[wasm_bindgen(method, setter = "vertex")]
167    pub fn set_vertex(this: &GpuRenderPipelineDescriptor, val: &GpuVertexState);
168}
169#[cfg(web_sys_unstable_apis)]
170impl GpuRenderPipelineDescriptor {
171    #[cfg(all(feature = "GpuPipelineLayout", feature = "GpuVertexState",))]
172    #[doc = "Construct a new `GpuRenderPipelineDescriptor`."]
173    #[doc = ""]
174    #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayout`, `GpuRenderPipelineDescriptor`, `GpuVertexState`*"]
175    #[doc = ""]
176    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
177    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
178    pub fn new(layout: &GpuPipelineLayout, vertex: &GpuVertexState) -> Self {
179        #[allow(unused_mut)]
180        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
181        ret.set_layout(layout);
182        ret.set_vertex(vertex);
183        ret
184    }
185    #[cfg(all(feature = "GpuAutoLayoutMode", feature = "GpuVertexState",))]
186    #[doc = "Construct a new `GpuRenderPipelineDescriptor`."]
187    #[doc = ""]
188    #[doc = "*This API requires the following crate features to be activated: `GpuAutoLayoutMode`, `GpuRenderPipelineDescriptor`, `GpuVertexState`*"]
189    #[doc = ""]
190    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
191    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
192    pub fn new_with_gpu_auto_layout_mode(
193        layout: GpuAutoLayoutMode,
194        vertex: &GpuVertexState,
195    ) -> Self {
196        #[allow(unused_mut)]
197        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
198        ret.set_layout_gpu_auto_layout_mode(layout);
199        ret.set_vertex(vertex);
200        ret
201    }
202    #[cfg(web_sys_unstable_apis)]
203    #[deprecated = "Use `set_label()` instead."]
204    pub fn label(&mut self, val: &str) -> &mut Self {
205        self.set_label(val);
206        self
207    }
208    #[cfg(web_sys_unstable_apis)]
209    #[cfg(feature = "GpuPipelineLayout")]
210    #[deprecated = "Use `set_layout()` instead."]
211    pub fn layout(&mut self, val: &GpuPipelineLayout) -> &mut Self {
212        self.set_layout(val);
213        self
214    }
215    #[cfg(web_sys_unstable_apis)]
216    #[cfg(feature = "GpuDepthStencilState")]
217    #[deprecated = "Use `set_depth_stencil()` instead."]
218    pub fn depth_stencil(&mut self, val: &GpuDepthStencilState) -> &mut Self {
219        self.set_depth_stencil(val);
220        self
221    }
222    #[cfg(web_sys_unstable_apis)]
223    #[cfg(feature = "GpuFragmentState")]
224    #[deprecated = "Use `set_fragment()` instead."]
225    pub fn fragment(&mut self, val: &GpuFragmentState) -> &mut Self {
226        self.set_fragment(val);
227        self
228    }
229    #[cfg(web_sys_unstable_apis)]
230    #[cfg(feature = "GpuMultisampleState")]
231    #[deprecated = "Use `set_multisample()` instead."]
232    pub fn multisample(&mut self, val: &GpuMultisampleState) -> &mut Self {
233        self.set_multisample(val);
234        self
235    }
236    #[cfg(web_sys_unstable_apis)]
237    #[cfg(feature = "GpuPrimitiveState")]
238    #[deprecated = "Use `set_primitive()` instead."]
239    pub fn primitive(&mut self, val: &GpuPrimitiveState) -> &mut Self {
240        self.set_primitive(val);
241        self
242    }
243    #[cfg(web_sys_unstable_apis)]
244    #[cfg(feature = "GpuVertexState")]
245    #[deprecated = "Use `set_vertex()` instead."]
246    pub fn vertex(&mut self, val: &GpuVertexState) -> &mut Self {
247        self.set_vertex(val);
248        self
249    }
250}