Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions crates/optix/src/acceleration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ bitflags::bitflags! {
/// an AH programs on the device. May affect the performance of the accel (seems to be larger).
///
/// Note that `PREFER_FAST_TRACE` and `PREFER_FAST_BUILD` are mutually exclusive.
#[derive(Default)]
#[derive(Default, Clone, Copy, Debug, PartialEq)]
pub struct BuildFlags: OptixEnumBaseType {
const NONE = sys::OptixBuildFlags_OPTIX_BUILD_FLAG_NONE;
const ALLOW_UPDATE = sys::OptixBuildFlags_OPTIX_BUILD_FLAG_ALLOW_UPDATE;
Expand All @@ -714,6 +714,9 @@ impl Default for BuildOperation {
}
}

#[derive(DeviceCopy, Clone, Copy, Debug, PartialEq)]
pub struct MotionFlags(u16);

bitflags::bitflags! {
/// Configure how to handle ray times that are outside of the provided motion keys.
///
Expand All @@ -724,8 +727,7 @@ bitflags::bitflags! {
/// than the first provided motion key
/// * `END_VANISH` - The object will be invisible to rays with a time less
/// than the first provided motion key
#[derive(DeviceCopy)]
pub struct MotionFlags: u16 {
impl MotionFlags: u16 {
const NONE = sys::OptixMotionFlags_OPTIX_MOTION_FLAG_NONE as u16;
const START_VANISH = sys::OptixMotionFlags_OPTIX_MOTION_FLAG_START_VANISH as u16;
const END_VANISH = sys::OptixMotionFlags_OPTIX_MOTION_FLAG_END_VANISH as u16;
Expand Down Expand Up @@ -1558,9 +1560,11 @@ const_assert_eq!(
std::mem::size_of::<sys::OptixInstance>()
);

#[derive(DeviceCopy, Clone, Copy, Debug)]
pub struct InstanceFlags(OptixEnumBaseType);

bitflags::bitflags! {
#[derive(DeviceCopy)]
pub struct InstanceFlags: OptixEnumBaseType {
impl InstanceFlags: OptixEnumBaseType {
const NONE = sys::OptixInstanceFlags_OPTIX_INSTANCE_FLAG_NONE;
const DISABLE_TRIANGLE_FACE_CULLING = sys::OptixInstanceFlags_OPTIX_INSTANCE_FLAG_DISABLE_TRIANGLE_FACE_CULLING;
const FLIP_TRIANGLE_FACING = sys::OptixInstanceFlags_OPTIX_INSTANCE_FLAG_FLIP_TRIANGLE_FACING;
Expand Down Expand Up @@ -1684,7 +1688,7 @@ pub struct InstancePointerArray<'i> {
}

impl<'i> InstancePointerArray<'i> {
pub fn new(instances: &'i DeviceSlice<CUdeviceptr>) -> InstancePointerArray {
pub fn new(instances: &'i DeviceSlice<CUdeviceptr>) -> InstancePointerArray<'i> {
InstancePointerArray { instances }
}
}
Expand Down
6 changes: 3 additions & 3 deletions crates/optix/src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ cfg_if::cfg_if! {
}

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

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

bitflags::bitflags! {
#[derive(Default)]
#[derive(Default, Clone, Copy, Debug, PartialEq, Hash)]
pub struct PrimitiveTypeFlags: i32 {
const DEFAULT = 0;
const CUSTOM = sys::OptixPrimitiveTypeFlags_OPTIX_PRIMITIVE_TYPE_FLAGS_CUSTOM;
Expand Down
Loading