Skip to content

Commit

Permalink
Add missing VFT related functions for IntersectionFunctionTable
Browse files Browse the repository at this point in the history
  • Loading branch information
FlannyH committed May 2, 2024
1 parent 2eaadc7 commit 3cf2d53
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/accelerator_structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,34 @@ impl IntersectionFunctionTableRef {
pub fn set_function(&self, function: &FunctionHandleRef, index: NSUInteger) {
unsafe { msg_send![self, setFunction: function atIndex: index] }
}

pub fn set_visible_function_table(
&self,
visible_function_table: Option<&VisibleFunctionTableRef>,
buffer_index: NSUInteger,
) {
unsafe {
msg_send![self,
setVisibleFunctionTable:visible_function_table
atBufferIndex:buffer_index]
}
}

pub fn set_visible_function_tables(
&self,
visible_function_tables: &[&VisibleFunctionTableRef],
buffer_start_index: NSUInteger,
) {
unsafe {
msg_send![self,
setVisibleFunctionTables:visible_function_tables.as_ptr()
withBufferRange: NSRange {
location: buffer_start_index,
length: visible_function_tables.len() as _,
}
]
}
}
}

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

0 comments on commit 3cf2d53

Please sign in to comment.