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 = GPUSamplerDescriptor)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `GpuSamplerDescriptor` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"]
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 GpuSamplerDescriptor;
17 #[cfg(web_sys_unstable_apis)]
18 #[doc = "Get the `label` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"]
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 = "label")]
25 pub fn get_label(this: &GpuSamplerDescriptor) -> Option<::alloc::string::String>;
26 #[cfg(web_sys_unstable_apis)]
27 #[doc = "Change the `label` field of this object."]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"]
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 = "label")]
34 pub fn set_label(this: &GpuSamplerDescriptor, val: &str);
35 #[cfg(web_sys_unstable_apis)]
36 #[cfg(feature = "GpuAddressMode")]
37 #[doc = "Get the `addressModeU` field of this object."]
38 #[doc = ""]
39 #[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
43 #[wasm_bindgen(method, getter = "addressModeU")]
44 pub fn get_address_mode_u(this: &GpuSamplerDescriptor) -> Option<GpuAddressMode>;
45 #[cfg(web_sys_unstable_apis)]
46 #[cfg(feature = "GpuAddressMode")]
47 #[doc = "Change the `addressModeU` field of this object."]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"]
50 #[doc = ""]
51 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53 #[wasm_bindgen(method, setter = "addressModeU")]
54 pub fn set_address_mode_u(this: &GpuSamplerDescriptor, val: GpuAddressMode);
55 #[cfg(web_sys_unstable_apis)]
56 #[cfg(feature = "GpuAddressMode")]
57 #[doc = "Get the `addressModeV` field of this object."]
58 #[doc = ""]
59 #[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"]
60 #[doc = ""]
61 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
62 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
63 #[wasm_bindgen(method, getter = "addressModeV")]
64 pub fn get_address_mode_v(this: &GpuSamplerDescriptor) -> Option<GpuAddressMode>;
65 #[cfg(web_sys_unstable_apis)]
66 #[cfg(feature = "GpuAddressMode")]
67 #[doc = "Change the `addressModeV` field of this object."]
68 #[doc = ""]
69 #[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"]
70 #[doc = ""]
71 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
72 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
73 #[wasm_bindgen(method, setter = "addressModeV")]
74 pub fn set_address_mode_v(this: &GpuSamplerDescriptor, val: GpuAddressMode);
75 #[cfg(web_sys_unstable_apis)]
76 #[cfg(feature = "GpuAddressMode")]
77 #[doc = "Get the `addressModeW` field of this object."]
78 #[doc = ""]
79 #[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"]
80 #[doc = ""]
81 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
82 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
83 #[wasm_bindgen(method, getter = "addressModeW")]
84 pub fn get_address_mode_w(this: &GpuSamplerDescriptor) -> Option<GpuAddressMode>;
85 #[cfg(web_sys_unstable_apis)]
86 #[cfg(feature = "GpuAddressMode")]
87 #[doc = "Change the `addressModeW` field of this object."]
88 #[doc = ""]
89 #[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"]
90 #[doc = ""]
91 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
92 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
93 #[wasm_bindgen(method, setter = "addressModeW")]
94 pub fn set_address_mode_w(this: &GpuSamplerDescriptor, val: GpuAddressMode);
95 #[cfg(web_sys_unstable_apis)]
96 #[cfg(feature = "GpuCompareFunction")]
97 #[doc = "Get the `compare` field of this object."]
98 #[doc = ""]
99 #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuSamplerDescriptor`*"]
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)*"]
103 #[wasm_bindgen(method, getter = "compare")]
104 pub fn get_compare(this: &GpuSamplerDescriptor) -> Option<GpuCompareFunction>;
105 #[cfg(web_sys_unstable_apis)]
106 #[cfg(feature = "GpuCompareFunction")]
107 #[doc = "Change the `compare` field of this object."]
108 #[doc = ""]
109 #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuSamplerDescriptor`*"]
110 #[doc = ""]
111 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
112 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
113 #[wasm_bindgen(method, setter = "compare")]
114 pub fn set_compare(this: &GpuSamplerDescriptor, val: GpuCompareFunction);
115 #[cfg(web_sys_unstable_apis)]
116 #[doc = "Get the `lodMaxClamp` field of this object."]
117 #[doc = ""]
118 #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"]
119 #[doc = ""]
120 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
121 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
122 #[wasm_bindgen(method, getter = "lodMaxClamp")]
123 pub fn get_lod_max_clamp(this: &GpuSamplerDescriptor) -> Option<f32>;
124 #[cfg(web_sys_unstable_apis)]
125 #[doc = "Change the `lodMaxClamp` field of this object."]
126 #[doc = ""]
127 #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"]
128 #[doc = ""]
129 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
130 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
131 #[wasm_bindgen(method, setter = "lodMaxClamp")]
132 pub fn set_lod_max_clamp(this: &GpuSamplerDescriptor, val: f32);
133 #[cfg(web_sys_unstable_apis)]
134 #[doc = "Get the `lodMinClamp` field of this object."]
135 #[doc = ""]
136 #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"]
137 #[doc = ""]
138 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
139 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
140 #[wasm_bindgen(method, getter = "lodMinClamp")]
141 pub fn get_lod_min_clamp(this: &GpuSamplerDescriptor) -> Option<f32>;
142 #[cfg(web_sys_unstable_apis)]
143 #[doc = "Change the `lodMinClamp` field of this object."]
144 #[doc = ""]
145 #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"]
146 #[doc = ""]
147 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
148 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
149 #[wasm_bindgen(method, setter = "lodMinClamp")]
150 pub fn set_lod_min_clamp(this: &GpuSamplerDescriptor, val: f32);
151 #[cfg(web_sys_unstable_apis)]
152 #[cfg(feature = "GpuFilterMode")]
153 #[doc = "Get the `magFilter` field of this object."]
154 #[doc = ""]
155 #[doc = "*This API requires the following crate features to be activated: `GpuFilterMode`, `GpuSamplerDescriptor`*"]
156 #[doc = ""]
157 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
158 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
159 #[wasm_bindgen(method, getter = "magFilter")]
160 pub fn get_mag_filter(this: &GpuSamplerDescriptor) -> Option<GpuFilterMode>;
161 #[cfg(web_sys_unstable_apis)]
162 #[cfg(feature = "GpuFilterMode")]
163 #[doc = "Change the `magFilter` field of this object."]
164 #[doc = ""]
165 #[doc = "*This API requires the following crate features to be activated: `GpuFilterMode`, `GpuSamplerDescriptor`*"]
166 #[doc = ""]
167 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
168 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
169 #[wasm_bindgen(method, setter = "magFilter")]
170 pub fn set_mag_filter(this: &GpuSamplerDescriptor, val: GpuFilterMode);
171 #[cfg(web_sys_unstable_apis)]
172 #[doc = "Get the `maxAnisotropy` field of this object."]
173 #[doc = ""]
174 #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"]
175 #[doc = ""]
176 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
177 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
178 #[wasm_bindgen(method, getter = "maxAnisotropy")]
179 pub fn get_max_anisotropy(this: &GpuSamplerDescriptor) -> Option<u16>;
180 #[cfg(web_sys_unstable_apis)]
181 #[doc = "Change the `maxAnisotropy` field of this object."]
182 #[doc = ""]
183 #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"]
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)*"]
187 #[wasm_bindgen(method, setter = "maxAnisotropy")]
188 pub fn set_max_anisotropy(this: &GpuSamplerDescriptor, val: u16);
189 #[cfg(web_sys_unstable_apis)]
190 #[cfg(feature = "GpuFilterMode")]
191 #[doc = "Get the `minFilter` field of this object."]
192 #[doc = ""]
193 #[doc = "*This API requires the following crate features to be activated: `GpuFilterMode`, `GpuSamplerDescriptor`*"]
194 #[doc = ""]
195 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
196 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
197 #[wasm_bindgen(method, getter = "minFilter")]
198 pub fn get_min_filter(this: &GpuSamplerDescriptor) -> Option<GpuFilterMode>;
199 #[cfg(web_sys_unstable_apis)]
200 #[cfg(feature = "GpuFilterMode")]
201 #[doc = "Change the `minFilter` field of this object."]
202 #[doc = ""]
203 #[doc = "*This API requires the following crate features to be activated: `GpuFilterMode`, `GpuSamplerDescriptor`*"]
204 #[doc = ""]
205 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
206 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
207 #[wasm_bindgen(method, setter = "minFilter")]
208 pub fn set_min_filter(this: &GpuSamplerDescriptor, val: GpuFilterMode);
209 #[cfg(web_sys_unstable_apis)]
210 #[cfg(feature = "GpuMipmapFilterMode")]
211 #[doc = "Get the `mipmapFilter` field of this object."]
212 #[doc = ""]
213 #[doc = "*This API requires the following crate features to be activated: `GpuMipmapFilterMode`, `GpuSamplerDescriptor`*"]
214 #[doc = ""]
215 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
216 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
217 #[wasm_bindgen(method, getter = "mipmapFilter")]
218 pub fn get_mipmap_filter(this: &GpuSamplerDescriptor) -> Option<GpuMipmapFilterMode>;
219 #[cfg(web_sys_unstable_apis)]
220 #[cfg(feature = "GpuMipmapFilterMode")]
221 #[doc = "Change the `mipmapFilter` field of this object."]
222 #[doc = ""]
223 #[doc = "*This API requires the following crate features to be activated: `GpuMipmapFilterMode`, `GpuSamplerDescriptor`*"]
224 #[doc = ""]
225 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
226 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
227 #[wasm_bindgen(method, setter = "mipmapFilter")]
228 pub fn set_mipmap_filter(this: &GpuSamplerDescriptor, val: GpuMipmapFilterMode);
229}
230#[cfg(web_sys_unstable_apis)]
231impl GpuSamplerDescriptor {
232 #[doc = "Construct a new `GpuSamplerDescriptor`."]
233 #[doc = ""]
234 #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"]
235 #[doc = ""]
236 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
237 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
238 pub fn new() -> Self {
239 #[allow(unused_mut)]
240 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
241 ret
242 }
243 #[cfg(web_sys_unstable_apis)]
244 #[deprecated = "Use `set_label()` instead."]
245 pub fn label(&mut self, val: &str) -> &mut Self {
246 self.set_label(val);
247 self
248 }
249 #[cfg(web_sys_unstable_apis)]
250 #[cfg(feature = "GpuAddressMode")]
251 #[deprecated = "Use `set_address_mode_u()` instead."]
252 pub fn address_mode_u(&mut self, val: GpuAddressMode) -> &mut Self {
253 self.set_address_mode_u(val);
254 self
255 }
256 #[cfg(web_sys_unstable_apis)]
257 #[cfg(feature = "GpuAddressMode")]
258 #[deprecated = "Use `set_address_mode_v()` instead."]
259 pub fn address_mode_v(&mut self, val: GpuAddressMode) -> &mut Self {
260 self.set_address_mode_v(val);
261 self
262 }
263 #[cfg(web_sys_unstable_apis)]
264 #[cfg(feature = "GpuAddressMode")]
265 #[deprecated = "Use `set_address_mode_w()` instead."]
266 pub fn address_mode_w(&mut self, val: GpuAddressMode) -> &mut Self {
267 self.set_address_mode_w(val);
268 self
269 }
270 #[cfg(web_sys_unstable_apis)]
271 #[cfg(feature = "GpuCompareFunction")]
272 #[deprecated = "Use `set_compare()` instead."]
273 pub fn compare(&mut self, val: GpuCompareFunction) -> &mut Self {
274 self.set_compare(val);
275 self
276 }
277 #[cfg(web_sys_unstable_apis)]
278 #[deprecated = "Use `set_lod_max_clamp()` instead."]
279 pub fn lod_max_clamp(&mut self, val: f32) -> &mut Self {
280 self.set_lod_max_clamp(val);
281 self
282 }
283 #[cfg(web_sys_unstable_apis)]
284 #[deprecated = "Use `set_lod_min_clamp()` instead."]
285 pub fn lod_min_clamp(&mut self, val: f32) -> &mut Self {
286 self.set_lod_min_clamp(val);
287 self
288 }
289 #[cfg(web_sys_unstable_apis)]
290 #[cfg(feature = "GpuFilterMode")]
291 #[deprecated = "Use `set_mag_filter()` instead."]
292 pub fn mag_filter(&mut self, val: GpuFilterMode) -> &mut Self {
293 self.set_mag_filter(val);
294 self
295 }
296 #[cfg(web_sys_unstable_apis)]
297 #[deprecated = "Use `set_max_anisotropy()` instead."]
298 pub fn max_anisotropy(&mut self, val: u16) -> &mut Self {
299 self.set_max_anisotropy(val);
300 self
301 }
302 #[cfg(web_sys_unstable_apis)]
303 #[cfg(feature = "GpuFilterMode")]
304 #[deprecated = "Use `set_min_filter()` instead."]
305 pub fn min_filter(&mut self, val: GpuFilterMode) -> &mut Self {
306 self.set_min_filter(val);
307 self
308 }
309 #[cfg(web_sys_unstable_apis)]
310 #[cfg(feature = "GpuMipmapFilterMode")]
311 #[deprecated = "Use `set_mipmap_filter()` instead."]
312 pub fn mipmap_filter(&mut self, val: GpuMipmapFilterMode) -> &mut Self {
313 self.set_mipmap_filter(val);
314 self
315 }
316}
317#[cfg(web_sys_unstable_apis)]
318impl Default for GpuSamplerDescriptor {
319 fn default() -> Self {
320 Self::new()
321 }
322}