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 = GPURenderPassColorAttachment)] 8 #[derive(Debug, Clone, PartialEq, Eq)] 9 #[doc = "The `GpuRenderPassColorAttachment` dictionary."] 10 #[doc = ""] 11 #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"] 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 GpuRenderPassColorAttachment; 16 } 17 #[cfg(web_sys_unstable_apis)] 18 impl GpuRenderPassColorAttachment { 19 #[cfg(all(feature = "GpuStoreOp", feature = "GpuTextureView",))] 20 #[doc = "Construct a new `GpuRenderPassColorAttachment`."] 21 #[doc = ""] 22 #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuStoreOp`, `GpuTextureView`*"] 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( load_value: &::wasm_bindgen::JsValue, store_op: GpuStoreOp, view: &GpuTextureView, ) -> Self26 pub fn new( 27 load_value: &::wasm_bindgen::JsValue, 28 store_op: GpuStoreOp, 29 view: &GpuTextureView, 30 ) -> Self { 31 #[allow(unused_mut)] 32 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); 33 ret.load_value(load_value); 34 ret.store_op(store_op); 35 ret.view(view); 36 ret 37 } 38 #[cfg(web_sys_unstable_apis)] 39 #[doc = "Change the `loadValue` field of this object."] 40 #[doc = ""] 41 #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"] 42 #[doc = ""] 43 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 44 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] load_value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self45 pub fn load_value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 46 use wasm_bindgen::JsValue; 47 let r = ::js_sys::Reflect::set( 48 self.as_ref(), 49 &JsValue::from("loadValue"), 50 &JsValue::from(val), 51 ); 52 debug_assert!( 53 r.is_ok(), 54 "setting properties should never fail on our dictionary objects" 55 ); 56 let _ = r; 57 self 58 } 59 #[cfg(web_sys_unstable_apis)] 60 #[cfg(feature = "GpuTextureView")] 61 #[doc = "Change the `resolveTarget` field of this object."] 62 #[doc = ""] 63 #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTextureView`*"] 64 #[doc = ""] 65 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 66 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] resolve_target(&mut self, val: &GpuTextureView) -> &mut Self67 pub fn resolve_target(&mut self, val: &GpuTextureView) -> &mut Self { 68 use wasm_bindgen::JsValue; 69 let r = ::js_sys::Reflect::set( 70 self.as_ref(), 71 &JsValue::from("resolveTarget"), 72 &JsValue::from(val), 73 ); 74 debug_assert!( 75 r.is_ok(), 76 "setting properties should never fail on our dictionary objects" 77 ); 78 let _ = r; 79 self 80 } 81 #[cfg(web_sys_unstable_apis)] 82 #[cfg(feature = "GpuStoreOp")] 83 #[doc = "Change the `storeOp` field of this object."] 84 #[doc = ""] 85 #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuStoreOp`*"] 86 #[doc = ""] 87 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 88 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] store_op(&mut self, val: GpuStoreOp) -> &mut Self89 pub fn store_op(&mut self, val: GpuStoreOp) -> &mut Self { 90 use wasm_bindgen::JsValue; 91 let r = ::js_sys::Reflect::set( 92 self.as_ref(), 93 &JsValue::from("storeOp"), 94 &JsValue::from(val), 95 ); 96 debug_assert!( 97 r.is_ok(), 98 "setting properties should never fail on our dictionary objects" 99 ); 100 let _ = r; 101 self 102 } 103 #[cfg(web_sys_unstable_apis)] 104 #[cfg(feature = "GpuTextureView")] 105 #[doc = "Change the `view` 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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] view(&mut self, val: &GpuTextureView) -> &mut Self111 pub fn view(&mut self, val: &GpuTextureView) -> &mut Self { 112 use wasm_bindgen::JsValue; 113 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); 114 debug_assert!( 115 r.is_ok(), 116 "setting properties should never fail on our dictionary objects" 117 ); 118 let _ = r; 119 self 120 } 121 } 122