Skip to content

Commit 01aadcc

Browse files
committed
Update profiler
1 parent 9a2c7ab commit 01aadcc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

unity-native-plugin/src/profiler.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ define_unity_interface!(
375375
0x83CE589AE85B9068_u64
376376
);
377377

378+
pub type ProfilerCounterStatePtrCallback = UnityProfilerCounterStatePtrCallback;
379+
378380
macro_rules! impl_profiler_v2 {
379381
() => {
380382
impl_profiler!();
@@ -390,6 +392,24 @@ macro_rules! impl_profiler_v2 {
390392
}
391393
}
392394
}
395+
396+
pub unsafe fn create_counter_value(&self,
397+
category: ProfilerCategoryId,
398+
name: &std::ffi::CStr,
399+
flags: ProfilerMarkerFlags,
400+
value_type: ProfilerMarkerDataType,
401+
value_unit: ProfilerMarkerDataUnit,
402+
value_size: usize,
403+
counter_flags: ProfilerCounterFlags,
404+
activate_func: ProfilerCounterStatePtrCallback,
405+
deactivate_func: ProfilerCounterStatePtrCallback,
406+
user_data: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void {
407+
self.interface().CreateCounterValue.expect("CreateCounterValue")(category, name.as_ptr(), flags.into(), value_type.into(), value_unit.into(), value_size, counter_flags.into(), activate_func, deactivate_func, user_data)
408+
}
409+
410+
pub unsafe fn flush_counter_value(&self, counter: *mut ::std::os::raw::c_void) {
411+
self.interface().FlushCounterValue.expect("FlushCounterValue")(counter)
412+
}
393413
}
394414
}
395415

0 commit comments

Comments
 (0)