Skip to main content

web_sys/features/
gen_GpuRenderPassColorAttachment.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 = GPURenderPassColorAttachment)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `GpuRenderPassColorAttachment` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"]
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 GpuRenderPassColorAttachment;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `clearValue` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"]
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 = "clearValue")]
25    pub fn get_clear_value(this: &GpuRenderPassColorAttachment) -> ::wasm_bindgen::JsValue;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `clearValue` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"]
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 = "clearValue")]
34    pub fn set_clear_value(this: &GpuRenderPassColorAttachment, val: &[::js_sys::Number]);
35    #[cfg(web_sys_unstable_apis)]
36    #[cfg(feature = "GpuColorDict")]
37    #[doc = "Change the `clearValue` field of this object."]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"]
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, setter = "clearValue")]
44    pub fn set_clear_value_gpu_color_dict(this: &GpuRenderPassColorAttachment, val: &GpuColorDict);
45    #[cfg(web_sys_unstable_apis)]
46    #[doc = "Get the `depthSlice` field of this object."]
47    #[doc = ""]
48    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"]
49    #[doc = ""]
50    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
51    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
52    #[wasm_bindgen(method, getter = "depthSlice")]
53    pub fn get_depth_slice(this: &GpuRenderPassColorAttachment) -> Option<u32>;
54    #[cfg(web_sys_unstable_apis)]
55    #[doc = "Change the `depthSlice` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"]
58    #[doc = ""]
59    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
60    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
61    #[wasm_bindgen(method, setter = "depthSlice")]
62    pub fn set_depth_slice(this: &GpuRenderPassColorAttachment, val: u32);
63    #[cfg(web_sys_unstable_apis)]
64    #[cfg(feature = "GpuLoadOp")]
65    #[doc = "Get the `loadOp` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassColorAttachment`*"]
68    #[doc = ""]
69    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
70    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
71    #[wasm_bindgen(method, getter = "loadOp")]
72    pub fn get_load_op(this: &GpuRenderPassColorAttachment) -> GpuLoadOp;
73    #[cfg(web_sys_unstable_apis)]
74    #[cfg(feature = "GpuLoadOp")]
75    #[doc = "Change the `loadOp` field of this object."]
76    #[doc = ""]
77    #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassColorAttachment`*"]
78    #[doc = ""]
79    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
80    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
81    #[wasm_bindgen(method, setter = "loadOp")]
82    pub fn set_load_op(this: &GpuRenderPassColorAttachment, val: GpuLoadOp);
83    #[cfg(web_sys_unstable_apis)]
84    #[doc = "Get the `resolveTarget` field of this object."]
85    #[doc = ""]
86    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"]
87    #[doc = ""]
88    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
89    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
90    #[wasm_bindgen(method, getter = "resolveTarget")]
91    pub fn get_resolve_target(this: &GpuRenderPassColorAttachment) -> Option<::js_sys::Object>;
92    #[cfg(web_sys_unstable_apis)]
93    #[cfg(feature = "GpuTexture")]
94    #[doc = "Change the `resolveTarget` field of this object."]
95    #[doc = ""]
96    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"]
97    #[doc = ""]
98    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
99    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
100    #[wasm_bindgen(method, setter = "resolveTarget")]
101    pub fn set_resolve_target(this: &GpuRenderPassColorAttachment, val: &GpuTexture);
102    #[cfg(web_sys_unstable_apis)]
103    #[cfg(feature = "GpuTextureView")]
104    #[doc = "Change the `resolveTarget` field of this object."]
105    #[doc = ""]
106    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"]
107    #[doc = ""]
108    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
109    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
110    #[wasm_bindgen(method, setter = "resolveTarget")]
111    pub fn set_resolve_target_gpu_texture_view(
112        this: &GpuRenderPassColorAttachment,
113        val: &GpuTextureView,
114    );
115    #[cfg(web_sys_unstable_apis)]
116    #[cfg(feature = "GpuStoreOp")]
117    #[doc = "Get the `storeOp` field of this object."]
118    #[doc = ""]
119    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuStoreOp`*"]
120    #[doc = ""]
121    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
122    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
123    #[wasm_bindgen(method, getter = "storeOp")]
124    pub fn get_store_op(this: &GpuRenderPassColorAttachment) -> GpuStoreOp;
125    #[cfg(web_sys_unstable_apis)]
126    #[cfg(feature = "GpuStoreOp")]
127    #[doc = "Change the `storeOp` field of this object."]
128    #[doc = ""]
129    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuStoreOp`*"]
130    #[doc = ""]
131    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
132    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
133    #[wasm_bindgen(method, setter = "storeOp")]
134    pub fn set_store_op(this: &GpuRenderPassColorAttachment, val: GpuStoreOp);
135    #[cfg(web_sys_unstable_apis)]
136    #[doc = "Get the `view` field of this object."]
137    #[doc = ""]
138    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"]
139    #[doc = ""]
140    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
141    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
142    #[wasm_bindgen(method, getter = "view")]
143    pub fn get_view(this: &GpuRenderPassColorAttachment) -> ::js_sys::Object;
144    #[cfg(web_sys_unstable_apis)]
145    #[cfg(feature = "GpuTexture")]
146    #[doc = "Change the `view` field of this object."]
147    #[doc = ""]
148    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
152    #[wasm_bindgen(method, setter = "view")]
153    pub fn set_view(this: &GpuRenderPassColorAttachment, val: &GpuTexture);
154    #[cfg(web_sys_unstable_apis)]
155    #[cfg(feature = "GpuTextureView")]
156    #[doc = "Change the `view` field of this object."]
157    #[doc = ""]
158    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"]
159    #[doc = ""]
160    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
161    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
162    #[wasm_bindgen(method, setter = "view")]
163    pub fn set_view_gpu_texture_view(this: &GpuRenderPassColorAttachment, val: &GpuTextureView);
164}
165#[cfg(web_sys_unstable_apis)]
166impl GpuRenderPassColorAttachment {
167    #[cfg(all(feature = "GpuLoadOp", feature = "GpuStoreOp", feature = "GpuTexture",))]
168    #[doc = "Construct a new `GpuRenderPassColorAttachment`."]
169    #[doc = ""]
170    #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassColorAttachment`, `GpuStoreOp`, `GpuTexture`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
174    pub fn new(load_op: GpuLoadOp, store_op: GpuStoreOp, view: &GpuTexture) -> Self {
175        #[allow(unused_mut)]
176        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
177        ret.set_load_op(load_op);
178        ret.set_store_op(store_op);
179        ret.set_view(view);
180        ret
181    }
182    #[cfg(all(
183        feature = "GpuLoadOp",
184        feature = "GpuStoreOp",
185        feature = "GpuTextureView",
186    ))]
187    #[doc = "Construct a new `GpuRenderPassColorAttachment`."]
188    #[doc = ""]
189    #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassColorAttachment`, `GpuStoreOp`, `GpuTextureView`*"]
190    #[doc = ""]
191    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
192    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
193    pub fn new_with_gpu_texture_view(
194        load_op: GpuLoadOp,
195        store_op: GpuStoreOp,
196        view: &GpuTextureView,
197    ) -> Self {
198        #[allow(unused_mut)]
199        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
200        ret.set_load_op(load_op);
201        ret.set_store_op(store_op);
202        ret.set_view_gpu_texture_view(view);
203        ret
204    }
205    #[cfg(web_sys_unstable_apis)]
206    #[deprecated = "Use `set_clear_value()` instead."]
207    pub fn clear_value(&mut self, val: &[::js_sys::Number]) -> &mut Self {
208        self.set_clear_value(val);
209        self
210    }
211    #[cfg(web_sys_unstable_apis)]
212    #[deprecated = "Use `set_depth_slice()` instead."]
213    pub fn depth_slice(&mut self, val: u32) -> &mut Self {
214        self.set_depth_slice(val);
215        self
216    }
217    #[cfg(web_sys_unstable_apis)]
218    #[cfg(feature = "GpuLoadOp")]
219    #[deprecated = "Use `set_load_op()` instead."]
220    pub fn load_op(&mut self, val: GpuLoadOp) -> &mut Self {
221        self.set_load_op(val);
222        self
223    }
224    #[cfg(web_sys_unstable_apis)]
225    #[deprecated = "Use `set_resolve_target()` instead."]
226    pub fn resolve_target(&mut self, val: &GpuTexture) -> &mut Self {
227        self.set_resolve_target(val);
228        self
229    }
230    #[cfg(web_sys_unstable_apis)]
231    #[cfg(feature = "GpuStoreOp")]
232    #[deprecated = "Use `set_store_op()` instead."]
233    pub fn store_op(&mut self, val: GpuStoreOp) -> &mut Self {
234        self.set_store_op(val);
235        self
236    }
237    #[cfg(web_sys_unstable_apis)]
238    #[deprecated = "Use `set_view()` instead."]
239    pub fn view(&mut self, val: &GpuTexture) -> &mut Self {
240        self.set_view(val);
241        self
242    }
243}