web_sys/features/
gen_GpuBindGroupEntry.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 = GPUBindGroupEntry)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `GpuBindGroupEntry` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
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 GpuBindGroupEntry;
17 #[cfg(web_sys_unstable_apis)]
18 #[doc = "Get the `binding` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
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 = "binding")]
25 pub fn get_binding(this: &GpuBindGroupEntry) -> u32;
26 #[cfg(web_sys_unstable_apis)]
27 #[doc = "Change the `binding` field of this object."]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
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 = "binding")]
34 pub fn set_binding(this: &GpuBindGroupEntry, val: u32);
35 #[cfg(web_sys_unstable_apis)]
36 #[cfg(feature = "GpuSampler")]
37 #[doc = "Get the `resource` field of this object."]
38 #[doc = ""]
39 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuSampler`*"]
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, getter = "resource")]
44 pub fn get_resource(this: &GpuBindGroupEntry) -> ::wasm_bindgen::JsValue;
45 #[cfg(web_sys_unstable_apis)]
46 #[cfg(feature = "GpuSampler")]
47 #[doc = "Change the `resource` field of this object."]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuSampler`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
53 #[wasm_bindgen(method, setter = "resource")]
54 pub fn set_resource(this: &GpuBindGroupEntry, val: &GpuSampler);
55 #[cfg(web_sys_unstable_apis)]
56 #[cfg(feature = "GpuTexture")]
57 #[doc = "Change the `resource` field of this object."]
58 #[doc = ""]
59 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuTexture`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
63 #[wasm_bindgen(method, setter = "resource")]
64 pub fn set_resource_gpu_texture(this: &GpuBindGroupEntry, val: &GpuTexture);
65 #[cfg(web_sys_unstable_apis)]
66 #[cfg(feature = "GpuTextureView")]
67 #[doc = "Change the `resource` field of this object."]
68 #[doc = ""]
69 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuTextureView`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
73 #[wasm_bindgen(method, setter = "resource")]
74 pub fn set_resource_gpu_texture_view(this: &GpuBindGroupEntry, val: &GpuTextureView);
75 #[cfg(web_sys_unstable_apis)]
76 #[cfg(feature = "GpuBuffer")]
77 #[doc = "Change the `resource` field of this object."]
78 #[doc = ""]
79 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuBuffer`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
83 #[wasm_bindgen(method, setter = "resource")]
84 pub fn set_resource_gpu_buffer(this: &GpuBindGroupEntry, val: &GpuBuffer);
85 #[cfg(web_sys_unstable_apis)]
86 #[cfg(feature = "GpuBufferBinding")]
87 #[doc = "Change the `resource` field of this object."]
88 #[doc = ""]
89 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuBufferBinding`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
93 #[wasm_bindgen(method, setter = "resource")]
94 pub fn set_resource_gpu_buffer_binding(this: &GpuBindGroupEntry, val: &GpuBufferBinding);
95 #[cfg(web_sys_unstable_apis)]
96 #[cfg(feature = "GpuExternalTexture")]
97 #[doc = "Change the `resource` field of this object."]
98 #[doc = ""]
99 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuExternalTexture`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
103 #[wasm_bindgen(method, setter = "resource")]
104 pub fn set_resource_gpu_external_texture(this: &GpuBindGroupEntry, val: &GpuExternalTexture);
105}
106#[cfg(web_sys_unstable_apis)]
107impl GpuBindGroupEntry {
108 #[cfg(feature = "GpuSampler")]
109 #[doc = "Construct a new `GpuBindGroupEntry`."]
110 #[doc = ""]
111 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuSampler`*"]
112 #[doc = ""]
113 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
114 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
115 pub fn new(binding: u32, resource: &GpuSampler) -> Self {
116 #[allow(unused_mut)]
117 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
118 ret.set_binding(binding);
119 ret.set_resource(resource);
120 ret
121 }
122 #[cfg(feature = "GpuTexture")]
123 #[doc = "Construct a new `GpuBindGroupEntry`."]
124 #[doc = ""]
125 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuTexture`*"]
126 #[doc = ""]
127 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
128 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
129 pub fn new_with_gpu_texture(binding: u32, resource: &GpuTexture) -> Self {
130 #[allow(unused_mut)]
131 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
132 ret.set_binding(binding);
133 ret.set_resource_gpu_texture(resource);
134 ret
135 }
136 #[cfg(feature = "GpuTextureView")]
137 #[doc = "Construct a new `GpuBindGroupEntry`."]
138 #[doc = ""]
139 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuTextureView`*"]
140 #[doc = ""]
141 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
142 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
143 pub fn new_with_gpu_texture_view(binding: u32, resource: &GpuTextureView) -> Self {
144 #[allow(unused_mut)]
145 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
146 ret.set_binding(binding);
147 ret.set_resource_gpu_texture_view(resource);
148 ret
149 }
150 #[cfg(feature = "GpuBuffer")]
151 #[doc = "Construct a new `GpuBindGroupEntry`."]
152 #[doc = ""]
153 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuBuffer`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
157 pub fn new_with_gpu_buffer(binding: u32, resource: &GpuBuffer) -> Self {
158 #[allow(unused_mut)]
159 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
160 ret.set_binding(binding);
161 ret.set_resource_gpu_buffer(resource);
162 ret
163 }
164 #[cfg(feature = "GpuBufferBinding")]
165 #[doc = "Construct a new `GpuBindGroupEntry`."]
166 #[doc = ""]
167 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuBufferBinding`*"]
168 #[doc = ""]
169 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
170 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
171 pub fn new_with_gpu_buffer_binding(binding: u32, resource: &GpuBufferBinding) -> Self {
172 #[allow(unused_mut)]
173 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
174 ret.set_binding(binding);
175 ret.set_resource_gpu_buffer_binding(resource);
176 ret
177 }
178 #[cfg(feature = "GpuExternalTexture")]
179 #[doc = "Construct a new `GpuBindGroupEntry`."]
180 #[doc = ""]
181 #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuExternalTexture`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
185 pub fn new_with_gpu_external_texture(binding: u32, resource: &GpuExternalTexture) -> Self {
186 #[allow(unused_mut)]
187 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
188 ret.set_binding(binding);
189 ret.set_resource_gpu_external_texture(resource);
190 ret
191 }
192 #[cfg(web_sys_unstable_apis)]
193 #[deprecated = "Use `set_binding()` instead."]
194 pub fn binding(&mut self, val: u32) -> &mut Self {
195 self.set_binding(val);
196 self
197 }
198 #[cfg(web_sys_unstable_apis)]
199 #[cfg(feature = "GpuSampler")]
200 #[deprecated = "Use `set_resource()` instead."]
201 pub fn resource(&mut self, val: &GpuSampler) -> &mut Self {
202 self.set_resource(val);
203 self
204 }
205}