1#[cfg(feature = "unity_engine-computebuffer-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::system::object::{IObject, Object};
9
10 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/computebuffer/ComputeBuffer.md"))]
11 #[::unity::class(namespace = "UnityEngine", name = "ComputeBuffer")]
12 #[parent(crate::system::object::Object)]
13 pub struct ComputeBuffer {
14 #[offset(16)]
15 #[rename(name = "m_Ptr")]
16 pub m_ptr: ::unity::IntPtr,
17 }
18}
19
20#[cfg(feature = "unity_engine-computebuffer-types")]
21pub use __types::*;
22
23#[cfg(feature = "unity_engine-computebuffer")]
24impl ComputeBuffer {
25 #[doc = "`InitBuffer(i32, i32, crate::unity_engine::computebuffertype::ComputeBufferType, crate::unity_engine::computebuffermode::ComputeBufferMode)` overload"]
26 pub fn init_buffer(
27 count: impl ::core::convert::Into<i32>,
28 stride: impl ::core::convert::Into<i32>,
29 r#type: impl ::core::convert::Into<crate::unity_engine::computebuffertype::ComputeBufferType>,
30 usage: impl ::core::convert::Into<crate::unity_engine::computebuffermode::ComputeBufferMode>,
31 ) -> ::unity::IntPtr {
32 unsafe {
33 ::unity::il2cpp_call!((::unity::module_base()+0x2c46d80usize)as*mut u8, ::unity::IntPtr;
34(i32)::core::convert::Into::into(count),(i32)::core::convert::Into::into(stride),(crate::unity_engine::computebuffertype::ComputeBufferType)::core::convert::Into::into(r#type),(crate::unity_engine::computebuffermode::ComputeBufferMode)::core::convert::Into::into(usage))
35 }
36 }
37
38 #[doc = "`DestroyBuffer(crate::unity_engine::computebuffer::ComputeBuffer)` overload"]
39 pub fn destroy_buffer(buf: impl ::core::convert::Into<crate::unity_engine::computebuffer::ComputeBuffer>) -> () {
40 unsafe {
41 ::unity::il2cpp_call!((::unity::module_base()+0x2c46d30usize)as*mut u8,();
42(crate::unity_engine::computebuffer::ComputeBuffer)::core::convert::Into::into(buf))
43 }
44 }
45}
46
47#[cfg(feature = "unity_engine-computebuffer")]
48pub trait IComputeBufferMethods: IComputeBuffer {
49 #[doc = "`Finalize()` overload"]
50 fn finalize(self) -> () {
51 unsafe {
52 let __receiver = <ComputeBuffer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
53 {
54 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
55 let __vi = *__vt.get(1usize).unwrap_or_else(|| {
56 panic!(
57 "unity: virtual slot {}
58 out of range (vtable len {}
59) on the runtime class behind {}
60 (method `{}
61`)",
62 1usize,
63 __vt.len(),
64 <ComputeBuffer as ::unity::ClassIdentity>::NAME,
65 "Finalize",
66 )
67 });
68 let __inner: extern "C" fn(ComputeBuffer, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
69 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
70 __inner(__receiver, __mi)
71 }
72 }
73 }
74 #[doc = "`Dispose()` overload"]
75 fn dispose(self) -> () {
76 unsafe {
77 let __receiver = <ComputeBuffer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
78 {
79 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
80 let __vi = *__vt.get(4usize).unwrap_or_else(|| {
81 panic!(
82 "unity: virtual slot {}
83 out of range (vtable len {}
84) on the runtime class behind {}
85 (method `{}
86`)",
87 4usize,
88 __vt.len(),
89 <ComputeBuffer as ::unity::ClassIdentity>::NAME,
90 "Dispose",
91 )
92 });
93 let __inner: extern "C" fn(ComputeBuffer, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
94 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
95 __inner(__receiver, __mi)
96 }
97 }
98 }
99 #[doc = "`Dispose(bool)` overload"]
100 fn dispose_2(self, disposing: impl ::core::convert::Into<bool>) -> () {
101 unsafe {
102 let __receiver = <ComputeBuffer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
103 ::unity::il2cpp_call!((::unity::module_base()+0x2c46b80usize)as*mut u8,();
104(ComputeBuffer)__receiver,(bool)::core::convert::Into::into(disposing))
105 }
106 }
107 #[doc = "`.ctor(i32, i32)` overload"]
108 fn ctor(self, count: impl ::core::convert::Into<i32>, stride: impl ::core::convert::Into<i32>) -> () {
109 unsafe {
110 let __receiver = <ComputeBuffer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
111 ::unity::il2cpp_call!((::unity::module_base()+0x2c46df0usize)as*mut u8,();
112(ComputeBuffer)__receiver,(i32)::core::convert::Into::into(count),(i32)::core::convert::Into::into(stride))
113 }
114 }
115 #[doc = "`.ctor(i32, i32, crate::unity_engine::computebuffertype::ComputeBufferType)` overload"]
116 fn ctor_2(
117 self,
118 count: impl ::core::convert::Into<i32>,
119 stride: impl ::core::convert::Into<i32>,
120 r#type: impl ::core::convert::Into<crate::unity_engine::computebuffertype::ComputeBufferType>,
121 ) -> () {
122 unsafe {
123 let __receiver = <ComputeBuffer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
124 ::unity::il2cpp_call!((::unity::module_base()+0x2c46f20usize)as*mut u8,();
125(ComputeBuffer)__receiver,(i32)::core::convert::Into::into(count),(i32)::core::convert::Into::into(stride),(crate::unity_engine::computebuffertype::ComputeBufferType)::core::convert::Into::into(r#type))
126 }
127 }
128 #[doc = "`.ctor(i32, i32, crate::unity_engine::computebuffertype::ComputeBufferType, crate::unity_engine::computebuffermode::ComputeBufferMode)` overload"]
129 fn ctor_3(
130 self,
131 count: impl ::core::convert::Into<i32>,
132 stride: impl ::core::convert::Into<i32>,
133 r#type: impl ::core::convert::Into<crate::unity_engine::computebuffertype::ComputeBufferType>,
134 usage: impl ::core::convert::Into<crate::unity_engine::computebuffermode::ComputeBufferMode>,
135 ) -> () {
136 unsafe {
137 let __receiver = <ComputeBuffer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
138 ::unity::il2cpp_call!((::unity::module_base()+0x2c46f30usize)as*mut u8,();
139(ComputeBuffer)__receiver,(i32)::core::convert::Into::into(count),(i32)::core::convert::Into::into(stride),(crate::unity_engine::computebuffertype::ComputeBufferType)::core::convert::Into::into(r#type),(crate::unity_engine::computebuffermode::ComputeBufferMode)::core::convert::Into::into(usage))
140 }
141 }
142 #[doc = "`.ctor(i32, i32, crate::unity_engine::computebuffertype::ComputeBufferType, crate::unity_engine::computebuffermode::ComputeBufferMode, i32)` overload"]
143 fn ctor_4(
144 self,
145 count: impl ::core::convert::Into<i32>,
146 stride: impl ::core::convert::Into<i32>,
147 r#type: impl ::core::convert::Into<crate::unity_engine::computebuffertype::ComputeBufferType>,
148 usage: impl ::core::convert::Into<crate::unity_engine::computebuffermode::ComputeBufferMode>,
149 stack_depth: impl ::core::convert::Into<i32>,
150 ) -> () {
151 unsafe {
152 let __receiver = <ComputeBuffer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
153 ::unity::il2cpp_call!((::unity::module_base()+0x2c46e00usize)as*mut u8,();
154(ComputeBuffer)__receiver,(i32)::core::convert::Into::into(count),(i32)::core::convert::Into::into(stride),(crate::unity_engine::computebuffertype::ComputeBufferType)::core::convert::Into::into(r#type),(crate::unity_engine::computebuffermode::ComputeBufferMode)::core::convert::Into::into(usage),(i32)::core::convert::Into::into(stack_depth))
155 }
156 }
157 #[doc = "`Release()` overload"]
158 fn release(self) -> () {
159 unsafe {
160 let __receiver = <ComputeBuffer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
161 ::unity::il2cpp_call!((::unity::module_base()+0x2c46f40usize)as*mut u8,();
162(ComputeBuffer)__receiver)
163 }
164 }
165 #[doc = "`get_count()` overload"]
166 fn get_count(self) -> i32 {
167 unsafe {
168 let __receiver = <ComputeBuffer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
169 ::unity::il2cpp_call!((::unity::module_base()+0x2c46f50usize)as*mut u8,i32;
170(ComputeBuffer)__receiver)
171 }
172 }
173 #[doc = "`get_stride()` overload"]
174 fn get_stride(self) -> i32 {
175 unsafe {
176 let __receiver = <ComputeBuffer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
177 ::unity::il2cpp_call!((::unity::module_base()+0x2c46fa0usize)as*mut u8,i32;
178(ComputeBuffer)__receiver)
179 }
180 }
181 fn set_data<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
182 self,
183 data: impl ::core::convert::Into<crate::system::collections::generic::list_1::List_1<M0>>,
184 managed_buffer_start_index: impl ::core::convert::Into<i32>,
185 compute_buffer_start_index: impl ::core::convert::Into<i32>,
186 count: impl ::core::convert::Into<i32>,
187 ) -> () {
188 static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> =
189 ::std::sync::LazyLock::new(|| ::unity::lookup::method_info_on_class(<ComputeBuffer as ::unity::ClassIdentity>::class(), "SetData", 4));
190 #[allow(clippy::type_complexity)]
191 static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
192 ::std::sync::OnceLock::new();
193 let _ = false;
194 let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
195 ::core::result::Result::Ok(mi) => *mi,
196 ::core::result::Result::Err(e) => {
197 panic!(
198 "method lookup failed: {}
199::{}
200: {}
201",
202 <ComputeBuffer as ::unity::ClassIdentity>::NAME,
203 "SetData",
204 e
205 )
206 },
207 };
208 let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
209 let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
210 let __inflated: &'static ::unity::il2cpp::MethodInfo = {
211 let mut __guard = __cache.lock().unwrap();
212 *__guard
213 .entry(__key)
214 .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
215 };
216 unsafe {
217 let __receiver = <ComputeBuffer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
218 let __f: extern "C" fn(
219 ComputeBuffer,
220 crate::system::collections::generic::list_1::List_1<M0>,
221 i32,
222 i32,
223 i32,
224 ::unity::OptionalMethod,
225 ) -> () = ::core::mem::transmute(__inflated.method_ptr);
226 let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
227 __f(
228 __receiver,
229 ::core::convert::Into::into(data),
230 ::core::convert::Into::into(managed_buffer_start_index),
231 ::core::convert::Into::into(compute_buffer_start_index),
232 ::core::convert::Into::into(count),
233 ::core::option::Option::Some(__mi_opaque),
234 )
235 }
236 }
237 #[doc = "`InternalSetNativeData(::unity::IntPtr, i32, i32, i32, i32)` overload"]
238 fn internal_set_native_data(
239 self,
240 data: impl ::core::convert::Into<::unity::IntPtr>,
241 native_buffer_start_index: impl ::core::convert::Into<i32>,
242 compute_buffer_start_index: impl ::core::convert::Into<i32>,
243 count: impl ::core::convert::Into<i32>,
244 elem_size: impl ::core::convert::Into<i32>,
245 ) -> () {
246 unsafe {
247 let __receiver = <ComputeBuffer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
248 ::unity::il2cpp_call!((::unity::module_base()+0x2c46ff0usize)as*mut u8,();
249(ComputeBuffer)__receiver,(::unity::IntPtr)::core::convert::Into::into(data),(i32)::core::convert::Into::into(native_buffer_start_index),(i32)::core::convert::Into::into(compute_buffer_start_index),(i32)::core::convert::Into::into(count),(i32)::core::convert::Into::into(elem_size))
250 }
251 }
252 #[doc = "`InternalSetData(::unity::IlInstance, i32, i32, i32, i32)` overload"]
253 fn internal_set_data(
254 self,
255 data: impl ::core::convert::Into<::unity::IlInstance>,
256 managed_buffer_start_index: impl ::core::convert::Into<i32>,
257 compute_buffer_start_index: impl ::core::convert::Into<i32>,
258 count: impl ::core::convert::Into<i32>,
259 elem_size: impl ::core::convert::Into<i32>,
260 ) -> () {
261 unsafe {
262 let __receiver = <ComputeBuffer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
263 ::unity::il2cpp_call!((::unity::module_base()+0x2c47070usize)as*mut u8,();
264(ComputeBuffer)__receiver,(::unity::IlInstance)::core::convert::Into::into(data),(i32)::core::convert::Into::into(managed_buffer_start_index),(i32)::core::convert::Into::into(compute_buffer_start_index),(i32)::core::convert::Into::into(count),(i32)::core::convert::Into::into(elem_size))
265 }
266 }
267 #[doc = "`set_name(::unity::Il2CppString)` overload"]
268 fn set_name(self, value: impl ::core::convert::Into<::unity::Il2CppString>) -> () {
269 unsafe {
270 let __receiver = <ComputeBuffer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
271 ::unity::il2cpp_call!((::unity::module_base()+0x2c470f0usize)as*mut u8,();
272(ComputeBuffer)__receiver,(::unity::Il2CppString)::core::convert::Into::into(value))
273 }
274 }
275}
276
277#[cfg(feature = "unity_engine-computebuffer")]
278impl<__T: IComputeBuffer> IComputeBufferMethods for __T {}
279
280#[cfg(feature = "unity_engine-computebuffer")]
281impl ComputeBuffer {
282 pub fn finalize_method_info() -> &'static ::unity::il2cpp::MethodInfo {
283 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
284 }
285
286 pub fn dispose_method_info() -> &'static ::unity::il2cpp::MethodInfo {
287 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
288 }
289
290 pub fn dispose_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
291 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
292 }
293
294 pub fn init_buffer_method_info() -> &'static ::unity::il2cpp::MethodInfo {
295 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
296 }
297
298 pub fn destroy_buffer_method_info() -> &'static ::unity::il2cpp::MethodInfo {
299 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
300 }
301
302 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
303 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
304 }
305
306 pub fn ctor_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
307 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
308 }
309
310 pub fn ctor_3_method_info() -> &'static ::unity::il2cpp::MethodInfo {
311 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
312 }
313
314 pub fn ctor_4_method_info() -> &'static ::unity::il2cpp::MethodInfo {
315 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
316 }
317
318 pub fn release_method_info() -> &'static ::unity::il2cpp::MethodInfo {
319 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
320 }
321
322 pub fn get_count_method_info() -> &'static ::unity::il2cpp::MethodInfo {
323 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[10]
324 }
325
326 pub fn get_stride_method_info() -> &'static ::unity::il2cpp::MethodInfo {
327 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[11]
328 }
329
330 pub fn internal_set_native_data_method_info() -> &'static ::unity::il2cpp::MethodInfo {
331 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[15]
332 }
333
334 pub fn internal_set_data_method_info() -> &'static ::unity::il2cpp::MethodInfo {
335 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[16]
336 }
337
338 pub fn set_name_method_info() -> &'static ::unity::il2cpp::MethodInfo {
339 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[17]
340 }
341}
342
343#[cfg(feature = "unity_engine-computebuffer")]
344impl ComputeBuffer {
345 #[doc = "Direct (non-virtual) call to `ComputeBuffer`'s own `Finalize`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
346 pub unsafe fn finalize(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
347 let __mi = Self::finalize_method_info();
348 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
349 __inner(this.into(), ::core::option::Option::None)
350 }
351
352 #[doc = "Direct (non-virtual) call to `ComputeBuffer`'s own `Dispose`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
353 pub unsafe fn dispose(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
354 let __mi = Self::dispose_method_info();
355 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
356 __inner(this.into(), ::core::option::Option::None)
357 }
358}
359
360#[cfg(feature = "unity_engine-computebuffer")]
361impl ComputeBuffer {
362 #[doc = "`.ctor(i32, i32)` — overload selector"]
363 pub fn new(count: i32, stride: i32) -> Self {
364 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
365 panic!(
366 "{}
367::{}
368 failed to instantiate",
369 ::core::stringify!(ComputeBuffer),
370 ::core::stringify!(new),
371 )
372 });
373 <Self as IComputeBufferMethods>::ctor(this, count, stride);
374 this
375 }
376
377 #[doc = "`.ctor(i32, i32, crate::unity_engine::computebuffertype::ComputeBufferType)` — overload selector"]
378 pub fn new_2(count: i32, stride: i32, r#type: crate::unity_engine::computebuffertype::ComputeBufferType) -> Self {
379 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
380 panic!(
381 "{}
382::{}
383 failed to instantiate",
384 ::core::stringify!(ComputeBuffer),
385 ::core::stringify!(new_2),
386 )
387 });
388 <Self as IComputeBufferMethods>::ctor_2(this, count, stride, r#type);
389 this
390 }
391
392 #[doc = "`.ctor(i32, i32, crate::unity_engine::computebuffertype::ComputeBufferType, crate::unity_engine::computebuffermode::ComputeBufferMode)` — overload selector"]
393 pub fn new_3(
394 count: i32,
395 stride: i32,
396 r#type: crate::unity_engine::computebuffertype::ComputeBufferType,
397 usage: crate::unity_engine::computebuffermode::ComputeBufferMode,
398 ) -> Self {
399 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
400 panic!(
401 "{}
402::{}
403 failed to instantiate",
404 ::core::stringify!(ComputeBuffer),
405 ::core::stringify!(new_3),
406 )
407 });
408 <Self as IComputeBufferMethods>::ctor_3(this, count, stride, r#type, usage);
409 this
410 }
411
412 #[doc = "`.ctor(i32, i32, crate::unity_engine::computebuffertype::ComputeBufferType, crate::unity_engine::computebuffermode::ComputeBufferMode, i32)` — overload selector"]
413 pub fn new_4(
414 count: i32,
415 stride: i32,
416 r#type: crate::unity_engine::computebuffertype::ComputeBufferType,
417 usage: crate::unity_engine::computebuffermode::ComputeBufferMode,
418 stack_depth: i32,
419 ) -> Self {
420 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
421 panic!(
422 "{}
423::{}
424 failed to instantiate",
425 ::core::stringify!(ComputeBuffer),
426 ::core::stringify!(new_4),
427 )
428 });
429 <Self as IComputeBufferMethods>::ctor_4(this, count, stride, r#type, usage, stack_depth);
430 this
431 }
432}
433
434#[cfg(feature = "unity_engine-computebuffer")]
435#[doc(hidden)]
436pub mod prelude {
437 pub use super::{ComputeBuffer, IComputeBuffer, IComputeBufferMethods};
438 pub use crate::system::object::IObject;
439 #[cfg(feature = "system-object")]
440 pub use crate::system::object::IObjectMethods;
441}