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 = GPUDepthStencilState)] 8 #[derive(Debug, Clone, PartialEq, Eq)] 9 #[doc = "The `GpuDepthStencilState` dictionary."] 10 #[doc = ""] 11 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] 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 GpuDepthStencilState; 16 } 17 #[cfg(web_sys_unstable_apis)] 18 impl GpuDepthStencilState { 19 #[cfg(feature = "GpuTextureFormat")] 20 #[doc = "Construct a new `GpuDepthStencilState`."] 21 #[doc = ""] 22 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuTextureFormat`*"] 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(format: GpuTextureFormat) -> Self26 pub fn new(format: GpuTextureFormat) -> Self { 27 #[allow(unused_mut)] 28 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); 29 ret.format(format); 30 ret 31 } 32 #[cfg(web_sys_unstable_apis)] 33 #[doc = "Change the `depthBias` field of this object."] 34 #[doc = ""] 35 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] 36 #[doc = ""] 37 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 38 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] depth_bias(&mut self, val: i32) -> &mut Self39 pub fn depth_bias(&mut self, val: i32) -> &mut Self { 40 use wasm_bindgen::JsValue; 41 let r = ::js_sys::Reflect::set( 42 self.as_ref(), 43 &JsValue::from("depthBias"), 44 &JsValue::from(val), 45 ); 46 debug_assert!( 47 r.is_ok(), 48 "setting properties should never fail on our dictionary objects" 49 ); 50 let _ = r; 51 self 52 } 53 #[cfg(web_sys_unstable_apis)] 54 #[doc = "Change the `depthBiasClamp` field of this object."] 55 #[doc = ""] 56 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] 57 #[doc = ""] 58 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 59 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] depth_bias_clamp(&mut self, val: f32) -> &mut Self60 pub fn depth_bias_clamp(&mut self, val: f32) -> &mut Self { 61 use wasm_bindgen::JsValue; 62 let r = ::js_sys::Reflect::set( 63 self.as_ref(), 64 &JsValue::from("depthBiasClamp"), 65 &JsValue::from(val), 66 ); 67 debug_assert!( 68 r.is_ok(), 69 "setting properties should never fail on our dictionary objects" 70 ); 71 let _ = r; 72 self 73 } 74 #[cfg(web_sys_unstable_apis)] 75 #[doc = "Change the `depthBiasSlopeScale` field of this object."] 76 #[doc = ""] 77 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] 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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] depth_bias_slope_scale(&mut self, val: f32) -> &mut Self81 pub fn depth_bias_slope_scale(&mut self, val: f32) -> &mut Self { 82 use wasm_bindgen::JsValue; 83 let r = ::js_sys::Reflect::set( 84 self.as_ref(), 85 &JsValue::from("depthBiasSlopeScale"), 86 &JsValue::from(val), 87 ); 88 debug_assert!( 89 r.is_ok(), 90 "setting properties should never fail on our dictionary objects" 91 ); 92 let _ = r; 93 self 94 } 95 #[cfg(web_sys_unstable_apis)] 96 #[cfg(feature = "GpuCompareFunction")] 97 #[doc = "Change the `depthCompare` field of this object."] 98 #[doc = ""] 99 #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuDepthStencilState`*"] 100 #[doc = ""] 101 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 102 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] depth_compare(&mut self, val: GpuCompareFunction) -> &mut Self103 pub fn depth_compare(&mut self, val: GpuCompareFunction) -> &mut Self { 104 use wasm_bindgen::JsValue; 105 let r = ::js_sys::Reflect::set( 106 self.as_ref(), 107 &JsValue::from("depthCompare"), 108 &JsValue::from(val), 109 ); 110 debug_assert!( 111 r.is_ok(), 112 "setting properties should never fail on our dictionary objects" 113 ); 114 let _ = r; 115 self 116 } 117 #[cfg(web_sys_unstable_apis)] 118 #[doc = "Change the `depthWriteEnabled` field of this object."] 119 #[doc = ""] 120 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] 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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] depth_write_enabled(&mut self, val: bool) -> &mut Self124 pub fn depth_write_enabled(&mut self, val: bool) -> &mut Self { 125 use wasm_bindgen::JsValue; 126 let r = ::js_sys::Reflect::set( 127 self.as_ref(), 128 &JsValue::from("depthWriteEnabled"), 129 &JsValue::from(val), 130 ); 131 debug_assert!( 132 r.is_ok(), 133 "setting properties should never fail on our dictionary objects" 134 ); 135 let _ = r; 136 self 137 } 138 #[cfg(web_sys_unstable_apis)] 139 #[cfg(feature = "GpuTextureFormat")] 140 #[doc = "Change the `format` field of this object."] 141 #[doc = ""] 142 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuTextureFormat`*"] 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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] format(&mut self, val: GpuTextureFormat) -> &mut Self146 pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { 147 use wasm_bindgen::JsValue; 148 let r = 149 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); 150 debug_assert!( 151 r.is_ok(), 152 "setting properties should never fail on our dictionary objects" 153 ); 154 let _ = r; 155 self 156 } 157 #[cfg(web_sys_unstable_apis)] 158 #[cfg(feature = "GpuStencilFaceState")] 159 #[doc = "Change the `stencilBack` field of this object."] 160 #[doc = ""] 161 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuStencilFaceState`*"] 162 #[doc = ""] 163 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 164 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] stencil_back(&mut self, val: &GpuStencilFaceState) -> &mut Self165 pub fn stencil_back(&mut self, val: &GpuStencilFaceState) -> &mut Self { 166 use wasm_bindgen::JsValue; 167 let r = ::js_sys::Reflect::set( 168 self.as_ref(), 169 &JsValue::from("stencilBack"), 170 &JsValue::from(val), 171 ); 172 debug_assert!( 173 r.is_ok(), 174 "setting properties should never fail on our dictionary objects" 175 ); 176 let _ = r; 177 self 178 } 179 #[cfg(web_sys_unstable_apis)] 180 #[cfg(feature = "GpuStencilFaceState")] 181 #[doc = "Change the `stencilFront` field of this object."] 182 #[doc = ""] 183 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuStencilFaceState`*"] 184 #[doc = ""] 185 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 186 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] stencil_front(&mut self, val: &GpuStencilFaceState) -> &mut Self187 pub fn stencil_front(&mut self, val: &GpuStencilFaceState) -> &mut Self { 188 use wasm_bindgen::JsValue; 189 let r = ::js_sys::Reflect::set( 190 self.as_ref(), 191 &JsValue::from("stencilFront"), 192 &JsValue::from(val), 193 ); 194 debug_assert!( 195 r.is_ok(), 196 "setting properties should never fail on our dictionary objects" 197 ); 198 let _ = r; 199 self 200 } 201 #[cfg(web_sys_unstable_apis)] 202 #[doc = "Change the `stencilReadMask` field of this object."] 203 #[doc = ""] 204 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] 205 #[doc = ""] 206 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 207 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] stencil_read_mask(&mut self, val: u32) -> &mut Self208 pub fn stencil_read_mask(&mut self, val: u32) -> &mut Self { 209 use wasm_bindgen::JsValue; 210 let r = ::js_sys::Reflect::set( 211 self.as_ref(), 212 &JsValue::from("stencilReadMask"), 213 &JsValue::from(val), 214 ); 215 debug_assert!( 216 r.is_ok(), 217 "setting properties should never fail on our dictionary objects" 218 ); 219 let _ = r; 220 self 221 } 222 #[cfg(web_sys_unstable_apis)] 223 #[doc = "Change the `stencilWriteMask` field of this object."] 224 #[doc = ""] 225 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] 226 #[doc = ""] 227 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 228 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] stencil_write_mask(&mut self, val: u32) -> &mut Self229 pub fn stencil_write_mask(&mut self, val: u32) -> &mut Self { 230 use wasm_bindgen::JsValue; 231 let r = ::js_sys::Reflect::set( 232 self.as_ref(), 233 &JsValue::from("stencilWriteMask"), 234 &JsValue::from(val), 235 ); 236 debug_assert!( 237 r.is_ok(), 238 "setting properties should never fail on our dictionary objects" 239 ); 240 let _ = r; 241 self 242 } 243 } 244