@@ -1632,9 +1632,9 @@ impl crate::Device for super::Device {
16321632
16331633 unsafe fn get_acceleration_structure_device_address (
16341634 & self ,
1635- _acceleration_structure : & super :: AccelerationStructure ,
1635+ acceleration_structure : & super :: AccelerationStructure ,
16361636 ) -> wgt:: BufferAddress {
1637- unimplemented ! ( )
1637+ acceleration_structure . raw . gpu_resource_id ( ) . _impl
16381638 }
16391639
16401640 unsafe fn create_acceleration_structure (
@@ -1656,7 +1656,7 @@ impl crate::Device for super::Device {
16561656 }
16571657
16581658 fn tlas_instance_to_bytes ( & self , instance : TlasInstance ) -> Vec < u8 > {
1659- let temp = metal:: MTLAccelerationStructureInstanceDescriptor {
1659+ let temp = metal:: MTLIndirectAccelerationStructureInstanceDescriptor {
16601660 transformation_matrix : [
16611661 [
16621662 instance. transform [ 0 ] ,
@@ -1680,12 +1680,13 @@ impl crate::Device for super::Device {
16801680 ] ,
16811681 ] ,
16821682 options : metal:: MTLAccelerationStructureInstanceOptions :: None ,
1683- mask : ( instance . custom_data << 8 ) | instance. mask as u32 ,
1683+ mask : instance. mask as u32 ,
16841684 intersection_function_table_offset : 0 ,
1685- acceleration_structure_index : instance. blas_address as u32 ,
1685+ acceleration_structure_id : instance. blas_address ,
1686+ user_id : instance. custom_data ,
16861687 } ;
16871688
1688- wgt:: bytemuck_wrapper!( unsafe struct Desc ( metal:: MTLAccelerationStructureInstanceDescriptor ) ) ;
1689+ wgt:: bytemuck_wrapper!( unsafe struct Desc ( metal:: MTLIndirectAccelerationStructureInstanceDescriptor ) ) ;
16891690
16901691 bytemuck:: bytes_of ( & Desc :: wrap ( temp) ) . to_vec ( )
16911692 }
0 commit comments