Debian Codegraph @

third_party/rust/metal/src/acceleration_structure_pass.rs

raw
1 use super::{CounterSampleBufferRef, NSUInteger};
2
3 /// See <https://developer.apple.com/documentation/metal/mtlaccelerationstructurepassdescriptor>
4 pub enum MTLAccelerationStructurePassDescriptor {}
5
6 foreign_obj_type! {
7 type CType = MTLAccelerationStructurePassDescriptor;
8 pub struct AccelerationStructurePassDescriptor;
9 }
10
11 impl AccelerationStructurePassDescriptor {
12 /// Creates a default compute pass descriptor with no attachments.
13 pub fn new<'a>() -> &'a AccelerationStructurePassDescriptorRef {
14 unsafe {
15 msg_send![
16 class!(MTLAccelerationStructurePassDescriptor),
17 accelerationStructurePassDescriptor
18 ]
19 }
20 }
21 }
22
23 impl AccelerationStructurePassDescriptorRef {
24 pub fn sample_buffer_attachments(
25 &self,
26 ) -> &AccelerationStructurePassSampleBufferAttachmentDescriptorArrayRef {
27 unsafe { msg_send![self, sampleBufferAttachments] }
28 }
29 }
30
31 /// See <https://developer.apple.com/documentation/metal/mtlaccelerationstructurepasssamplebufferattachmentdescriptorarray>
32 pub enum MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray {}
33
34 foreign_obj_type! {
35 type CType = MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray;
36 pub struct AccelerationStructurePassSampleBufferAttachmentDescriptorArray;
37 }
38
39 impl AccelerationStructurePassSampleBufferAttachmentDescriptorArrayRef {
40 pub fn object_at(
41 &self,
42 index: NSUInteger,
43 ) -> Option<&AccelerationStructurePassSampleBufferAttachmentDescriptorRef> {
44 unsafe { msg_send![self, objectAtIndexedSubscript: index] }
45 }
46
47 pub fn set_object_at(
48 &self,
49 index: NSUInteger,
50 attachment: Option<&AccelerationStructurePassSampleBufferAttachmentDescriptorRef>,
51 ) {
52 unsafe {
53 msg_send![self, setObject:attachment
54 atIndexedSubscript:index]
55 }
56 }
57 }
58
59 /// See <https://developer.apple.com/documentation/metal/mtlaccelerationstructurepasssamplebufferattachmentdescriptor>
60 pub enum MTLAccelerationStructurePassSampleBufferAttachmentDescriptor {}
61
62 foreign_obj_type! {
63 type CType = MTLAccelerationStructurePassSampleBufferAttachmentDescriptor;
64 pub struct AccelerationStructurePassSampleBufferAttachmentDescriptor;
65 }
66
67 impl AccelerationStructurePassSampleBufferAttachmentDescriptor {
68 pub fn new() -> Self {
69 let class = class!(MTLAccelerationStructurePassSampleBufferAttachmentDescriptor);
70 unsafe { msg_send![class, new] }
71 }
72 }
73
74 impl AccelerationStructurePassSampleBufferAttachmentDescriptorRef {
75 pub fn sample_buffer(&self) -> Option<&CounterSampleBufferRef> {
76 unsafe { msg_send![self, sampleBuffer] }
77 }
78
79 pub fn set_sample_buffer(&self, sample_buffer: &CounterSampleBufferRef) {
80 unsafe { msg_send![self, setSampleBuffer: sample_buffer] }
81 }
82
83 pub fn start_of_encoder_sample_index(&self) -> NSUInteger {
84 unsafe { msg_send![self, startOfEncoderSampleIndex] }
85 }
86
87 pub fn set_start_of_encoder_sample_index(&self, start_of_encoder_sample_index: NSUInteger) {
88 unsafe {
89 msg_send![
90 self,
91 setStartOfEncoderSampleIndex: start_of_encoder_sample_index
92 ]
93 }
94 }
95
96 pub fn end_of_encoder_sample_index(&self) -> NSUInteger {
97 unsafe { msg_send![self, endOfEncoderSampleIndex] }
98 }
99
100 pub fn set_end_of_encoder_sample_index(&self, end_of_encoder_sample_index: NSUInteger) {
101 unsafe {
102 msg_send![
103 self,
104 setEndOfEncoderSampleIndex: end_of_encoder_sample_index
105 ]
106 }
107 }
108 }