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: `GpuColorDict`, `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    #[cfg(feature = "GpuTexture")]
85    #[doc = "Get the `resolveTarget` field of this object."]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTexture`*"]
88    #[doc = ""]
89    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
90    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
91    #[wasm_bindgen(method, getter = "resolveTarget")]
92    pub fn get_resolve_target(this: &GpuRenderPassColorAttachment) -> Option<::js_sys::Object>;
93    #[cfg(web_sys_unstable_apis)]
94    #[cfg(feature = "GpuTexture")]
95    #[doc = "Change the `resolveTarget` field of this object."]
96    #[doc = ""]
97    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTexture`*"]
98    #[doc = ""]
99    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
100    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
101    #[wasm_bindgen(method, setter = "resolveTarget")]
102    pub fn set_resolve_target(this: &GpuRenderPassColorAttachment, val: &GpuTexture);
103    #[cfg(web_sys_unstable_apis)]
104    #[cfg(feature = "GpuTextureView")]
105    #[doc = "Change the `resolveTarget` field of this object."]
106    #[doc = ""]
107    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTextureView`*"]
108    #[doc = ""]
109    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
110    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
111    #[wasm_bindgen(method, setter = "resolveTarget")]
112    pub fn set_resolve_target_gpu_texture_view(
113        this: &GpuRenderPassColorAttachment,
114        val: &GpuTextureView,
115    );
116    #[cfg(web_sys_unstable_apis)]
117    #[cfg(feature = "GpuStoreOp")]
118    #[doc = "Get the `storeOp` field of this object."]
119    #[doc = ""]
120    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuStoreOp`*"]
121    #[doc = ""]
122    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
123    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
124    #[wasm_bindgen(method, getter = "storeOp")]
125    pub fn get_store_op(this: &GpuRenderPassColorAttachment) -> GpuStoreOp;
126    #[cfg(web_sys_unstable_apis)]
127    #[cfg(feature = "GpuStoreOp")]
128    #[doc = "Change the `storeOp` field of this object."]
129    #[doc = ""]
130    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuStoreOp`*"]
131    #[doc = ""]
132    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
133    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
134    #[wasm_bindgen(method, setter = "storeOp")]
135    pub fn set_store_op(this: &GpuRenderPassColorAttachment, val: GpuStoreOp);
136    #[cfg(web_sys_unstable_apis)]
137    #[cfg(feature = "GpuTexture")]
138    #[doc = "Get the `view` field of this object."]
139    #[doc = ""]
140    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTexture`*"]
141    #[doc = ""]
142    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
143    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
144    #[wasm_bindgen(method, getter = "view")]
145    pub fn get_view(this: &GpuRenderPassColorAttachment) -> ::js_sys::Object;
146    #[cfg(web_sys_unstable_apis)]
147    #[cfg(feature = "GpuTexture")]
148    #[doc = "Change the `view` field of this object."]
149    #[doc = ""]
150    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTexture`*"]
151    #[doc = ""]
152    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
153    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
154    #[wasm_bindgen(method, setter = "view")]
155    pub fn set_view(this: &GpuRenderPassColorAttachment, val: &GpuTexture);
156    #[cfg(web_sys_unstable_apis)]
157    #[cfg(feature = "GpuTextureView")]
158    #[doc = "Change the `view` field of this object."]
159    #[doc = ""]
160    #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTextureView`*"]
161    #[doc = ""]
162    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
163    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
164    #[wasm_bindgen(method, setter = "view")]
165    pub fn set_view_gpu_texture_view(this: &GpuRenderPassColorAttachment, val: &GpuTextureView);
166}
167#[cfg(web_sys_unstable_apis)]
168impl GpuRenderPassColorAttachment {
169    #[cfg(all(feature = "GpuLoadOp", feature = "GpuStoreOp", feature = "GpuTexture",))]
170    #[doc = "Construct a new `GpuRenderPassColorAttachment`."]
171    #[doc = ""]
172    #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassColorAttachment`, `GpuStoreOp`, `GpuTexture`*"]
173    #[doc = ""]
174    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
175    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
176    pub fn new(load_op: GpuLoadOp, store_op: GpuStoreOp, view: &GpuTexture) -> Self {
177        #[allow(unused_mut)]
178        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
179        ret.set_load_op(load_op);
180        ret.set_store_op(store_op);
181        ret.set_view(view);
182        ret
183    }
184    #[cfg(all(
185        feature = "GpuLoadOp",
186        feature = "GpuStoreOp",
187        feature = "GpuTextureView",
188    ))]
189    #[doc = "Construct a new `GpuRenderPassColorAttachment`."]
190    #[doc = ""]
191    #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassColorAttachment`, `GpuStoreOp`, `GpuTextureView`*"]
192    #[doc = ""]
193    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
194    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
195    pub fn new_with_gpu_texture_view(
196        load_op: GpuLoadOp,
197        store_op: GpuStoreOp,
198        view: &GpuTextureView,
199    ) -> Self {
200        #[allow(unused_mut)]
201        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
202        ret.set_load_op(load_op);
203        ret.set_store_op(store_op);
204        ret.set_view_gpu_texture_view(view);
205        ret
206    }
207    #[cfg(web_sys_unstable_apis)]
208    #[deprecated = "Use `set_clear_value()` instead."]
209    pub fn clear_value(&mut self, val: &[::js_sys::Number]) -> &mut Self {
210        self.set_clear_value(val);
211        self
212    }
213    #[cfg(web_sys_unstable_apis)]
214    #[deprecated = "Use `set_depth_slice()` instead."]
215    pub fn depth_slice(&mut self, val: u32) -> &mut Self {
216        self.set_depth_slice(val);
217        self
218    }
219    #[cfg(web_sys_unstable_apis)]
220    #[cfg(feature = "GpuLoadOp")]
221    #[deprecated = "Use `set_load_op()` instead."]
222    pub fn load_op(&mut self, val: GpuLoadOp) -> &mut Self {
223        self.set_load_op(val);
224        self
225    }
226    #[cfg(web_sys_unstable_apis)]
227    #[cfg(feature = "GpuTexture")]
228    #[deprecated = "Use `set_resolve_target()` instead."]
229    pub fn resolve_target(&mut self, val: &GpuTexture) -> &mut Self {
230        self.set_resolve_target(val);
231        self
232    }
233    #[cfg(web_sys_unstable_apis)]
234    #[cfg(feature = "GpuStoreOp")]
235    #[deprecated = "Use `set_store_op()` instead."]
236    pub fn store_op(&mut self, val: GpuStoreOp) -> &mut Self {
237        self.set_store_op(val);
238        self
239    }
240    #[cfg(web_sys_unstable_apis)]
241    #[cfg(feature = "GpuTexture")]
242    #[deprecated = "Use `set_view()` instead."]
243    pub fn view(&mut self, val: &GpuTexture) -> &mut Self {
244        self.set_view(val);
245        self
246    }
247}