1#[repr(C)]
2#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
3pub struct __BindgenBitfieldUnit<Storage> {
4 storage: Storage,
5}
6impl<Storage> __BindgenBitfieldUnit<Storage> {
7 #[inline]
8 pub const fn new(storage: Storage) -> Self {
9 Self { storage }
10 }
11}
12impl<Storage> __BindgenBitfieldUnit<Storage>
13where
14 Storage: AsRef<[u8]> + AsMut<[u8]>,
15{
16 #[inline]
17 pub fn get_bit(&self, index: usize) -> bool {
18 debug_assert!(index / 8 < self.storage.as_ref().len());
19 let byte_index = index / 8;
20 let byte = self.storage.as_ref()[byte_index];
21 let bit_index = if cfg!(target_endian = "big") {
22 7 - (index % 8)
23 } else {
24 index % 8
25 };
26 let mask = 1 << bit_index;
27 byte & mask == mask
28 }
29 #[inline]
30 pub fn set_bit(&mut self, index: usize, val: bool) {
31 debug_assert!(index / 8 < self.storage.as_ref().len());
32 let byte_index = index / 8;
33 let byte = &mut self.storage.as_mut()[byte_index];
34 let bit_index = if cfg!(target_endian = "big") {
35 7 - (index % 8)
36 } else {
37 index % 8
38 };
39 let mask = 1 << bit_index;
40 if val {
41 *byte |= mask;
42 } else {
43 *byte &= !mask;
44 }
45 }
46 #[inline]
47 pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
48 debug_assert!(bit_width <= 64);
49 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
50 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
51 let mut val = 0;
52 for i in 0..(bit_width as usize) {
53 if self.get_bit(i + bit_offset) {
54 let index = if cfg!(target_endian = "big") {
55 bit_width as usize - 1 - i
56 } else {
57 i
58 };
59 val |= 1 << index;
60 }
61 }
62 val
63 }
64 #[inline]
65 pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
66 debug_assert!(bit_width <= 64);
67 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
68 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
69 for i in 0..(bit_width as usize) {
70 let mask = 1 << i;
71 let val_bit_is_set = val & mask == mask;
72 let index = if cfg!(target_endian = "big") {
73 bit_width as usize - 1 - i
74 } else {
75 i
76 };
77 self.set_bit(index + bit_offset, val_bit_is_set);
78 }
79 }
80}
81#[repr(C)]
82pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
83impl<T> __BindgenUnionField<T> {
84 #[inline]
85 pub const fn new() -> Self {
86 __BindgenUnionField(::std::marker::PhantomData)
87 }
88 #[inline]
89 pub unsafe fn as_ref(&self) -> &T {
90 ::std::mem::transmute(self)
91 }
92 #[inline]
93 pub unsafe fn as_mut(&mut self) -> &mut T {
94 ::std::mem::transmute(self)
95 }
96}
97impl<T> ::std::default::Default for __BindgenUnionField<T> {
98 #[inline]
99 fn default() -> Self {
100 Self::new()
101 }
102}
103impl<T> ::std::clone::Clone for __BindgenUnionField<T> {
104 #[inline]
105 fn clone(&self) -> Self {
106 Self::new()
107 }
108}
109impl<T> ::std::marker::Copy for __BindgenUnionField<T> {}
110impl<T> ::std::fmt::Debug for __BindgenUnionField<T> {
111 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
112 fmt.write_str("__BindgenUnionField")
113 }
114}
115impl<T> ::std::hash::Hash for __BindgenUnionField<T> {
116 fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) {}
117}
118impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
119 fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
120 true
121 }
122}
123impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {}
124pub const __SAL_H_VERSION: u32 = 180000000;
125pub const __bool_true_false_are_defined: u32 = 1;
126extern "C" {
127 pub fn __va_start(arg1: *mut *mut ::std::os::raw::c_char, ...);
128}
129pub type __vcrt_bool = bool;
130extern "C" {
131 pub fn __security_init_cookie();
132}
133extern "C" {
134 pub fn __security_check_cookie(_StackCookie: usize);
135}
136extern "C" {
137 pub fn __report_gsfailure(_StackCookie: usize);
138}
139extern "C" {
140 pub static mut __security_cookie: usize;
141}
142#[repr(C)]
143#[derive(Copy, Clone)]
144pub union TtIdTBindgenTy1 {
145 pub u64_: u64,
146 pub __bindgen_anon_1: TtIdTBindgenTy1BindgenTy1,
147}
148#[repr(C)]
149#[repr(align(8))]
150#[derive(Default, Copy, Clone)]
151pub struct TtIdTBindgenTy1BindgenTy1 {
152 pub _bitfield_align_1: [u32; 0],
153 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
154}
155impl TtIdTBindgenTy1BindgenTy1 {
156 #[inline]
157 pub fn type_(&self) -> u64 {
158 unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 10u8) as u64) }
159 }
160 #[inline]
161 pub fn set_type(&mut self, val: u64) {
162 unsafe {
163 let val: u64 = ::std::mem::transmute(val);
164 self._bitfield_1.set(0usize, 10u8, val as u64)
165 }
166 }
167 #[inline]
168 pub fn generation(&self) -> u64 {
169 unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 22u8) as u64) }
170 }
171 #[inline]
172 pub fn set_generation(&mut self, val: u64) {
173 unsafe {
174 let val: u64 = ::std::mem::transmute(val);
175 self._bitfield_1.set(10usize, 22u8, val as u64)
176 }
177 }
178 #[inline]
179 pub fn index(&self) -> u64 {
180 unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 32u8) as u64) }
181 }
182 #[inline]
183 pub fn set_index(&mut self, val: u64) {
184 unsafe {
185 let val: u64 = ::std::mem::transmute(val);
186 self._bitfield_1.set(32usize, 32u8, val as u64)
187 }
188 }
189 #[inline]
190 pub fn new_bitfield_1(
191 type_: u64,
192 generation: u64,
193 index: u64,
194 ) -> __BindgenBitfieldUnit<[u8; 8usize]> {
195 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default();
196 __bindgen_bitfield_unit.set(0usize, 10u8, {
197 let type_: u64 = unsafe { ::std::mem::transmute(type_) };
198 type_ as u64
199 });
200 __bindgen_bitfield_unit.set(10usize, 22u8, {
201 let generation: u64 = unsafe { ::std::mem::transmute(generation) };
202 generation as u64
203 });
204 __bindgen_bitfield_unit.set(32usize, 32u8, {
205 let index: u64 = unsafe { ::std::mem::transmute(index) };
206 index as u64
207 });
208 __bindgen_bitfield_unit
209 }
210}
211impl Default for TtIdTBindgenTy1 {
212 fn default() -> Self {
213 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
214 unsafe {
215 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
216 s.assume_init()
217 }
218 }
219}
220#[repr(C)]
221#[derive(Copy, Clone)]
222pub struct RenderGraphO {
223 _unused: [u8; 0],
224}
225#[repr(C)]
226#[derive(Copy, Clone)]
227pub struct RenderGraphSetupO {
228 _unused: [u8; 0],
229}
230#[repr(C)]
231#[derive(Copy, Clone)]
232pub struct RenderGraphModuleO {
233 _unused: [u8; 0],
234}
235#[repr(C)]
236#[derive(Copy, Clone)]
237pub struct RenderGraphExecuteO {
238 _unused: [u8; 0],
239}
240pub const TM_RENDER_GRAPH_SORT_SUB_MODULE_BITS_START: RenderGraphSortKey = 0;
241pub const TM_RENDER_GRAPH_SORT_SUB_MODULE_BITS: RenderGraphSortKey = 8;
242pub const TM_RENDER_GRAPH_SORT_DEPTH_BITS_START: RenderGraphSortKey = 8;
243pub const TM_RENDER_GRAPH_SORT_DEPTH_BITS: RenderGraphSortKey = 16;
244pub const TM_RENDER_GRAPH_SORT_INTERNAL_PASS_BITS_START: RenderGraphSortKey = 24;
245pub const TM_RENDER_GRAPH_SORT_INTERNAL_PASS_BITS: RenderGraphSortKey = 27;
246pub const TM_RENDER_GRAPH_SORT_PASS_BITS_START: RenderGraphSortKey = 51;
247pub const TM_RENDER_GRAPH_SORT_PASS_BITS: RenderGraphSortKey = 11;
248pub const TM_RENDER_GRAPH_SORT_GRAPH_LOOP_BITS_START: RenderGraphSortKey = 62;
249pub const TM_RENDER_GRAPH_SORT_GRAPH_LOOP_BITS: RenderGraphSortKey = 2;
250pub type RenderGraphSortKey = ::std::os::raw::c_int;
251pub const TM_RENDER_GRAPH_SORT_ORDER_FRONT_BACK: RenderGraphSortOrder = 0;
252pub const TM_RENDER_GRAPH_SORT_ORDER_BACK_FRONT: RenderGraphSortOrder = 1;
253pub type RenderGraphSortOrder = ::std::os::raw::c_int;
254pub const TM_RENDER_GRAPH_WRITE_BIND_FLAG_UAV: RenderGraphWriteBindFlag = 1;
255pub const TM_RENDER_GRAPH_WRITE_BIND_FLAG_COLOR_TARGET: RenderGraphWriteBindFlag = 2;
256pub const TM_RENDER_GRAPH_WRITE_BIND_FLAG_DEPTH_STENCIL_TARGET: RenderGraphWriteBindFlag = 4;
257pub type RenderGraphWriteBindFlag = ::std::os::raw::c_int;
258#[repr(C)]
259#[derive(Default, Copy, Clone)]
260pub struct RenderGraphHandleT {
261 pub value: u32,
262}
263#[repr(C)]
264pub struct RenderGraphBlackboardValue {
265 pub __bindgen_anon_1: __BindgenUnionField<RenderGraphBlackboardValueBindgenTy1>,
266 pub data: __BindgenUnionField<*mut ::std::os::raw::c_void>,
267 pub float32: __BindgenUnionField<f32>,
268 pub uint64: __BindgenUnionField<u64>,
269 pub uint32: __BindgenUnionField<u32>,
270 pub int64: __BindgenUnionField<i64>,
271 pub int32: __BindgenUnionField<i32>,
272 pub boolean: __BindgenUnionField<bool>,
273 pub bindgen_union_field: [u64; 2usize],
274}
275#[repr(C)]
276pub struct RenderGraphBlackboardValueBindgenTy1 {
277 pub handle: RendererHandleT,
278 pub _padding_89: [::std::os::raw::c_char; 4usize],
279}
280impl Default for RenderGraphBlackboardValueBindgenTy1 {
281 fn default() -> Self {
282 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
283 unsafe {
284 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
285 s.assume_init()
286 }
287 }
288}
289impl Default for RenderGraphBlackboardValue {
290 fn default() -> Self {
291 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
292 unsafe {
293 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
294 s.assume_init()
295 }
296 }
297}
298#[repr(C)]
299#[derive(Copy, Clone)]
300pub struct RenderGraphViewerT {
301 pub sort_key: u64,
302 pub visibility_mask: u64,
303 pub viewer_system: *mut ShaderSystemO,
304 pub viewer_cbuffer: *mut ShaderConstantBufferInstanceT,
305 pub viewer_rbinder: *mut ShaderResourceBinderInstanceT,
306 pub camera: *const CameraT,
307}
308impl Default for RenderGraphViewerT {
309 fn default() -> Self {
310 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
311 unsafe {
312 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
313 s.assume_init()
314 }
315 }
316}
317#[repr(C)]
318#[derive(Default, Copy, Clone)]
319pub struct RenderGraphApi {
320 pub create: ::std::option::Option<
321 unsafe extern "C" fn(
322 sort_key: u64,
323 static_sort_key: bool,
324 allocator: *mut AllocatorI,
325 shader_repository: *mut ShaderRepositoryO,
326 ) -> *mut RenderGraphO,
327 >,
328 pub destroy: ::std::option::Option<
329 unsafe extern "C" fn(
330 graph: *mut RenderGraphO,
331 res_buf: *mut RendererResourceCommandBufferO,
332 ),
333 >,
334 pub sort_key: ::std::option::Option<
335 unsafe extern "C" fn(graph: *const RenderGraphO, material_layer_name: StrhashT) -> u64,
336 >,
337 pub register_gpu_image: ::std::option::Option<
338 unsafe extern "C" fn(
339 graph: *mut RenderGraphO,
340 name: StrhashT,
341 resource: RendererHandleT,
342 resource_state: u32,
343 image_desc: *const RendererImageDescT,
344 ),
345 >,
346 pub register_gpu_buffer: ::std::option::Option<
347 unsafe extern "C" fn(
348 graph: *mut RenderGraphO,
349 name: StrhashT,
350 resource: RendererHandleT,
351 resource_state: u32,
352 buffer_desc: *const RendererBufferDescT,
353 ),
354 >,
355 pub write_blackboard: ::std::option::Option<
356 unsafe extern "C" fn(
357 graph: *mut RenderGraphO,
358 key: StrhashT,
359 value: RenderGraphBlackboardValue,
360 ),
361 >,
362 pub read_blackboard: ::std::option::Option<
363 unsafe extern "C" fn(
364 graph: *const RenderGraphO,
365 key: StrhashT,
366 value: *mut RenderGraphBlackboardValue,
367 ) -> bool,
368 >,
369 pub setup_passes: ::std::option::Option<
370 unsafe extern "C" fn(graph: *mut RenderGraphO, render_module: *mut RenderGraphModuleO),
371 >,
372 pub validate_and_build: ::std::option::Option<
373 unsafe extern "C" fn(
374 graph: *mut RenderGraphO,
375 backend: *mut RendererBackendI,
376 device_affinity_mask: u32,
377 ) -> bool,
378 >,
379 pub visualize: ::std::option::Option<
380 unsafe extern "C" fn(
381 graph: *const RenderGraphO,
382 ta: *mut TempAllocatorI,
383 ) -> *mut ::std::os::raw::c_char,
384 >,
385 pub execute: ::std::option::Option<
386 unsafe extern "C" fn(
387 graph: *mut RenderGraphO,
388 backend: *mut RendererBackendI,
389 shader_context: *const ShaderSystemContextO,
390 device_affinity_mask: u32,
391 ) -> *mut AtomicCounterO,
392 >,
393 pub resource_buffers: ::std::option::Option<
394 unsafe extern "C" fn(
395 graph: *const RenderGraphO,
396 resource_buffers: *mut *mut RendererResourceCommandBufferO,
397 num_resource_buffers: *mut u32,
398 ),
399 >,
400 pub command_buffers: ::std::option::Option<
401 unsafe extern "C" fn(
402 graph: *const RenderGraphO,
403 command_buffers: *mut *mut RendererCommandBufferO,
404 num_command_buffers: *mut u32,
405 ),
406 >,
407 pub viewers: ::std::option::Option<
408 unsafe extern "C" fn(
409 graph: *mut RenderGraphO,
410 viewers: *mut RenderGraphViewerT,
411 num_viewers: *mut u32,
412 ),
413 >,
414 pub backend_handle: ::std::option::Option<
415 unsafe extern "C" fn(
416 graph: *const RenderGraphO,
417 graph_handle: RenderGraphHandleT,
418 ) -> RendererHandleT,
419 >,
420 pub data_requested: ::std::option::Option<
421 unsafe extern "C" fn(graph: *const RenderGraphO, name: StrhashT) -> bool,
422 >,
423 pub external_resource: ::std::option::Option<
424 unsafe extern "C" fn(graph: *mut RenderGraphO, name: StrhashT) -> RenderGraphHandleT,
425 >,
426 pub image_desc: ::std::option::Option<
427 unsafe extern "C" fn(
428 graph: *mut RenderGraphO,
429 handle: RenderGraphHandleT,
430 ) -> *const RendererImageDescT,
431 >,
432 pub buffer_desc: ::std::option::Option<
433 unsafe extern "C" fn(
434 graph: *mut RenderGraphO,
435 handle: RenderGraphHandleT,
436 ) -> *const RendererBufferDescT,
437 >,
438}
439#[repr(C)]
440#[derive(Copy, Clone)]
441pub struct RenderGraphModuleEditorSubmenuI {
442 pub submenu_name: *const ::std::os::raw::c_char,
443 pub inst: *mut ::std::os::raw::c_void,
444 pub active:
445 ::std::option::Option<unsafe extern "C" fn(inst: *mut ::std::os::raw::c_void) -> bool>,
446 pub submenu: ::std::option::Option<
447 unsafe extern "C" fn(
448 inst: *mut ::std::os::raw::c_void,
449 ui: *mut UiO,
450 uistyle: *const UiStyleT,
451 submenu_pos: Vec2T,
452 ),
453 >,
454 pub draw_as_toolbar: ::std::option::Option<unsafe extern "C" fn() -> bool>,
455}
456impl Default for RenderGraphModuleEditorSubmenuI {
457 fn default() -> Self {
458 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
459 unsafe {
460 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
461 s.assume_init()
462 }
463 }
464}
465#[repr(C)]
466#[derive(Default, Copy, Clone)]
467pub struct RenderGraphModuleApi {
468 pub create: ::std::option::Option<
469 unsafe extern "C" fn(
470 allocator: *mut AllocatorI,
471 name: *const ::std::os::raw::c_char,
472 ) -> *mut RenderGraphModuleO,
473 >,
474 pub destroy: ::std::option::Option<
475 unsafe extern "C" fn(
476 render_module: *mut RenderGraphModuleO,
477 res_buf: *mut RendererResourceCommandBufferO,
478 ),
479 >,
480 pub name: ::std::option::Option<
481 unsafe extern "C" fn(render_module: *const RenderGraphModuleO) -> StrhashT,
482 >,
483 pub human_readable_name: ::std::option::Option<
484 unsafe extern "C" fn(
485 render_module: *const RenderGraphModuleO,
486 ) -> *const ::std::os::raw::c_char,
487 >,
488 pub add_pass: ::std::option::Option<
489 unsafe extern "C" fn(render_module: *mut RenderGraphModuleO, pass: *const RenderGraphPassI),
490 >,
491 pub add_extension_point: ::std::option::Option<
492 unsafe extern "C" fn(
493 render_module: *mut RenderGraphModuleO,
494 extension_point_name: StrhashT,
495 ),
496 >,
497 pub insert_extension: ::std::option::Option<
498 unsafe extern "C" fn(
499 render_module: *mut RenderGraphModuleO,
500 extension_point_name: StrhashT,
501 extension: *mut RenderGraphModuleO,
502 ordering_weight: f32,
503 ) -> bool,
504 >,
505 pub remove_extension: ::std::option::Option<
506 unsafe extern "C" fn(
507 render_module: *mut RenderGraphModuleO,
508 res_buf: *mut RendererResourceCommandBufferO,
509 extension_point_name: StrhashT,
510 extension: *mut RenderGraphModuleO,
511 ) -> bool,
512 >,
513 pub extensions: ::std::option::Option<
514 unsafe extern "C" fn(
515 render_module: *const RenderGraphModuleO,
516 extension_point_name: StrhashT,
517 num_modules: *mut u32,
518 ) -> *const *const RenderGraphModuleO,
519 >,
520 pub add_sub_module: ::std::option::Option<
521 unsafe extern "C" fn(
522 render_module: *mut RenderGraphModuleO,
523 shader_layer_name: StrhashT,
524 sub_module: *mut RenderGraphModuleO,
525 ),
526 >,
527 pub init_passes: ::std::option::Option<
528 unsafe extern "C" fn(
529 render_module: *mut RenderGraphModuleO,
530 res_buf: *mut RendererResourceCommandBufferO,
531 ),
532 >,
533 pub set_editor_submenu_interface: ::std::option::Option<
534 unsafe extern "C" fn(
535 render_module: *mut RenderGraphModuleO,
536 submenu_i: *const RenderGraphModuleEditorSubmenuI,
537 ),
538 >,
539 pub editor_submenu: ::std::option::Option<
540 unsafe extern "C" fn(
541 render_module: *mut RenderGraphModuleO,
542 ui: *mut UiO,
543 uistyle: *const UiStyleT,
544 submenu_pos: Vec2T,
545 ),
546 >,
547 pub set_editor_toolbar: ::std::option::Option<
548 unsafe extern "C" fn(render_module: *mut RenderGraphModuleO, toolbar: *mut ToolbarI),
549 >,
550 pub editor_toolbars: ::std::option::Option<
551 unsafe extern "C" fn(
552 render_module: *mut RenderGraphModuleO,
553 ta: *mut TempAllocatorI,
554 ) -> *mut ToolbarI,
555 >,
556 pub create_persistent_gpu_image: ::std::option::Option<
557 unsafe extern "C" fn(
558 render_module: *mut RenderGraphModuleO,
559 name: StrhashT,
560 image_desc: *const RendererImageDescT,
561 inherits: StrhashT,
562 scale: *const f32,
563 ),
564 >,
565 pub create_persistent_gpu_buffer: ::std::option::Option<
566 unsafe extern "C" fn(
567 render_module: *mut RenderGraphModuleO,
568 name: StrhashT,
569 buffer_desc: *const RendererBufferDescT,
570 inherits: StrhashT,
571 ),
572 >,
573}
574#[repr(C)]
575#[derive(Default, Copy, Clone)]
576pub struct RenderGraphSetupApi {
577 pub external_resource: ::std::option::Option<
578 unsafe extern "C" fn(
579 graph_setup: *mut RenderGraphSetupO,
580 name: StrhashT,
581 ) -> RenderGraphHandleT,
582 >,
583 pub image_desc: ::std::option::Option<
584 unsafe extern "C" fn(
585 graph_setup: *mut RenderGraphSetupO,
586 handle: RenderGraphHandleT,
587 ) -> *const RendererImageDescT,
588 >,
589 pub buffer_desc: ::std::option::Option<
590 unsafe extern "C" fn(
591 graph_setup: *mut RenderGraphSetupO,
592 handle: RenderGraphHandleT,
593 ) -> *const RendererBufferDescT,
594 >,
595 pub shader_repository: ::std::option::Option<
596 unsafe extern "C" fn(graph_setup: *mut RenderGraphSetupO) -> *mut ShaderRepositoryO,
597 >,
598 pub create_gpu_images: ::std::option::Option<
599 unsafe extern "C" fn(
600 graph_setup: *mut RenderGraphSetupO,
601 image_descs: *const RendererImageDescT,
602 num_images: u32,
603 handles: *mut RenderGraphHandleT,
604 ),
605 >,
606 pub create_gpu_buffers: ::std::option::Option<
607 unsafe extern "C" fn(
608 graph_setup: *mut RenderGraphSetupO,
609 buffer_descs: *const RendererBufferDescT,
610 num_buffers: u32,
611 handles: *mut RenderGraphHandleT,
612 ),
613 >,
614 pub read_gpu_resource: ::std::option::Option<
615 unsafe extern "C" fn(
616 graph_setup: *mut RenderGraphSetupO,
617 handle: RenderGraphHandleT,
618 wanted_resource_state: u32,
619 subresource_view: *const RendererImageViewT,
620 ),
621 >,
622 pub write_gpu_resource: ::std::option::Option<
623 unsafe extern "C" fn(
624 graph_setup: *mut RenderGraphSetupO,
625 handle: RenderGraphHandleT,
626 write_bind_flags: RenderGraphWriteBindFlag,
627 wanted_resource_state: u32,
628 load_op: u32,
629 bind_slot: u32,
630 blackboard_key: StrhashT,
631 subresource_view: *const RendererImageViewT,
632 ),
633 >,
634 pub set_active: ::std::option::Option<
635 unsafe extern "C" fn(graph_setup: *mut RenderGraphSetupO, state: bool),
636 >,
637 pub set_early_out: ::std::option::Option<
638 unsafe extern "C" fn(graph_setup: *mut RenderGraphSetupO, state: bool),
639 >,
640 pub set_output: ::std::option::Option<
641 unsafe extern "C" fn(graph_setup: *mut RenderGraphSetupO, state: bool),
642 >,
643 pub set_request_async_compute: ::std::option::Option<
644 unsafe extern "C" fn(graph_setup: *mut RenderGraphSetupO, state: bool),
645 >,
646 pub set_request_multi_gpu: ::std::option::Option<
647 unsafe extern "C" fn(graph_setup: *mut RenderGraphSetupO, device_affinity_mask: u32),
648 >,
649 pub expose_as_material_layer: ::std::option::Option<
650 unsafe extern "C" fn(graph_setup: *mut RenderGraphSetupO, layer_name: StrhashT),
651 >,
652 pub write_blackboard: ::std::option::Option<
653 unsafe extern "C" fn(
654 graph_setup: *mut RenderGraphSetupO,
655 key: StrhashT,
656 value: RenderGraphBlackboardValue,
657 ),
658 >,
659 pub read_blackboard: ::std::option::Option<
660 unsafe extern "C" fn(
661 graph_setup: *mut RenderGraphSetupO,
662 key: StrhashT,
663 value: *mut RenderGraphBlackboardValue,
664 ) -> bool,
665 >,
666 pub request_data: ::std::option::Option<
667 unsafe extern "C" fn(graph_setup: *mut RenderGraphSetupO, name: StrhashT),
668 >,
669}
670#[repr(C)]
671pub struct RenderGraphLayerSortKeyT {
672 pub layer_name: StrhashT,
673 pub sort_key: u64,
674}
675impl Default for RenderGraphLayerSortKeyT {
676 fn default() -> Self {
677 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
678 unsafe {
679 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
680 s.assume_init()
681 }
682 }
683}
684#[repr(C)]
685#[derive(Default, Copy, Clone)]
686pub struct RenderGraphExecuteApi {
687 pub default_command_buffer: ::std::option::Option<
688 unsafe extern "C" fn(
689 graph_execute: *mut RenderGraphExecuteO,
690 ) -> *mut RendererCommandBufferO,
691 >,
692 pub default_resource_command_buffer: ::std::option::Option<
693 unsafe extern "C" fn(
694 graph_execute: *mut RenderGraphExecuteO,
695 ) -> *mut RendererResourceCommandBufferO,
696 >,
697 pub shader_context: ::std::option::Option<
698 unsafe extern "C" fn(
699 graph_execute: *mut RenderGraphExecuteO,
700 ) -> *const ShaderSystemContextO,
701 >,
702 pub device_affinity_mask:
703 ::std::option::Option<unsafe extern "C" fn(graph_execute: *mut RenderGraphExecuteO) -> u32>,
704 pub backend_handle: ::std::option::Option<
705 unsafe extern "C" fn(
706 graph_execute: *mut RenderGraphExecuteO,
707 graph_handle: RenderGraphHandleT,
708 subresource_view: *const RendererImageViewT,
709 ) -> RendererHandleT,
710 >,
711 pub run_sub_module: ::std::option::Option<
712 unsafe extern "C" fn(
713 graph_execute: *mut RenderGraphExecuteO,
714 sub_module_name: StrhashT,
715 sort_key: u64,
716 commands: *mut RendererCommandBufferO,
717 ),
718 >,
719 pub read_blackboard: ::std::option::Option<
720 unsafe extern "C" fn(
721 graph_execute: *mut RenderGraphExecuteO,
722 key: StrhashT,
723 value: *mut RenderGraphBlackboardValue,
724 ) -> bool,
725 >,
726 pub append_viewers: ::std::option::Option<
727 unsafe extern "C" fn(
728 graph_execute: *mut RenderGraphExecuteO,
729 viewers: *const RenderGraphViewerT,
730 num_viewers: u32,
731 ) -> u32,
732 >,
733}
734#[repr(C)]
735#[derive(Default, Copy, Clone)]
736pub struct RenderGraphPassApi {
737 pub init_pass: ::std::option::Option<
738 unsafe extern "C" fn(
739 const_data: *mut ::std::os::raw::c_void,
740 allocator: *mut AllocatorI,
741 res_buf: *mut RendererResourceCommandBufferO,
742 ),
743 >,
744 pub shutdown_pass: ::std::option::Option<
745 unsafe extern "C" fn(
746 const_data: *mut ::std::os::raw::c_void,
747 allocator: *mut AllocatorI,
748 res_buf: *mut RendererResourceCommandBufferO,
749 ),
750 >,
751 pub setup_pass: ::std::option::Option<
752 unsafe extern "C" fn(
753 const_data: *const ::std::os::raw::c_void,
754 runtime_data: *mut ::std::os::raw::c_void,
755 graph_setup: *mut RenderGraphSetupO,
756 ),
757 >,
758 pub execute_pass: ::std::option::Option<
759 unsafe extern "C" fn(
760 const_data: *const ::std::os::raw::c_void,
761 runtime_data: *mut ::std::os::raw::c_void,
762 sort_key: u64,
763 graph_execute: *mut RenderGraphExecuteO,
764 ),
765 >,
766}
767#[repr(C)]
768#[derive(Copy, Clone)]
769pub struct RenderGraphPassI {
770 pub const_data: *mut ::std::os::raw::c_void,
771 pub const_data_size: u64,
772 pub runtime_data_size: u64,
773 pub profiling_scope: *const ::std::os::raw::c_char,
774 pub api: RenderGraphPassApi,
775}
776impl Default for RenderGraphPassI {
777 fn default() -> Self {
778 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
779 unsafe {
780 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
781 s.assume_init()
782 }
783 }
784}
785
786use const_cstr::{const_cstr, ConstCStr};
789
790use crate::foundation::VersionT;
791
792use crate::foundation::*;
793use crate::plugins::renderer::*;
794use crate::plugins::shader_system::*;
795use crate::plugins::ui::{ToolbarI, UiStyleT};
796
797impl RenderGraphApi {
798 pub unsafe fn create(
799 &self,
800 sort_key: u64,
801 static_sort_key: bool,
802 allocator: *mut AllocatorI,
803 shader_repository: *mut ShaderRepositoryO,
804 ) -> *mut RenderGraphO {
805 self.create.unwrap()(sort_key, static_sort_key, allocator, shader_repository)
806 }
807
808 pub unsafe fn destroy(
809 &self,
810 graph: *mut RenderGraphO,
811 res_buf: *mut RendererResourceCommandBufferO,
812 ) {
813 self.destroy.unwrap()(graph, res_buf)
814 }
815
816 pub unsafe fn sort_key(
817 &self,
818 graph: *const RenderGraphO,
819 material_layer_name: StrhashT,
820 ) -> u64 {
821 self.sort_key.unwrap()(graph, material_layer_name)
822 }
823
824 pub unsafe fn register_gpu_image(
825 &self,
826 graph: *mut RenderGraphO,
827 name: StrhashT,
828 resource: RendererHandleT,
829 resource_state: u32,
830 image_desc: *const RendererImageDescT,
831 ) {
832 self.register_gpu_image.unwrap()(graph, name, resource, resource_state, image_desc)
833 }
834
835 pub unsafe fn register_gpu_buffer(
836 &self,
837 graph: *mut RenderGraphO,
838 name: StrhashT,
839 resource: RendererHandleT,
840 resource_state: u32,
841 buffer_desc: *const RendererBufferDescT,
842 ) {
843 self.register_gpu_buffer.unwrap()(graph, name, resource, resource_state, buffer_desc)
844 }
845
846 pub unsafe fn write_blackboard(
847 &self,
848 graph: *mut RenderGraphO,
849 key: StrhashT,
850 value: RenderGraphBlackboardValue,
851 ) {
852 self.write_blackboard.unwrap()(graph, key, value)
853 }
854
855 pub unsafe fn read_blackboard(
856 &self,
857 graph: *const RenderGraphO,
858 key: StrhashT,
859 value: *mut RenderGraphBlackboardValue,
860 ) -> bool {
861 self.read_blackboard.unwrap()(graph, key, value)
862 }
863
864 pub unsafe fn setup_passes(
865 &self,
866 graph: *mut RenderGraphO,
867 render_module: *mut RenderGraphModuleO,
868 ) {
869 self.setup_passes.unwrap()(graph, render_module)
870 }
871
872 pub unsafe fn validate_and_build(
873 &self,
874 graph: *mut RenderGraphO,
875 backend: *mut RendererBackendI,
876 device_affinity_mask: u32,
877 ) -> bool {
878 self.validate_and_build.unwrap()(graph, backend, device_affinity_mask)
879 }
880
881 pub unsafe fn visualize(
882 &self,
883 graph: *const RenderGraphO,
884 ta: *mut TempAllocatorI,
885 ) -> *mut ::std::os::raw::c_char {
886 self.visualize.unwrap()(graph, ta)
887 }
888
889 pub unsafe fn execute(
890 &self,
891 graph: *mut RenderGraphO,
892 backend: *mut RendererBackendI,
893 shader_context: *const ShaderSystemContextO,
894 device_affinity_mask: u32,
895 ) -> *mut AtomicCounterO {
896 self.execute.unwrap()(graph, backend, shader_context, device_affinity_mask)
897 }
898
899 pub unsafe fn resource_buffers(
900 &self,
901 graph: *const RenderGraphO,
902 resource_buffers: *mut *mut RendererResourceCommandBufferO,
903 num_resource_buffers: *mut u32,
904 ) {
905 self.resource_buffers.unwrap()(graph, resource_buffers, num_resource_buffers)
906 }
907
908 pub unsafe fn command_buffers(
909 &self,
910 graph: *const RenderGraphO,
911 command_buffers: *mut *mut RendererCommandBufferO,
912 num_command_buffers: *mut u32,
913 ) {
914 self.command_buffers.unwrap()(graph, command_buffers, num_command_buffers)
915 }
916
917 pub unsafe fn viewers(
918 &self,
919 graph: *mut RenderGraphO,
920 viewers: *mut RenderGraphViewerT,
921 num_viewers: *mut u32,
922 ) {
923 self.viewers.unwrap()(graph, viewers, num_viewers)
924 }
925
926 pub unsafe fn backend_handle(
927 &self,
928 graph: *const RenderGraphO,
929 graph_handle: RenderGraphHandleT,
930 ) -> RendererHandleT {
931 self.backend_handle.unwrap()(graph, graph_handle)
932 }
933
934 pub unsafe fn data_requested(&self, graph: *const RenderGraphO, name: StrhashT) -> bool {
935 self.data_requested.unwrap()(graph, name)
936 }
937
938 pub unsafe fn external_resource(
939 &self,
940 graph: *mut RenderGraphO,
941 name: StrhashT,
942 ) -> RenderGraphHandleT {
943 self.external_resource.unwrap()(graph, name)
944 }
945
946 pub unsafe fn image_desc(
947 &self,
948 graph: *mut RenderGraphO,
949 handle: RenderGraphHandleT,
950 ) -> *const RendererImageDescT {
951 self.image_desc.unwrap()(graph, handle)
952 }
953
954 pub unsafe fn buffer_desc(
955 &self,
956 graph: *mut RenderGraphO,
957 handle: RenderGraphHandleT,
958 ) -> *const RendererBufferDescT {
959 self.buffer_desc.unwrap()(graph, handle)
960 }
961}
962
963impl crate::Api for RenderGraphApi {
964 const NAME: ConstCStr = const_cstr!("tm_render_graph_api");
965 const VERSION: VersionT = VersionT {
966 major: 1u32,
967 minor: 0u32,
968 patch: 0u32,
969 };
970}
971
972impl RenderGraphModuleApi {
973 pub unsafe fn create(
974 &self,
975 allocator: *mut AllocatorI,
976 name: *const ::std::os::raw::c_char,
977 ) -> *mut RenderGraphModuleO {
978 self.create.unwrap()(allocator, name)
979 }
980
981 pub unsafe fn destroy(
982 &self,
983 render_module: *mut RenderGraphModuleO,
984 res_buf: *mut RendererResourceCommandBufferO,
985 ) {
986 self.destroy.unwrap()(render_module, res_buf)
987 }
988
989 pub unsafe fn name(&self, render_module: *const RenderGraphModuleO) -> StrhashT {
990 self.name.unwrap()(render_module)
991 }
992
993 pub unsafe fn human_readable_name(
994 &self,
995 render_module: *const RenderGraphModuleO,
996 ) -> *const ::std::os::raw::c_char {
997 self.human_readable_name.unwrap()(render_module)
998 }
999
1000 pub unsafe fn add_pass(
1001 &self,
1002 render_module: *mut RenderGraphModuleO,
1003 pass: *const RenderGraphPassI,
1004 ) {
1005 self.add_pass.unwrap()(render_module, pass)
1006 }
1007
1008 pub unsafe fn add_extension_point(
1009 &self,
1010 render_module: *mut RenderGraphModuleO,
1011 extension_point_name: StrhashT,
1012 ) {
1013 self.add_extension_point.unwrap()(render_module, extension_point_name)
1014 }
1015
1016 pub unsafe fn insert_extension(
1017 &self,
1018 render_module: *mut RenderGraphModuleO,
1019 extension_point_name: StrhashT,
1020 extension: *mut RenderGraphModuleO,
1021 ordering_weight: f32,
1022 ) -> bool {
1023 self.insert_extension.unwrap()(
1024 render_module,
1025 extension_point_name,
1026 extension,
1027 ordering_weight,
1028 )
1029 }
1030
1031 pub unsafe fn remove_extension(
1032 &self,
1033 render_module: *mut RenderGraphModuleO,
1034 res_buf: *mut RendererResourceCommandBufferO,
1035 extension_point_name: StrhashT,
1036 extension: *mut RenderGraphModuleO,
1037 ) -> bool {
1038 self.remove_extension.unwrap()(render_module, res_buf, extension_point_name, extension)
1039 }
1040
1041 pub unsafe fn extensions(
1042 &self,
1043 render_module: *const RenderGraphModuleO,
1044 extension_point_name: StrhashT,
1045 num_modules: *mut u32,
1046 ) -> *const *const RenderGraphModuleO {
1047 self.extensions.unwrap()(render_module, extension_point_name, num_modules)
1048 }
1049
1050 pub unsafe fn add_sub_module(
1051 &self,
1052 render_module: *mut RenderGraphModuleO,
1053 shader_layer_name: StrhashT,
1054 sub_module: *mut RenderGraphModuleO,
1055 ) {
1056 self.add_sub_module.unwrap()(render_module, shader_layer_name, sub_module)
1057 }
1058
1059 pub unsafe fn init_passes(
1060 &self,
1061 render_module: *mut RenderGraphModuleO,
1062 res_buf: *mut RendererResourceCommandBufferO,
1063 ) {
1064 self.init_passes.unwrap()(render_module, res_buf)
1065 }
1066
1067 pub unsafe fn set_editor_submenu_interface(
1068 &self,
1069 render_module: *mut RenderGraphModuleO,
1070 submenu_i: *const RenderGraphModuleEditorSubmenuI,
1071 ) {
1072 self.set_editor_submenu_interface.unwrap()(render_module, submenu_i)
1073 }
1074
1075 pub unsafe fn editor_submenu(
1076 &self,
1077 render_module: *mut RenderGraphModuleO,
1078 ui: *mut UiO,
1079 uistyle: *const UiStyleT,
1080 submenu_pos: Vec2T,
1081 ) {
1082 self.editor_submenu.unwrap()(render_module, ui, uistyle, submenu_pos)
1083 }
1084
1085 pub unsafe fn set_editor_toolbar(
1086 &self,
1087 render_module: *mut RenderGraphModuleO,
1088 toolbar: *mut ToolbarI,
1089 ) {
1090 self.set_editor_toolbar.unwrap()(render_module, toolbar)
1091 }
1092
1093 pub unsafe fn editor_toolbars(
1094 &self,
1095 render_module: *mut RenderGraphModuleO,
1096 ta: *mut TempAllocatorI,
1097 ) -> *mut ToolbarI {
1098 self.editor_toolbars.unwrap()(render_module, ta)
1099 }
1100
1101 pub unsafe fn create_persistent_gpu_image(
1102 &self,
1103 render_module: *mut RenderGraphModuleO,
1104 name: StrhashT,
1105 image_desc: *const RendererImageDescT,
1106 inherits: StrhashT,
1107 scale: *const f32,
1108 ) {
1109 self.create_persistent_gpu_image.unwrap()(render_module, name, image_desc, inherits, scale)
1110 }
1111
1112 pub unsafe fn create_persistent_gpu_buffer(
1113 &self,
1114 render_module: *mut RenderGraphModuleO,
1115 name: StrhashT,
1116 buffer_desc: *const RendererBufferDescT,
1117 inherits: StrhashT,
1118 ) {
1119 self.create_persistent_gpu_buffer.unwrap()(render_module, name, buffer_desc, inherits)
1120 }
1121}
1122
1123impl crate::Api for RenderGraphModuleApi {
1124 const NAME: ConstCStr = const_cstr!("tm_render_graph_module_api");
1125 const VERSION: VersionT = VersionT {
1126 major: 1u32,
1127 minor: 0u32,
1128 patch: 0u32,
1129 };
1130}
1131
1132impl RenderGraphSetupApi {
1133 pub unsafe fn external_resource(
1134 &self,
1135 graph_setup: *mut RenderGraphSetupO,
1136 name: StrhashT,
1137 ) -> RenderGraphHandleT {
1138 self.external_resource.unwrap()(graph_setup, name)
1139 }
1140
1141 pub unsafe fn image_desc(
1142 &self,
1143 graph_setup: *mut RenderGraphSetupO,
1144 handle: RenderGraphHandleT,
1145 ) -> *const RendererImageDescT {
1146 self.image_desc.unwrap()(graph_setup, handle)
1147 }
1148
1149 pub unsafe fn buffer_desc(
1150 &self,
1151 graph_setup: *mut RenderGraphSetupO,
1152 handle: RenderGraphHandleT,
1153 ) -> *const RendererBufferDescT {
1154 self.buffer_desc.unwrap()(graph_setup, handle)
1155 }
1156
1157 pub unsafe fn shader_repository(
1158 &self,
1159 graph_setup: *mut RenderGraphSetupO,
1160 ) -> *mut ShaderRepositoryO {
1161 self.shader_repository.unwrap()(graph_setup)
1162 }
1163
1164 pub unsafe fn create_gpu_images(
1165 &self,
1166 graph_setup: *mut RenderGraphSetupO,
1167 image_descs: *const RendererImageDescT,
1168 num_images: u32,
1169 handles: *mut RenderGraphHandleT,
1170 ) {
1171 self.create_gpu_images.unwrap()(graph_setup, image_descs, num_images, handles)
1172 }
1173
1174 pub unsafe fn create_gpu_buffers(
1175 &self,
1176 graph_setup: *mut RenderGraphSetupO,
1177 buffer_descs: *const RendererBufferDescT,
1178 num_buffers: u32,
1179 handles: *mut RenderGraphHandleT,
1180 ) {
1181 self.create_gpu_buffers.unwrap()(graph_setup, buffer_descs, num_buffers, handles)
1182 }
1183
1184 pub unsafe fn read_gpu_resource(
1185 &self,
1186 graph_setup: *mut RenderGraphSetupO,
1187 handle: RenderGraphHandleT,
1188 wanted_resource_state: u32,
1189 subresource_view: *const RendererImageViewT,
1190 ) {
1191 self.read_gpu_resource.unwrap()(
1192 graph_setup,
1193 handle,
1194 wanted_resource_state,
1195 subresource_view,
1196 )
1197 }
1198
1199 pub unsafe fn write_gpu_resource(
1200 &self,
1201 graph_setup: *mut RenderGraphSetupO,
1202 handle: RenderGraphHandleT,
1203 write_bind_flags: RenderGraphWriteBindFlag,
1204 wanted_resource_state: u32,
1205 load_op: u32,
1206 bind_slot: u32,
1207 blackboard_key: StrhashT,
1208 subresource_view: *const RendererImageViewT,
1209 ) {
1210 self.write_gpu_resource.unwrap()(
1211 graph_setup,
1212 handle,
1213 write_bind_flags,
1214 wanted_resource_state,
1215 load_op,
1216 bind_slot,
1217 blackboard_key,
1218 subresource_view,
1219 )
1220 }
1221
1222 pub unsafe fn set_active(&self, graph_setup: *mut RenderGraphSetupO, state: bool) {
1223 self.set_active.unwrap()(graph_setup, state)
1224 }
1225
1226 pub unsafe fn set_early_out(&self, graph_setup: *mut RenderGraphSetupO, state: bool) {
1227 self.set_early_out.unwrap()(graph_setup, state)
1228 }
1229
1230 pub unsafe fn set_output(&self, graph_setup: *mut RenderGraphSetupO, state: bool) {
1231 self.set_output.unwrap()(graph_setup, state)
1232 }
1233
1234 pub unsafe fn set_request_async_compute(
1235 &self,
1236 graph_setup: *mut RenderGraphSetupO,
1237 state: bool,
1238 ) {
1239 self.set_request_async_compute.unwrap()(graph_setup, state)
1240 }
1241
1242 pub unsafe fn set_request_multi_gpu(
1243 &self,
1244 graph_setup: *mut RenderGraphSetupO,
1245 device_affinity_mask: u32,
1246 ) {
1247 self.set_request_multi_gpu.unwrap()(graph_setup, device_affinity_mask)
1248 }
1249
1250 pub unsafe fn expose_as_material_layer(
1251 &self,
1252 graph_setup: *mut RenderGraphSetupO,
1253 layer_name: StrhashT,
1254 ) {
1255 self.expose_as_material_layer.unwrap()(graph_setup, layer_name)
1256 }
1257
1258 pub unsafe fn write_blackboard(
1259 &self,
1260 graph_setup: *mut RenderGraphSetupO,
1261 key: StrhashT,
1262 value: RenderGraphBlackboardValue,
1263 ) {
1264 self.write_blackboard.unwrap()(graph_setup, key, value)
1265 }
1266
1267 pub unsafe fn read_blackboard(
1268 &self,
1269 graph_setup: *mut RenderGraphSetupO,
1270 key: StrhashT,
1271 value: *mut RenderGraphBlackboardValue,
1272 ) -> bool {
1273 self.read_blackboard.unwrap()(graph_setup, key, value)
1274 }
1275
1276 pub unsafe fn request_data(&self, graph_setup: *mut RenderGraphSetupO, name: StrhashT) {
1277 self.request_data.unwrap()(graph_setup, name)
1278 }
1279}
1280
1281impl crate::Api for RenderGraphSetupApi {
1282 const NAME: ConstCStr = const_cstr!("tm_render_graph_setup_api");
1283 const VERSION: VersionT = VersionT {
1284 major: 1u32,
1285 minor: 0u32,
1286 patch: 0u32,
1287 };
1288}
1289
1290impl RenderGraphExecuteApi {
1291 pub unsafe fn default_command_buffer(
1292 &self,
1293 graph_execute: *mut RenderGraphExecuteO,
1294 ) -> *mut RendererCommandBufferO {
1295 self.default_command_buffer.unwrap()(graph_execute)
1296 }
1297
1298 pub unsafe fn default_resource_command_buffer(
1299 &self,
1300 graph_execute: *mut RenderGraphExecuteO,
1301 ) -> *mut RendererResourceCommandBufferO {
1302 self.default_resource_command_buffer.unwrap()(graph_execute)
1303 }
1304
1305 pub unsafe fn shader_context(
1306 &self,
1307 graph_execute: *mut RenderGraphExecuteO,
1308 ) -> *const ShaderSystemContextO {
1309 self.shader_context.unwrap()(graph_execute)
1310 }
1311
1312 pub unsafe fn device_affinity_mask(&self, graph_execute: *mut RenderGraphExecuteO) -> u32 {
1313 self.device_affinity_mask.unwrap()(graph_execute)
1314 }
1315
1316 pub unsafe fn backend_handle(
1317 &self,
1318 graph_execute: *mut RenderGraphExecuteO,
1319 graph_handle: RenderGraphHandleT,
1320 subresource_view: *const RendererImageViewT,
1321 ) -> RendererHandleT {
1322 self.backend_handle.unwrap()(graph_execute, graph_handle, subresource_view)
1323 }
1324
1325 pub unsafe fn run_sub_module(
1326 &self,
1327 graph_execute: *mut RenderGraphExecuteO,
1328 sub_module_name: StrhashT,
1329 sort_key: u64,
1330 commands: *mut RendererCommandBufferO,
1331 ) {
1332 self.run_sub_module.unwrap()(graph_execute, sub_module_name, sort_key, commands)
1333 }
1334
1335 pub unsafe fn read_blackboard(
1336 &self,
1337 graph_execute: *mut RenderGraphExecuteO,
1338 key: StrhashT,
1339 value: *mut RenderGraphBlackboardValue,
1340 ) -> bool {
1341 self.read_blackboard.unwrap()(graph_execute, key, value)
1342 }
1343
1344 pub unsafe fn append_viewers(
1345 &self,
1346 graph_execute: *mut RenderGraphExecuteO,
1347 viewers: *const RenderGraphViewerT,
1348 num_viewers: u32,
1349 ) -> u32 {
1350 self.append_viewers.unwrap()(graph_execute, viewers, num_viewers)
1351 }
1352}
1353
1354impl crate::Api for RenderGraphExecuteApi {
1355 const NAME: ConstCStr = const_cstr!("tm_render_graph_execute_api");
1356 const VERSION: VersionT = VersionT {
1357 major: 1u32,
1358 minor: 0u32,
1359 patch: 0u32,
1360 };
1361}
1362
1363impl RenderGraphPassApi {
1364 pub unsafe fn init_pass(
1365 &self,
1366 const_data: *mut ::std::os::raw::c_void,
1367 allocator: *mut AllocatorI,
1368 res_buf: *mut RendererResourceCommandBufferO,
1369 ) {
1370 self.init_pass.unwrap()(const_data, allocator, res_buf)
1371 }
1372
1373 pub unsafe fn shutdown_pass(
1374 &self,
1375 const_data: *mut ::std::os::raw::c_void,
1376 allocator: *mut AllocatorI,
1377 res_buf: *mut RendererResourceCommandBufferO,
1378 ) {
1379 self.shutdown_pass.unwrap()(const_data, allocator, res_buf)
1380 }
1381
1382 pub unsafe fn setup_pass(
1383 &self,
1384 const_data: *const ::std::os::raw::c_void,
1385 runtime_data: *mut ::std::os::raw::c_void,
1386 graph_setup: *mut RenderGraphSetupO,
1387 ) {
1388 self.setup_pass.unwrap()(const_data, runtime_data, graph_setup)
1389 }
1390
1391 pub unsafe fn execute_pass(
1392 &self,
1393 const_data: *const ::std::os::raw::c_void,
1394 runtime_data: *mut ::std::os::raw::c_void,
1395 sort_key: u64,
1396 graph_execute: *mut RenderGraphExecuteO,
1397 ) {
1398 self.execute_pass.unwrap()(const_data, runtime_data, sort_key, graph_execute)
1399 }
1400}
1401
1402impl crate::Api for RenderGraphPassApi {
1403 const NAME: ConstCStr = const_cstr!("tm_render_graph_pass_api");
1404 const VERSION: VersionT = VersionT {
1405 major: 1u32,
1406 minor: 0u32,
1407 patch: 0u32,
1408 };
1409}
1410
1411pub const TM_RENDER_GRAPH_SETUP_API_VERSION: VersionT = VersionT {
1412 major: 1u32,
1413 minor: 0u32,
1414 patch: 0u32,
1415};
1416pub const TM_RENDER_GRAPH_PASS_API_VERSION: VersionT = VersionT {
1417 major: 1u32,
1418 minor: 0u32,
1419 patch: 0u32,
1420};
1421pub const TM_RENDER_GRAPH_MODULE_API_VERSION: VersionT = VersionT {
1422 major: 1u32,
1423 minor: 0u32,
1424 patch: 0u32,
1425};
1426pub const TM_RENDER_GRAPH_API_VERSION: VersionT = VersionT {
1427 major: 1u32,
1428 minor: 0u32,
1429 patch: 0u32,
1430};
1431pub const TM_RENDER_GRAPH_EXECUTE_API_VERSION: VersionT = VersionT {
1432 major: 1u32,
1433 minor: 0u32,
1434 patch: 0u32,
1435};