Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
21 changes: 21 additions & 0 deletions src/acceleration_structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@

use super::*;

bitflags::bitflags! {
#[derive(Copy, Clone, Debug, Default, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MTLAccelerationStructureUsage: usize {
const None = 0;
const Refit = (1 << 0);
const PreferFastBuild = (1 << 1);
const ExtendedLimits = (1 << 2);
}
}

bitflags::bitflags! {
#[derive(Copy, Clone, Debug, Default, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MTLAccelerationStructureInstanceOptions: u32 {
Expand Down Expand Up @@ -69,6 +79,12 @@ foreign_obj_type! {
type ParentType = NsObject;
}

impl AccelerationStructureDescriptorRef {
pub fn set_usage(&self, usage: MTLAccelerationStructureUsage) {
unsafe { msg_send![self, setUsage: usage] }
}
}

pub enum MTLPrimitiveAccelerationStructureDescriptor {}

foreign_obj_type! {
Expand Down Expand Up @@ -123,6 +139,11 @@ impl AccelerationStructureGeometryDescriptorRef {
pub fn set_opaque(&self, opaque: bool) {
unsafe { msg_send![self, setOpaque: opaque] }
}

pub fn set_allow_duplicate_intersection_function_invocation(&self, allow: bool) {
unsafe { msg_send![self, setAllowDuplicateIntersectionFunctionInvocation: allow] }
}

pub fn set_primitive_data_buffer(&self, buffer: Option<&BufferRef>) {
unsafe { msg_send![self, setPrimitiveDataBuffer: buffer] }
}
Expand Down
5 changes: 5 additions & 0 deletions src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,11 @@ impl DeviceRef {
unsafe { msg_send_bool![self, supportsRaytracing] }
}

/// Only available on (macos(12.0), ios(15.0))
pub fn supports_raytracing_from_render(&self) -> bool {
unsafe { msg_send_bool![self, supportsRaytracingFromRender] }
}

pub fn has_unified_memory(&self) -> bool {
unsafe { msg_send![self, hasUnifiedMemory] }
}
Expand Down