@@ -703,16 +703,13 @@ bitflags::bitflags! {
703703#[ cfg_attr( windows, repr( i32 ) ) ]
704704#[ cfg_attr( unix, repr( u32 ) ) ]
705705#[ derive( Debug , Copy , Clone , PartialEq ) ]
706+ #[ derive( Default ) ]
706707pub enum BuildOperation {
708+ #[ default]
707709 Build = sys:: OptixBuildOperation_OPTIX_BUILD_OPERATION_BUILD ,
708710 Update = sys:: OptixBuildOperation_OPTIX_BUILD_OPERATION_UPDATE ,
709711}
710712
711- impl Default for BuildOperation {
712- fn default ( ) -> Self {
713- BuildOperation :: Build
714- }
715- }
716713
717714/// Configure how to handle ray times that are outside of the provided motion keys.
718715///
@@ -983,7 +980,7 @@ pub struct CurveArray<'v, 'w, 'i> {
983980 primitive_index_offset : u32 ,
984981}
985982
986- impl < ' v , ' w , ' i > Hash for CurveArray < ' v , ' w , ' i > {
983+ impl Hash for CurveArray < ' _ , ' _ , ' _ > {
987984 fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
988985 self . curve_type . hash ( state) ;
989986 state. write_u32 ( self . num_primitives ) ;
@@ -1088,7 +1085,7 @@ impl<'v, 'w, 'i> CurveArray<'v, 'w, 'i> {
10881085 }
10891086}
10901087
1091- impl < ' v , ' w , ' i > BuildInput for CurveArray < ' v , ' w , ' i > {
1088+ impl BuildInput for CurveArray < ' _ , ' _ , ' _ > {
10921089 fn to_sys ( & self ) -> sys:: OptixBuildInput {
10931090 sys:: OptixBuildInput {
10941091 type_ : sys:: OptixBuildInputType_OPTIX_BUILD_INPUT_TYPE_CURVES ,
@@ -1139,13 +1136,13 @@ impl From<CurveType> for sys::OptixPrimitiveType {
11391136#[ repr( u32 ) ]
11401137#[ derive( Copy , Clone , PartialEq ) ]
11411138pub enum VertexFormat {
1142- None = sys:: OptixVertexFormat_OPTIX_VERTEX_FORMAT_NONE as u32 ,
1143- Float3 = sys:: OptixVertexFormat_OPTIX_VERTEX_FORMAT_FLOAT3 as u32 ,
1144- Float2 = sys:: OptixVertexFormat_OPTIX_VERTEX_FORMAT_FLOAT2 as u32 ,
1145- Half3 = sys:: OptixVertexFormat_OPTIX_VERTEX_FORMAT_HALF3 as u32 ,
1146- Half2 = sys:: OptixVertexFormat_OPTIX_VERTEX_FORMAT_HALF2 as u32 ,
1147- SNorm16 = sys:: OptixVertexFormat_OPTIX_VERTEX_FORMAT_SNORM16_3 as u32 ,
1148- SNorm32 = sys:: OptixVertexFormat_OPTIX_VERTEX_FORMAT_SNORM16_2 as u32 ,
1139+ None = sys:: OptixVertexFormat_OPTIX_VERTEX_FORMAT_NONE ,
1140+ Float3 = sys:: OptixVertexFormat_OPTIX_VERTEX_FORMAT_FLOAT3 ,
1141+ Float2 = sys:: OptixVertexFormat_OPTIX_VERTEX_FORMAT_FLOAT2 ,
1142+ Half3 = sys:: OptixVertexFormat_OPTIX_VERTEX_FORMAT_HALF3 ,
1143+ Half2 = sys:: OptixVertexFormat_OPTIX_VERTEX_FORMAT_HALF2 ,
1144+ SNorm16 = sys:: OptixVertexFormat_OPTIX_VERTEX_FORMAT_SNORM16_3 ,
1145+ SNorm32 = sys:: OptixVertexFormat_OPTIX_VERTEX_FORMAT_SNORM16_2 ,
11491146}
11501147
11511148/// Specifies the type of index data
@@ -1299,15 +1296,15 @@ impl<'v, 'g, V: Vertex> TriangleArray<'v, 'g, V> {
12991296 }
13001297}
13011298
1302- impl < ' v , ' g , V : Vertex > Hash for TriangleArray < ' v , ' g , V > {
1299+ impl < V : Vertex > Hash for TriangleArray < ' _ , ' _ , V > {
13031300 fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
13041301 state. write_u32 ( self . num_vertices ) ;
13051302 state. write_usize ( self . d_vertex_buffers . len ( ) ) ;
13061303 self . geometry_flags . hash ( state) ;
13071304 }
13081305}
13091306
1310- impl < ' v , ' g , V : Vertex > BuildInput for TriangleArray < ' v , ' g , V > {
1307+ impl < V : Vertex > BuildInput for TriangleArray < ' _ , ' _ , V > {
13111308 fn to_sys ( & self ) -> sys:: OptixBuildInput {
13121309 sys:: OptixBuildInput {
13131310 type_ : sys:: OptixBuildInputType_OPTIX_BUILD_INPUT_TYPE_TRIANGLES ,
@@ -1382,7 +1379,7 @@ impl<'v, 'i, V: Vertex, I: IndexTriple> IndexedTriangleArray<'v, 'i, V, I> {
13821379 }
13831380}
13841381
1385- impl < ' v , ' i , V : Vertex , I : IndexTriple > Hash for IndexedTriangleArray < ' v , ' i , V , I > {
1382+ impl < V : Vertex , I : IndexTriple > Hash for IndexedTriangleArray < ' _ , ' _ , V , I > {
13861383 fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
13871384 state. write_u32 ( self . num_vertices ) ;
13881385 state. write_usize ( self . d_vertex_buffers . len ( ) ) ;
@@ -1391,7 +1388,7 @@ impl<'v, 'i, V: Vertex, I: IndexTriple> Hash for IndexedTriangleArray<'v, 'i, V,
13911388 }
13921389}
13931390
1394- impl < ' v , ' i , V : Vertex , I : IndexTriple > BuildInput for IndexedTriangleArray < ' v , ' i , V , I > {
1391+ impl < V : Vertex , I : IndexTriple > BuildInput for IndexedTriangleArray < ' _ , ' _ , V , I > {
13951392 fn to_sys ( & self ) -> sys:: OptixBuildInput {
13961393 sys:: OptixBuildInput {
13971394 type_ : sys:: OptixBuildInputType_OPTIX_BUILD_INPUT_TYPE_TRIANGLES ,
@@ -1439,7 +1436,7 @@ pub struct CustomPrimitiveArray<'a, 's> {
14391436 primitive_index_offset : u32 ,
14401437}
14411438
1442- impl < ' a , ' g , ' s > Hash for CustomPrimitiveArray < ' a , ' s > {
1439+ impl < ' g > Hash for CustomPrimitiveArray < ' _ , ' _ > {
14431440 fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
14441441 state. write_usize ( self . aabb_buffers . len ( ) ) ;
14451442 state. write_u32 ( self . num_primitives ) ;
@@ -1509,7 +1506,7 @@ impl<'a, 's> CustomPrimitiveArray<'a, 's> {
15091506 }
15101507}
15111508
1512- impl < ' a , ' s > BuildInput for CustomPrimitiveArray < ' a , ' s > {
1509+ impl BuildInput for CustomPrimitiveArray < ' _ , ' _ > {
15131510 fn to_sys ( & self ) -> sys:: OptixBuildInput {
15141511 sys:: OptixBuildInput {
15151512 type_ : sys:: OptixBuildInputType_OPTIX_BUILD_INPUT_TYPE_CUSTOM_PRIMITIVES ,
@@ -1646,13 +1643,13 @@ impl<'i, 'a> InstanceArray<'i, 'a> {
16461643 }
16471644}
16481645
1649- impl < ' i , ' a > Hash for InstanceArray < ' i , ' a > {
1646+ impl Hash for InstanceArray < ' _ , ' _ > {
16501647 fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
16511648 state. write_usize ( self . instances . len ( ) ) ;
16521649 }
16531650}
16541651
1655- impl < ' i , ' a > BuildInput for InstanceArray < ' i , ' a > {
1652+ impl BuildInput for InstanceArray < ' _ , ' _ > {
16561653 fn to_sys ( & self ) -> sys:: OptixBuildInput {
16571654 cfg_if:: cfg_if! {
16581655 if #[ cfg( any( feature="optix72" , feature="optix73" ) ) ] {
@@ -1692,13 +1689,13 @@ impl<'i> InstancePointerArray<'i> {
16921689 }
16931690}
16941691
1695- impl < ' i > Hash for InstancePointerArray < ' i > {
1692+ impl Hash for InstancePointerArray < ' _ > {
16961693 fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
16971694 state. write_usize ( self . instances . len ( ) ) ;
16981695 }
16991696}
17001697
1701- impl < ' i > BuildInput for InstancePointerArray < ' i > {
1698+ impl BuildInput for InstancePointerArray < ' _ > {
17021699 fn to_sys ( & self ) -> sys:: OptixBuildInput {
17031700 cfg_if:: cfg_if! {
17041701 if #[ cfg( any( feature="optix72" , feature="optix73" ) ) ] {
@@ -1865,7 +1862,7 @@ impl MatrixMotionTransform {
18651862 cust:: memory:: memcpy_htod (
18661863 transform_ptr. as_raw ( ) ,
18671864 transforms. as_ptr ( ) as * const c_void ,
1868- std:: mem:: size_of :: < RowMatrix3x4 < f32 > > ( ) * num_keys ,
1865+ std:: mem:: size_of_val ( transforms ) ,
18691866 ) ?;
18701867
18711868 let hnd = convert_pointer_to_traversable_handle (
@@ -2014,7 +2011,7 @@ impl SrtMotionTransform {
20142011 cust:: memory:: memcpy_htod (
20152012 transform_ptr. as_raw ( ) ,
20162013 srt_data. as_ptr ( ) as * const c_void ,
2017- std:: mem:: size_of :: < SrtData > ( ) * num_keys ,
2014+ std:: mem:: size_of_val ( srt_data ) ,
20182015 ) ?;
20192016
20202017 let hnd = convert_pointer_to_traversable_handle (
0 commit comments