web_sys/features/
gen_GpuDepthStencilState.rs1#![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 = GPUDepthStencilState)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `GpuDepthStencilState` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16 pub type GpuDepthStencilState;
17 #[cfg(web_sys_unstable_apis)]
18 #[doc = "Get the `depthBias` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
24 #[wasm_bindgen(method, getter = "depthBias")]
25 pub fn get_depth_bias(this: &GpuDepthStencilState) -> Option<i32>;
26 #[cfg(web_sys_unstable_apis)]
27 #[doc = "Change the `depthBias` field of this object."]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
33 #[wasm_bindgen(method, setter = "depthBias")]
34 pub fn set_depth_bias(this: &GpuDepthStencilState, val: i32);
35 #[cfg(web_sys_unstable_apis)]
36 #[doc = "Get the `depthBiasClamp` field of this object."]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"]
39 #[doc = ""]
40 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
41 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
42 #[wasm_bindgen(method, getter = "depthBiasClamp")]
43 pub fn get_depth_bias_clamp(this: &GpuDepthStencilState) -> Option<f32>;
44 #[cfg(web_sys_unstable_apis)]
45 #[doc = "Change the `depthBiasClamp` field of this object."]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"]
48 #[doc = ""]
49 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
51 #[wasm_bindgen(method, setter = "depthBiasClamp")]
52 pub fn set_depth_bias_clamp(this: &GpuDepthStencilState, val: f32);
53 #[cfg(web_sys_unstable_apis)]
54 #[doc = "Get the `depthBiasSlopeScale` 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)*"]
60 #[wasm_bindgen(method, getter = "depthBiasSlopeScale")]
61 pub fn get_depth_bias_slope_scale(this: &GpuDepthStencilState) -> Option<f32>;
62 #[cfg(web_sys_unstable_apis)]
63 #[doc = "Change the `depthBiasSlopeScale` field of this object."]
64 #[doc = ""]
65 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"]
66 #[doc = ""]
67 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
68 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
69 #[wasm_bindgen(method, setter = "depthBiasSlopeScale")]
70 pub fn set_depth_bias_slope_scale(this: &GpuDepthStencilState, val: f32);
71 #[cfg(web_sys_unstable_apis)]
72 #[cfg(feature = "GpuCompareFunction")]
73 #[doc = "Get the `depthCompare` field of this object."]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuDepthStencilState`*"]
76 #[doc = ""]
77 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
78 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
79 #[wasm_bindgen(method, getter = "depthCompare")]
80 pub fn get_depth_compare(this: &GpuDepthStencilState) -> Option<GpuCompareFunction>;
81 #[cfg(web_sys_unstable_apis)]
82 #[cfg(feature = "GpuCompareFunction")]
83 #[doc = "Change the `depthCompare` field of this object."]
84 #[doc = ""]
85 #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuDepthStencilState`*"]
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)*"]
89 #[wasm_bindgen(method, setter = "depthCompare")]
90 pub fn set_depth_compare(this: &GpuDepthStencilState, val: GpuCompareFunction);
91 #[cfg(web_sys_unstable_apis)]
92 #[doc = "Get the `depthWriteEnabled` field of this object."]
93 #[doc = ""]
94 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"]
95 #[doc = ""]
96 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
97 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
98 #[wasm_bindgen(method, getter = "depthWriteEnabled")]
99 pub fn get_depth_write_enabled(this: &GpuDepthStencilState) -> Option<bool>;
100 #[cfg(web_sys_unstable_apis)]
101 #[doc = "Change the `depthWriteEnabled` field of this object."]
102 #[doc = ""]
103 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"]
104 #[doc = ""]
105 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
106 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
107 #[wasm_bindgen(method, setter = "depthWriteEnabled")]
108 pub fn set_depth_write_enabled(this: &GpuDepthStencilState, val: bool);
109 #[cfg(web_sys_unstable_apis)]
110 #[cfg(feature = "GpuTextureFormat")]
111 #[doc = "Get the `format` field of this object."]
112 #[doc = ""]
113 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuTextureFormat`*"]
114 #[doc = ""]
115 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
116 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
117 #[wasm_bindgen(method, getter = "format")]
118 pub fn get_format(this: &GpuDepthStencilState) -> GpuTextureFormat;
119 #[cfg(web_sys_unstable_apis)]
120 #[cfg(feature = "GpuTextureFormat")]
121 #[doc = "Change the `format` field of this object."]
122 #[doc = ""]
123 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuTextureFormat`*"]
124 #[doc = ""]
125 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
126 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
127 #[wasm_bindgen(method, setter = "format")]
128 pub fn set_format(this: &GpuDepthStencilState, val: GpuTextureFormat);
129 #[cfg(web_sys_unstable_apis)]
130 #[cfg(feature = "GpuStencilFaceState")]
131 #[doc = "Get the `stencilBack` field of this object."]
132 #[doc = ""]
133 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuStencilFaceState`*"]
134 #[doc = ""]
135 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
136 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
137 #[wasm_bindgen(method, getter = "stencilBack")]
138 pub fn get_stencil_back(this: &GpuDepthStencilState) -> Option<GpuStencilFaceState>;
139 #[cfg(web_sys_unstable_apis)]
140 #[cfg(feature = "GpuStencilFaceState")]
141 #[doc = "Change the `stencilBack` field of this object."]
142 #[doc = ""]
143 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuStencilFaceState`*"]
144 #[doc = ""]
145 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
146 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
147 #[wasm_bindgen(method, setter = "stencilBack")]
148 pub fn set_stencil_back(this: &GpuDepthStencilState, val: &GpuStencilFaceState);
149 #[cfg(web_sys_unstable_apis)]
150 #[cfg(feature = "GpuStencilFaceState")]
151 #[doc = "Get the `stencilFront` field of this object."]
152 #[doc = ""]
153 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuStencilFaceState`*"]
154 #[doc = ""]
155 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
156 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
157 #[wasm_bindgen(method, getter = "stencilFront")]
158 pub fn get_stencil_front(this: &GpuDepthStencilState) -> Option<GpuStencilFaceState>;
159 #[cfg(web_sys_unstable_apis)]
160 #[cfg(feature = "GpuStencilFaceState")]
161 #[doc = "Change the `stencilFront` field of this object."]
162 #[doc = ""]
163 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuStencilFaceState`*"]
164 #[doc = ""]
165 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
166 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
167 #[wasm_bindgen(method, setter = "stencilFront")]
168 pub fn set_stencil_front(this: &GpuDepthStencilState, val: &GpuStencilFaceState);
169 #[cfg(web_sys_unstable_apis)]
170 #[doc = "Get the `stencilReadMask` field of this object."]
171 #[doc = ""]
172 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
176 #[wasm_bindgen(method, getter = "stencilReadMask")]
177 pub fn get_stencil_read_mask(this: &GpuDepthStencilState) -> Option<u32>;
178 #[cfg(web_sys_unstable_apis)]
179 #[doc = "Change the `stencilReadMask` field of this object."]
180 #[doc = ""]
181 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"]
182 #[doc = ""]
183 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
184 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
185 #[wasm_bindgen(method, setter = "stencilReadMask")]
186 pub fn set_stencil_read_mask(this: &GpuDepthStencilState, val: u32);
187 #[cfg(web_sys_unstable_apis)]
188 #[doc = "Get the `stencilWriteMask` field of this object."]
189 #[doc = ""]
190 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"]
191 #[doc = ""]
192 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
193 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
194 #[wasm_bindgen(method, getter = "stencilWriteMask")]
195 pub fn get_stencil_write_mask(this: &GpuDepthStencilState) -> Option<u32>;
196 #[cfg(web_sys_unstable_apis)]
197 #[doc = "Change the `stencilWriteMask` field of this object."]
198 #[doc = ""]
199 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"]
200 #[doc = ""]
201 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
202 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
203 #[wasm_bindgen(method, setter = "stencilWriteMask")]
204 pub fn set_stencil_write_mask(this: &GpuDepthStencilState, val: u32);
205}
206#[cfg(web_sys_unstable_apis)]
207impl GpuDepthStencilState {
208 #[cfg(feature = "GpuTextureFormat")]
209 #[doc = "Construct a new `GpuDepthStencilState`."]
210 #[doc = ""]
211 #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuTextureFormat`*"]
212 #[doc = ""]
213 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
214 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
215 pub fn new(format: GpuTextureFormat) -> Self {
216 #[allow(unused_mut)]
217 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
218 ret.set_format(format);
219 ret
220 }
221 #[cfg(web_sys_unstable_apis)]
222 #[deprecated = "Use `set_depth_bias()` instead."]
223 pub fn depth_bias(&mut self, val: i32) -> &mut Self {
224 self.set_depth_bias(val);
225 self
226 }
227 #[cfg(web_sys_unstable_apis)]
228 #[deprecated = "Use `set_depth_bias_clamp()` instead."]
229 pub fn depth_bias_clamp(&mut self, val: f32) -> &mut Self {
230 self.set_depth_bias_clamp(val);
231 self
232 }
233 #[cfg(web_sys_unstable_apis)]
234 #[deprecated = "Use `set_depth_bias_slope_scale()` instead."]
235 pub fn depth_bias_slope_scale(&mut self, val: f32) -> &mut Self {
236 self.set_depth_bias_slope_scale(val);
237 self
238 }
239 #[cfg(web_sys_unstable_apis)]
240 #[cfg(feature = "GpuCompareFunction")]
241 #[deprecated = "Use `set_depth_compare()` instead."]
242 pub fn depth_compare(&mut self, val: GpuCompareFunction) -> &mut Self {
243 self.set_depth_compare(val);
244 self
245 }
246 #[cfg(web_sys_unstable_apis)]
247 #[deprecated = "Use `set_depth_write_enabled()` instead."]
248 pub fn depth_write_enabled(&mut self, val: bool) -> &mut Self {
249 self.set_depth_write_enabled(val);
250 self
251 }
252 #[cfg(web_sys_unstable_apis)]
253 #[cfg(feature = "GpuTextureFormat")]
254 #[deprecated = "Use `set_format()` instead."]
255 pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self {
256 self.set_format(val);
257 self
258 }
259 #[cfg(web_sys_unstable_apis)]
260 #[cfg(feature = "GpuStencilFaceState")]
261 #[deprecated = "Use `set_stencil_back()` instead."]
262 pub fn stencil_back(&mut self, val: &GpuStencilFaceState) -> &mut Self {
263 self.set_stencil_back(val);
264 self
265 }
266 #[cfg(web_sys_unstable_apis)]
267 #[cfg(feature = "GpuStencilFaceState")]
268 #[deprecated = "Use `set_stencil_front()` instead."]
269 pub fn stencil_front(&mut self, val: &GpuStencilFaceState) -> &mut Self {
270 self.set_stencil_front(val);
271 self
272 }
273 #[cfg(web_sys_unstable_apis)]
274 #[deprecated = "Use `set_stencil_read_mask()` instead."]
275 pub fn stencil_read_mask(&mut self, val: u32) -> &mut Self {
276 self.set_stencil_read_mask(val);
277 self
278 }
279 #[cfg(web_sys_unstable_apis)]
280 #[deprecated = "Use `set_stencil_write_mask()` instead."]
281 pub fn stencil_write_mask(&mut self, val: u32) -> &mut Self {
282 self.set_stencil_write_mask(val);
283 self
284 }
285}