Skip to content

Commit 210af5d

Browse files
trigpolynomLegNeato
authored andcommitted
fixing path_tracer and build works for linux
1 parent 1a663aa commit 210af5d

File tree

19 files changed

+101
-114
lines changed

19 files changed

+101
-114
lines changed

crates/optix/examples/rust/ex04_mesh_gpu/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use cuda_std::kernel;
44
use optix_device::{
55
closesthit, get_launch_index,
66
glam::*,
7-
misc::*,
87
payload,
98
trace::TraversableHandle,
109
trace::{trace, RayFlags},

crates/optix/optix_wrapper.rs

+28-28
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ impl OptixResult {
188188
}
189189
#[repr(transparent)]
190190
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
191-
pub struct OptixResult(pub ::std::os::raw::c_int);
191+
pub struct OptixResult(pub ::std::os::raw::c_uint);
192192
pub mod OptixDeviceProperty {
193-
pub type Type = ::std::os::raw::c_int;
193+
pub type Type = ::std::os::raw::c_uint;
194194
pub const OPTIX_DEVICE_PROPERTY_LIMIT_MAX_TRACE_DEPTH: Type = 8193;
195195
pub const OPTIX_DEVICE_PROPERTY_LIMIT_MAX_TRAVERSABLE_GRAPH_DEPTH: Type = 8194;
196196
pub const OPTIX_DEVICE_PROPERTY_LIMIT_MAX_PRIMITIVES_PER_GAS: Type = 8195;
@@ -212,8 +212,8 @@ pub type OptixLogCallback = ::std::option::Option<
212212
pub const OptixDeviceContextValidationMode_OPTIX_DEVICE_CONTEXT_VALIDATION_MODE_OFF:
213213
OptixDeviceContextValidationMode = 0;
214214
pub const OptixDeviceContextValidationMode_OPTIX_DEVICE_CONTEXT_VALIDATION_MODE_ALL:
215-
OptixDeviceContextValidationMode = -1;
216-
pub type OptixDeviceContextValidationMode = ::std::os::raw::c_int;
215+
OptixDeviceContextValidationMode = 4294967295;
216+
pub type OptixDeviceContextValidationMode = ::std::os::raw::c_uint;
217217
#[repr(C)]
218218
#[derive(Debug, Copy, Clone, PartialEq)]
219219
pub struct OptixDeviceContextOptions {
@@ -233,22 +233,22 @@ impl Default for OptixDeviceContextOptions {
233233
}
234234
pub const OptixHitKind_OPTIX_HIT_KIND_TRIANGLE_FRONT_FACE: OptixHitKind = 254;
235235
pub const OptixHitKind_OPTIX_HIT_KIND_TRIANGLE_BACK_FACE: OptixHitKind = 255;
236-
pub type OptixHitKind = ::std::os::raw::c_int;
236+
pub type OptixHitKind = ::std::os::raw::c_uint;
237237
pub const OptixIndicesFormat_OPTIX_INDICES_FORMAT_NONE: OptixIndicesFormat = 0;
238238
pub const OptixIndicesFormat_OPTIX_INDICES_FORMAT_UNSIGNED_SHORT3: OptixIndicesFormat = 8450;
239239
pub const OptixIndicesFormat_OPTIX_INDICES_FORMAT_UNSIGNED_INT3: OptixIndicesFormat = 8451;
240-
pub type OptixIndicesFormat = ::std::os::raw::c_int;
240+
pub type OptixIndicesFormat = ::std::os::raw::c_uint;
241241
pub const OptixVertexFormat_OPTIX_VERTEX_FORMAT_NONE: OptixVertexFormat = 0;
242242
pub const OptixVertexFormat_OPTIX_VERTEX_FORMAT_FLOAT3: OptixVertexFormat = 8481;
243243
pub const OptixVertexFormat_OPTIX_VERTEX_FORMAT_FLOAT2: OptixVertexFormat = 8482;
244244
pub const OptixVertexFormat_OPTIX_VERTEX_FORMAT_HALF3: OptixVertexFormat = 8483;
245245
pub const OptixVertexFormat_OPTIX_VERTEX_FORMAT_HALF2: OptixVertexFormat = 8484;
246246
pub const OptixVertexFormat_OPTIX_VERTEX_FORMAT_SNORM16_3: OptixVertexFormat = 8485;
247247
pub const OptixVertexFormat_OPTIX_VERTEX_FORMAT_SNORM16_2: OptixVertexFormat = 8486;
248-
pub type OptixVertexFormat = ::std::os::raw::c_int;
248+
pub type OptixVertexFormat = ::std::os::raw::c_uint;
249249
pub const OptixTransformFormat_OPTIX_TRANSFORM_FORMAT_NONE: OptixTransformFormat = 0;
250250
pub const OptixTransformFormat_OPTIX_TRANSFORM_FORMAT_MATRIX_FLOAT12: OptixTransformFormat = 8673;
251-
pub type OptixTransformFormat = ::std::os::raw::c_int;
251+
pub type OptixTransformFormat = ::std::os::raw::c_uint;
252252
#[repr(C)]
253253
pub struct OptixBuildInputTriangleArray {
254254
pub vertexBuffers: *const CUdeviceptr,
@@ -283,7 +283,7 @@ pub const OptixPrimitiveType_OPTIX_PRIMITIVE_TYPE_ROUND_QUADRATIC_BSPLINE: Optix
283283
pub const OptixPrimitiveType_OPTIX_PRIMITIVE_TYPE_ROUND_CUBIC_BSPLINE: OptixPrimitiveType = 9474;
284284
pub const OptixPrimitiveType_OPTIX_PRIMITIVE_TYPE_ROUND_LINEAR: OptixPrimitiveType = 9475;
285285
pub const OptixPrimitiveType_OPTIX_PRIMITIVE_TYPE_TRIANGLE: OptixPrimitiveType = 9521;
286-
pub type OptixPrimitiveType = ::std::os::raw::c_int;
286+
pub type OptixPrimitiveType = ::std::os::raw::c_uint;
287287
pub const OptixPrimitiveTypeFlags_OPTIX_PRIMITIVE_TYPE_FLAGS_CUSTOM: OptixPrimitiveTypeFlags = 1;
288288
pub const OptixPrimitiveTypeFlags_OPTIX_PRIMITIVE_TYPE_FLAGS_ROUND_QUADRATIC_BSPLINE:
289289
OptixPrimitiveTypeFlags = 2;
@@ -369,7 +369,7 @@ pub const OptixBuildInputType_OPTIX_BUILD_INPUT_TYPE_CUSTOM_PRIMITIVES: OptixBui
369369
pub const OptixBuildInputType_OPTIX_BUILD_INPUT_TYPE_INSTANCES: OptixBuildInputType = 8515;
370370
pub const OptixBuildInputType_OPTIX_BUILD_INPUT_TYPE_INSTANCE_POINTERS: OptixBuildInputType = 8516;
371371
pub const OptixBuildInputType_OPTIX_BUILD_INPUT_TYPE_CURVES: OptixBuildInputType = 8517;
372-
pub type OptixBuildInputType = ::std::os::raw::c_int;
372+
pub type OptixBuildInputType = ::std::os::raw::c_uint;
373373
#[repr(C)]
374374
pub struct OptixBuildInput__bindgen_ty_1 {
375375
pub triangleArray: __BindgenUnionField<OptixBuildInputTriangleArray>,
@@ -395,7 +395,7 @@ pub const OptixInstanceFlags_OPTIX_INSTANCE_FLAG_FLIP_TRIANGLE_FACING: OptixInst
395395
pub const OptixInstanceFlags_OPTIX_INSTANCE_FLAG_DISABLE_ANYHIT: OptixInstanceFlags = 4;
396396
pub const OptixInstanceFlags_OPTIX_INSTANCE_FLAG_ENFORCE_ANYHIT: OptixInstanceFlags = 8;
397397
pub const OptixInstanceFlags_OPTIX_INSTANCE_FLAG_DISABLE_TRANSFORM: OptixInstanceFlags = 64;
398-
pub type OptixInstanceFlags = ::std::os::raw::c_int;
398+
pub type OptixInstanceFlags = ::std::os::raw::c_uint;
399399
#[repr(C)]
400400
#[derive(Debug, Default, Copy, Clone, PartialEq)]
401401
pub struct OptixInstance {
@@ -414,14 +414,14 @@ pub const OptixBuildFlags_OPTIX_BUILD_FLAG_PREFER_FAST_TRACE: OptixBuildFlags =
414414
pub const OptixBuildFlags_OPTIX_BUILD_FLAG_PREFER_FAST_BUILD: OptixBuildFlags = 8;
415415
pub const OptixBuildFlags_OPTIX_BUILD_FLAG_ALLOW_RANDOM_VERTEX_ACCESS: OptixBuildFlags = 16;
416416
pub const OptixBuildFlags_OPTIX_BUILD_FLAG_ALLOW_RANDOM_INSTANCE_ACCESS: OptixBuildFlags = 32;
417-
pub type OptixBuildFlags = ::std::os::raw::c_int;
417+
pub type OptixBuildFlags = ::std::os::raw::c_uint;
418418
pub const OptixBuildOperation_OPTIX_BUILD_OPERATION_BUILD: OptixBuildOperation = 8545;
419419
pub const OptixBuildOperation_OPTIX_BUILD_OPERATION_UPDATE: OptixBuildOperation = 8546;
420-
pub type OptixBuildOperation = ::std::os::raw::c_int;
420+
pub type OptixBuildOperation = ::std::os::raw::c_uint;
421421
pub const OptixMotionFlags_OPTIX_MOTION_FLAG_NONE: OptixMotionFlags = 0;
422422
pub const OptixMotionFlags_OPTIX_MOTION_FLAG_START_VANISH: OptixMotionFlags = 1;
423423
pub const OptixMotionFlags_OPTIX_MOTION_FLAG_END_VANISH: OptixMotionFlags = 2;
424-
pub type OptixMotionFlags = ::std::os::raw::c_int;
424+
pub type OptixMotionFlags = ::std::os::raw::c_uint;
425425
#[repr(C)]
426426
#[derive(Debug, Default, Copy, Clone, PartialEq)]
427427
pub struct OptixMotionOptions {
@@ -455,7 +455,7 @@ pub struct OptixAccelBufferSizes {
455455
}
456456
pub const OptixAccelPropertyType_OPTIX_PROPERTY_TYPE_COMPACTED_SIZE: OptixAccelPropertyType = 8577;
457457
pub const OptixAccelPropertyType_OPTIX_PROPERTY_TYPE_AABBS: OptixAccelPropertyType = 8578;
458-
pub type OptixAccelPropertyType = ::std::os::raw::c_int;
458+
pub type OptixAccelPropertyType = ::std::os::raw::c_uint;
459459
#[repr(C)]
460460
pub struct OptixAccelEmitDesc {
461461
pub result: CUdeviceptr,
@@ -524,9 +524,9 @@ pub const OptixTraversableType_OPTIX_TRAVERSABLE_TYPE_MATRIX_MOTION_TRANSFORM:
524524
OptixTraversableType = 8642;
525525
pub const OptixTraversableType_OPTIX_TRAVERSABLE_TYPE_SRT_MOTION_TRANSFORM: OptixTraversableType =
526526
8643;
527-
pub type OptixTraversableType = ::std::os::raw::c_int;
527+
pub type OptixTraversableType = ::std::os::raw::c_uint;
528528
pub mod OptixPixelFormat {
529-
pub type Type = ::std::os::raw::c_int;
529+
pub type Type = ::std::os::raw::c_uint;
530530
pub const OPTIX_PIXEL_FORMAT_HALF2: Type = 8711;
531531
pub const OPTIX_PIXEL_FORMAT_HALF3: Type = 8705;
532532
pub const OPTIX_PIXEL_FORMAT_HALF4: Type = 8706;
@@ -555,7 +555,7 @@ impl Default for OptixImage2D {
555555
}
556556
}
557557
pub mod OptixDenoiserModelKind {
558-
pub type Type = ::std::os::raw::c_int;
558+
pub type Type = ::std::os::raw::c_uint;
559559
pub const OPTIX_DENOISER_MODEL_KIND_LDR: Type = 8994;
560560
pub const OPTIX_DENOISER_MODEL_KIND_HDR: Type = 8995;
561561
pub const OPTIX_DENOISER_MODEL_KIND_AOV: Type = 8996;
@@ -630,29 +630,29 @@ pub const OptixRayFlags_OPTIX_RAY_FLAG_CULL_BACK_FACING_TRIANGLES: OptixRayFlags
630630
pub const OptixRayFlags_OPTIX_RAY_FLAG_CULL_FRONT_FACING_TRIANGLES: OptixRayFlags = 32;
631631
pub const OptixRayFlags_OPTIX_RAY_FLAG_CULL_DISABLED_ANYHIT: OptixRayFlags = 64;
632632
pub const OptixRayFlags_OPTIX_RAY_FLAG_CULL_ENFORCED_ANYHIT: OptixRayFlags = 128;
633-
pub type OptixRayFlags = ::std::os::raw::c_int;
633+
pub type OptixRayFlags = ::std::os::raw::c_uint;
634634
pub const OptixTransformType_OPTIX_TRANSFORM_TYPE_NONE: OptixTransformType = 0;
635635
pub const OptixTransformType_OPTIX_TRANSFORM_TYPE_STATIC_TRANSFORM: OptixTransformType = 1;
636636
pub const OptixTransformType_OPTIX_TRANSFORM_TYPE_MATRIX_MOTION_TRANSFORM: OptixTransformType = 2;
637637
pub const OptixTransformType_OPTIX_TRANSFORM_TYPE_SRT_MOTION_TRANSFORM: OptixTransformType = 3;
638638
pub const OptixTransformType_OPTIX_TRANSFORM_TYPE_INSTANCE: OptixTransformType = 4;
639-
pub type OptixTransformType = ::std::os::raw::c_int;
639+
pub type OptixTransformType = ::std::os::raw::c_uint;
640640
pub mod OptixTraversableGraphFlags {
641-
pub type Type = ::std::os::raw::c_int;
641+
pub type Type = ::std::os::raw::c_uint;
642642
pub const OPTIX_TRAVERSABLE_GRAPH_FLAG_ALLOW_ANY: Type = 0;
643643
pub const OPTIX_TRAVERSABLE_GRAPH_FLAG_ALLOW_SINGLE_GAS: Type = 1;
644644
pub const OPTIX_TRAVERSABLE_GRAPH_FLAG_ALLOW_SINGLE_LEVEL_INSTANCING: Type = 2;
645645
}
646646
pub mod OptixCompileOptimizationLevel {
647-
pub type Type = ::std::os::raw::c_int;
647+
pub type Type = ::std::os::raw::c_uint;
648648
pub const OPTIX_COMPILE_OPTIMIZATION_DEFAULT: Type = 0;
649649
pub const OPTIX_COMPILE_OPTIMIZATION_LEVEL_0: Type = 9024;
650650
pub const OPTIX_COMPILE_OPTIMIZATION_LEVEL_1: Type = 9025;
651651
pub const OPTIX_COMPILE_OPTIMIZATION_LEVEL_2: Type = 9026;
652652
pub const OPTIX_COMPILE_OPTIMIZATION_LEVEL_3: Type = 9027;
653653
}
654654
pub mod OptixCompileDebugLevel {
655-
pub type Type = ::std::os::raw::c_int;
655+
pub type Type = ::std::os::raw::c_uint;
656656
pub const OPTIX_COMPILE_DEBUG_LEVEL_DEFAULT: Type = 0;
657657
pub const OPTIX_COMPILE_DEBUG_LEVEL_NONE: Type = 9040;
658658
pub const OPTIX_COMPILE_DEBUG_LEVEL_LINEINFO: Type = 9041;
@@ -694,15 +694,15 @@ impl Default for OptixModuleCompileOptions {
694694
}
695695
}
696696
pub mod OptixProgramGroupKind {
697-
pub type Type = ::std::os::raw::c_int;
697+
pub type Type = ::std::os::raw::c_uint;
698698
pub const OPTIX_PROGRAM_GROUP_KIND_RAYGEN: Type = 9249;
699699
pub const OPTIX_PROGRAM_GROUP_KIND_MISS: Type = 9250;
700700
pub const OPTIX_PROGRAM_GROUP_KIND_EXCEPTION: Type = 9251;
701701
pub const OPTIX_PROGRAM_GROUP_KIND_HITGROUP: Type = 9252;
702702
pub const OPTIX_PROGRAM_GROUP_KIND_CALLABLES: Type = 9253;
703703
}
704704
pub const OptixProgramGroupFlags_OPTIX_PROGRAM_GROUP_FLAGS_NONE: OptixProgramGroupFlags = 0;
705-
pub type OptixProgramGroupFlags = ::std::os::raw::c_int;
705+
pub type OptixProgramGroupFlags = ::std::os::raw::c_uint;
706706
#[repr(C)]
707707
#[derive(Debug, Copy, Clone, PartialEq)]
708708
pub struct OptixProgramGroupSingleModule {
@@ -826,7 +826,7 @@ pub const OptixExceptionCodes_OPTIX_EXCEPTION_CODE_UNSUPPORTED_DATA_ACCESS: Opti
826826
-32;
827827
pub type OptixExceptionCodes = ::std::os::raw::c_int;
828828
pub mod OptixExceptionFlags {
829-
pub type Type = ::std::os::raw::c_int;
829+
pub type Type = ::std::os::raw::c_uint;
830830
pub const OPTIX_EXCEPTION_FLAG_NONE: Type = 0;
831831
pub const OPTIX_EXCEPTION_FLAG_STACK_OVERFLOW: Type = 1;
832832
pub const OPTIX_EXCEPTION_FLAG_TRACE_DEPTH: Type = 2;
@@ -906,7 +906,7 @@ pub struct OptixStackSizes {
906906
}
907907
pub const OptixQueryFunctionTableOptions_OPTIX_QUERY_FUNCTION_TABLE_OPTION_DUMMY:
908908
OptixQueryFunctionTableOptions = 0;
909-
pub type OptixQueryFunctionTableOptions = ::std::os::raw::c_int;
909+
pub type OptixQueryFunctionTableOptions = ::std::os::raw::c_uint;
910910
pub type OptixQueryFunctionTable_t = ::std::option::Option<
911911
unsafe extern "C" fn(
912912
abiId: ::std::os::raw::c_int,
@@ -1543,7 +1543,7 @@ pub const OptixTransformByteAlignment: usize = 64;
15431543
pub const OptixVersion: usize = 70300;
15441544
pub const OptixBuildInputSize: usize = 1032;
15451545
pub const OptixShaderBindingTableSize: usize = 64;
1546-
#[repr(i32)]
1546+
#[repr(u32)]
15471547
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15481548
pub enum OptixGeometryFlags {
15491549
None = 0,

crates/optix/src/acceleration.rs

+23-28
Original file line numberDiff line numberDiff line change
@@ -702,18 +702,13 @@ bitflags::bitflags! {
702702
/// Select which operation to perform with [`accel_build()`].
703703
#[cfg_attr(windows, repr(i32))]
704704
#[cfg_attr(unix, repr(u32))]
705-
#[derive(Debug, Copy, Clone, PartialEq)]
705+
#[derive(Debug, Copy, Clone, PartialEq, Default)]
706706
pub enum BuildOperation {
707+
#[default]
707708
Build = sys::OptixBuildOperation_OPTIX_BUILD_OPERATION_BUILD,
708709
Update = sys::OptixBuildOperation_OPTIX_BUILD_OPERATION_UPDATE,
709710
}
710711

711-
impl Default for BuildOperation {
712-
fn default() -> Self {
713-
BuildOperation::Build
714-
}
715-
}
716-
717712
/// Configure how to handle ray times that are outside of the provided motion keys.
718713
///
719714
/// By default, the object will appear static (clamped) to the nearest motion
@@ -983,7 +978,7 @@ pub struct CurveArray<'v, 'w, 'i> {
983978
primitive_index_offset: u32,
984979
}
985980

986-
impl<'v, 'w, 'i> Hash for CurveArray<'v, 'w, 'i> {
981+
impl Hash for CurveArray<'_, '_, '_> {
987982
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
988983
self.curve_type.hash(state);
989984
state.write_u32(self.num_primitives);
@@ -1088,7 +1083,7 @@ impl<'v, 'w, 'i> CurveArray<'v, 'w, 'i> {
10881083
}
10891084
}
10901085

1091-
impl<'v, 'w, 'i> BuildInput for CurveArray<'v, 'w, 'i> {
1086+
impl BuildInput for CurveArray<'_, '_, '_> {
10921087
fn to_sys(&self) -> sys::OptixBuildInput {
10931088
sys::OptixBuildInput {
10941089
type_: sys::OptixBuildInputType_OPTIX_BUILD_INPUT_TYPE_CURVES,
@@ -1139,13 +1134,13 @@ impl From<CurveType> for sys::OptixPrimitiveType {
11391134
#[repr(u32)]
11401135
#[derive(Copy, Clone, PartialEq)]
11411136
pub 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,
1137+
None = sys::OptixVertexFormat_OPTIX_VERTEX_FORMAT_NONE,
1138+
Float3 = sys::OptixVertexFormat_OPTIX_VERTEX_FORMAT_FLOAT3,
1139+
Float2 = sys::OptixVertexFormat_OPTIX_VERTEX_FORMAT_FLOAT2,
1140+
Half3 = sys::OptixVertexFormat_OPTIX_VERTEX_FORMAT_HALF3,
1141+
Half2 = sys::OptixVertexFormat_OPTIX_VERTEX_FORMAT_HALF2,
1142+
SNorm16 = sys::OptixVertexFormat_OPTIX_VERTEX_FORMAT_SNORM16_3,
1143+
SNorm32 = sys::OptixVertexFormat_OPTIX_VERTEX_FORMAT_SNORM16_2,
11491144
}
11501145

11511146
/// Specifies the type of index data
@@ -1299,15 +1294,15 @@ impl<'v, 'g, V: Vertex> TriangleArray<'v, 'g, V> {
12991294
}
13001295
}
13011296

1302-
impl<'v, 'g, V: Vertex> Hash for TriangleArray<'v, 'g, V> {
1297+
impl<V: Vertex> Hash for TriangleArray<'_, '_, V> {
13031298
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
13041299
state.write_u32(self.num_vertices);
13051300
state.write_usize(self.d_vertex_buffers.len());
13061301
self.geometry_flags.hash(state);
13071302
}
13081303
}
13091304

1310-
impl<'v, 'g, V: Vertex> BuildInput for TriangleArray<'v, 'g, V> {
1305+
impl<V: Vertex> BuildInput for TriangleArray<'_, '_, V> {
13111306
fn to_sys(&self) -> sys::OptixBuildInput {
13121307
sys::OptixBuildInput {
13131308
type_: sys::OptixBuildInputType_OPTIX_BUILD_INPUT_TYPE_TRIANGLES,
@@ -1382,7 +1377,7 @@ impl<'v, 'i, V: Vertex, I: IndexTriple> IndexedTriangleArray<'v, 'i, V, I> {
13821377
}
13831378
}
13841379

1385-
impl<'v, 'i, V: Vertex, I: IndexTriple> Hash for IndexedTriangleArray<'v, 'i, V, I> {
1380+
impl<V: Vertex, I: IndexTriple> Hash for IndexedTriangleArray<'_, '_, V, I> {
13861381
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
13871382
state.write_u32(self.num_vertices);
13881383
state.write_usize(self.d_vertex_buffers.len());
@@ -1391,7 +1386,7 @@ impl<'v, 'i, V: Vertex, I: IndexTriple> Hash for IndexedTriangleArray<'v, 'i, V,
13911386
}
13921387
}
13931388

1394-
impl<'v, 'i, V: Vertex, I: IndexTriple> BuildInput for IndexedTriangleArray<'v, 'i, V, I> {
1389+
impl<V: Vertex, I: IndexTriple> BuildInput for IndexedTriangleArray<'_, '_, V, I> {
13951390
fn to_sys(&self) -> sys::OptixBuildInput {
13961391
sys::OptixBuildInput {
13971392
type_: sys::OptixBuildInputType_OPTIX_BUILD_INPUT_TYPE_TRIANGLES,
@@ -1439,7 +1434,7 @@ pub struct CustomPrimitiveArray<'a, 's> {
14391434
primitive_index_offset: u32,
14401435
}
14411436

1442-
impl<'a, 'g, 's> Hash for CustomPrimitiveArray<'a, 's> {
1437+
impl<'g> Hash for CustomPrimitiveArray<'_, '_> {
14431438
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
14441439
state.write_usize(self.aabb_buffers.len());
14451440
state.write_u32(self.num_primitives);
@@ -1509,7 +1504,7 @@ impl<'a, 's> CustomPrimitiveArray<'a, 's> {
15091504
}
15101505
}
15111506

1512-
impl<'a, 's> BuildInput for CustomPrimitiveArray<'a, 's> {
1507+
impl BuildInput for CustomPrimitiveArray<'_, '_> {
15131508
fn to_sys(&self) -> sys::OptixBuildInput {
15141509
sys::OptixBuildInput {
15151510
type_: sys::OptixBuildInputType_OPTIX_BUILD_INPUT_TYPE_CUSTOM_PRIMITIVES,
@@ -1646,13 +1641,13 @@ impl<'i, 'a> InstanceArray<'i, 'a> {
16461641
}
16471642
}
16481643

1649-
impl<'i, 'a> Hash for InstanceArray<'i, 'a> {
1644+
impl Hash for InstanceArray<'_, '_> {
16501645
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
16511646
state.write_usize(self.instances.len());
16521647
}
16531648
}
16541649

1655-
impl<'i, 'a> BuildInput for InstanceArray<'i, 'a> {
1650+
impl BuildInput for InstanceArray<'_, '_> {
16561651
fn to_sys(&self) -> sys::OptixBuildInput {
16571652
cfg_if::cfg_if! {
16581653
if #[cfg(any(feature="optix72", feature="optix73"))] {
@@ -1692,13 +1687,13 @@ impl<'i> InstancePointerArray<'i> {
16921687
}
16931688
}
16941689

1695-
impl<'i> Hash for InstancePointerArray<'i> {
1690+
impl Hash for InstancePointerArray<'_> {
16961691
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
16971692
state.write_usize(self.instances.len());
16981693
}
16991694
}
17001695

1701-
impl<'i> BuildInput for InstancePointerArray<'i> {
1696+
impl BuildInput for InstancePointerArray<'_> {
17021697
fn to_sys(&self) -> sys::OptixBuildInput {
17031698
cfg_if::cfg_if! {
17041699
if #[cfg(any(feature="optix72", feature="optix73"))] {
@@ -1865,7 +1860,7 @@ impl MatrixMotionTransform {
18651860
cust::memory::memcpy_htod(
18661861
transform_ptr.as_raw(),
18671862
transforms.as_ptr() as *const c_void,
1868-
std::mem::size_of::<RowMatrix3x4<f32>>() * num_keys,
1863+
std::mem::size_of_val(transforms),
18691864
)?;
18701865

18711866
let hnd = convert_pointer_to_traversable_handle(
@@ -2014,7 +2009,7 @@ impl SrtMotionTransform {
20142009
cust::memory::memcpy_htod(
20152010
transform_ptr.as_raw(),
20162011
srt_data.as_ptr() as *const c_void,
2017-
std::mem::size_of::<SrtData>() * num_keys,
2012+
std::mem::size_of_val(srt_data),
20182013
)?;
20192014

20202015
let hnd = convert_pointer_to_traversable_handle(

crates/optix/src/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl DeviceContext {
107107
Ok(optix_call!(optixDeviceContextGetCacheDatabaseSizes(
108108
self.raw, &mut low, &mut high,
109109
))
110-
.map(|_| (low as usize, high as usize))?)
110+
.map(|_| (low, high))?)
111111
}
112112
}
113113

0 commit comments

Comments
 (0)