Skip to content

Commit 3cf2d53

Browse files
committed
Add missing VFT related functions for IntersectionFunctionTable
1 parent 2eaadc7 commit 3cf2d53

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/accelerator_structure.rs

+28
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,34 @@ impl IntersectionFunctionTableRef {
345345
pub fn set_function(&self, function: &FunctionHandleRef, index: NSUInteger) {
346346
unsafe { msg_send![self, setFunction: function atIndex: index] }
347347
}
348+
349+
pub fn set_visible_function_table(
350+
&self,
351+
visible_function_table: Option<&VisibleFunctionTableRef>,
352+
buffer_index: NSUInteger,
353+
) {
354+
unsafe {
355+
msg_send![self,
356+
setVisibleFunctionTable:visible_function_table
357+
atBufferIndex:buffer_index]
358+
}
359+
}
360+
361+
pub fn set_visible_function_tables(
362+
&self,
363+
visible_function_tables: &[&VisibleFunctionTableRef],
364+
buffer_start_index: NSUInteger,
365+
) {
366+
unsafe {
367+
msg_send![self,
368+
setVisibleFunctionTables:visible_function_tables.as_ptr()
369+
withBufferRange: NSRange {
370+
location: buffer_start_index,
371+
length: visible_function_tables.len() as _,
372+
}
373+
]
374+
}
375+
}
348376
}
349377

350378
/// See <https://developer.apple.com/documentation/metal/mtlvisiblefunctiontabledescriptor>

0 commit comments

Comments
 (0)