Skip to content

Commit 7e7007d

Browse files
committed
Should all be working now
1 parent e8ddcf5 commit 7e7007d

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

crates/optix/src/acceleration.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ bitflags::bitflags! {
688688
/// an AH programs on the device. May affect the performance of the accel (seems to be larger).
689689
///
690690
/// Note that `PREFER_FAST_TRACE` and `PREFER_FAST_BUILD` are mutually exclusive.
691-
#[derive(Default)]
691+
#[derive(Default, Clone, Copy, Debug, PartialEq)]
692692
pub struct BuildFlags: OptixEnumBaseType {
693693
const NONE = sys::OptixBuildFlags_OPTIX_BUILD_FLAG_NONE;
694694
const ALLOW_UPDATE = sys::OptixBuildFlags_OPTIX_BUILD_FLAG_ALLOW_UPDATE;
@@ -714,6 +714,9 @@ impl Default for BuildOperation {
714714
}
715715
}
716716

717+
#[derive(DeviceCopy, Clone, Copy, Debug, PartialEq)]
718+
pub struct MotionFlags(u16);
719+
717720
bitflags::bitflags! {
718721
/// Configure how to handle ray times that are outside of the provided motion keys.
719722
///
@@ -724,8 +727,7 @@ bitflags::bitflags! {
724727
/// than the first provided motion key
725728
/// * `END_VANISH` - The object will be invisible to rays with a time less
726729
/// than the first provided motion key
727-
#[derive(DeviceCopy)]
728-
pub struct MotionFlags: u16 {
730+
impl MotionFlags: u16 {
729731
const NONE = sys::OptixMotionFlags_OPTIX_MOTION_FLAG_NONE as u16;
730732
const START_VANISH = sys::OptixMotionFlags_OPTIX_MOTION_FLAG_START_VANISH as u16;
731733
const END_VANISH = sys::OptixMotionFlags_OPTIX_MOTION_FLAG_END_VANISH as u16;
@@ -1558,9 +1560,12 @@ const_assert_eq!(
15581560
std::mem::size_of::<sys::OptixInstance>()
15591561
);
15601562

1563+
1564+
#[derive(DeviceCopy, Clone, Copy, Debug)]
1565+
pub struct InstanceFlags(OptixEnumBaseType);
1566+
15611567
bitflags::bitflags! {
1562-
#[derive(DeviceCopy)]
1563-
pub struct InstanceFlags: OptixEnumBaseType {
1568+
impl InstanceFlags: OptixEnumBaseType {
15641569
const NONE = sys::OptixInstanceFlags_OPTIX_INSTANCE_FLAG_NONE;
15651570
const DISABLE_TRIANGLE_FACE_CULLING = sys::OptixInstanceFlags_OPTIX_INSTANCE_FLAG_DISABLE_TRIANGLE_FACE_CULLING;
15661571
const FLIP_TRIANGLE_FACING = sys::OptixInstanceFlags_OPTIX_INSTANCE_FLAG_FLIP_TRIANGLE_FACING;
@@ -1684,7 +1689,7 @@ pub struct InstancePointerArray<'i> {
16841689
}
16851690

16861691
impl<'i> InstancePointerArray<'i> {
1687-
pub fn new(instances: &'i DeviceSlice<CUdeviceptr>) -> InstancePointerArray {
1692+
pub fn new(instances: &'i DeviceSlice<CUdeviceptr>) -> InstancePointerArray<'i> {
16881693
InstancePointerArray { instances }
16891694
}
16901695
}

crates/optix/src/pipeline.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ cfg_if::cfg_if! {
208208
}
209209

210210
bitflags::bitflags! {
211-
#[derive(Default)]
211+
#[derive(Default, Clone, Copy, Debug, PartialEq, Hash)]
212212
pub struct TraversableGraphFlags: OptixEnumBaseType {
213213
const ALLOW_ANY = sys::OptixTraversableGraphFlags::OPTIX_TRAVERSABLE_GRAPH_FLAG_ALLOW_ANY;
214214
const ALLOW_SINGLE_GAS = sys::OptixTraversableGraphFlags::OPTIX_TRAVERSABLE_GRAPH_FLAG_ALLOW_SINGLE_GAS;
@@ -217,7 +217,7 @@ bitflags::bitflags! {
217217
}
218218

219219
bitflags::bitflags! {
220-
#[derive(Default)]
220+
#[derive(Default, Clone, Copy, Debug, PartialEq, Hash)]
221221
pub struct ExceptionFlags: OptixEnumBaseType {
222222
const NONE = sys::OptixExceptionFlags::OPTIX_EXCEPTION_FLAG_NONE;
223223
const STACK_OVERFLOW = sys::OptixExceptionFlags::OPTIX_EXCEPTION_FLAG_STACK_OVERFLOW;
@@ -228,7 +228,7 @@ bitflags::bitflags! {
228228
}
229229

230230
bitflags::bitflags! {
231-
#[derive(Default)]
231+
#[derive(Default, Clone, Copy, Debug, PartialEq, Hash)]
232232
pub struct PrimitiveTypeFlags: i32 {
233233
const DEFAULT = 0;
234234
const CUSTOM = sys::OptixPrimitiveTypeFlags_OPTIX_PRIMITIVE_TYPE_FLAGS_CUSTOM;

0 commit comments

Comments
 (0)