Debian Codegraph @

third_party/rust/metal/src/blitpass.rs

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