diff --git a/src/lib.rs b/src/lib.rs index 0990995..d8af02e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,7 @@ struct IRMetalLibBinaryOpaque; struct IRShaderReflectionOpaque; struct IRErrorOpaque; -use std::mem::MaybeUninit; +use std::{ffi::CStr, mem::MaybeUninit}; #[repr(i32)] pub enum IRReflectionVersion { @@ -325,9 +325,12 @@ impl<'lib> IRObject<'lib> { } } - pub fn gather_raytracing_intrinsics(&self, entry_point: &str) -> u64 { + pub fn gather_raytracing_intrinsics(&self, entry_point: &CStr) -> u64 { unsafe { - (self.funcs.gather_raytracing_intrinsics)(self.me, entry_point.as_ptr() as *const i8) + (self.funcs.gather_raytracing_intrinsics)( + self.me, + <*const u8>::cast::(entry_point.to_bytes_with_nul().as_ptr()), + ) } }