objc2_metal/generated/
MTLCommandQueue.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11 pub unsafe trait MTLCommandQueue: NSObjectProtocol + Send + Sync {
15 #[unsafe(method(label))]
17 #[unsafe(method_family = none)]
18 fn label(&self) -> Option<Retained<NSString>>;
19
20 #[unsafe(method(setLabel:))]
24 #[unsafe(method_family = none)]
25 fn setLabel(&self, label: Option<&NSString>);
26
27 #[cfg(feature = "MTLDevice")]
28 #[unsafe(method(device))]
30 #[unsafe(method_family = none)]
31 fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>;
32
33 #[cfg(feature = "MTLCommandBuffer")]
34 #[unsafe(method(commandBuffer))]
37 #[unsafe(method_family = none)]
38 fn commandBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLCommandBuffer>>>;
39
40 #[cfg(feature = "MTLCommandBuffer")]
41 #[unsafe(method(commandBufferWithDescriptor:))]
45 #[unsafe(method_family = none)]
46 fn commandBufferWithDescriptor(
47 &self,
48 descriptor: &MTLCommandBufferDescriptor,
49 ) -> Option<Retained<ProtocolObject<dyn MTLCommandBuffer>>>;
50
51 #[cfg(feature = "MTLCommandBuffer")]
52 #[unsafe(method(commandBufferWithUnretainedReferences))]
55 #[unsafe(method_family = none)]
56 fn commandBufferWithUnretainedReferences(
57 &self,
58 ) -> Option<Retained<ProtocolObject<dyn MTLCommandBuffer>>>;
59
60 #[deprecated = "Use MTLCaptureScope instead"]
62 #[unsafe(method(insertDebugCaptureBoundary))]
63 #[unsafe(method_family = none)]
64 fn insertDebugCaptureBoundary(&self);
65
66 #[cfg(feature = "MTLResidencySet")]
67 #[unsafe(method(addResidencySet:))]
69 #[unsafe(method_family = none)]
70 fn addResidencySet(&self, residency_set: &ProtocolObject<dyn MTLResidencySet>);
71
72 #[cfg(feature = "MTLResidencySet")]
73 #[unsafe(method(addResidencySets:count:))]
80 #[unsafe(method_family = none)]
81 unsafe fn addResidencySets_count(
82 &self,
83 residency_sets: NonNull<NonNull<ProtocolObject<dyn MTLResidencySet>>>,
84 count: NSUInteger,
85 );
86
87 #[cfg(feature = "MTLResidencySet")]
88 #[unsafe(method(removeResidencySet:))]
90 #[unsafe(method_family = none)]
91 fn removeResidencySet(&self, residency_set: &ProtocolObject<dyn MTLResidencySet>);
92
93 #[cfg(feature = "MTLResidencySet")]
94 #[unsafe(method(removeResidencySets:count:))]
101 #[unsafe(method_family = none)]
102 unsafe fn removeResidencySets_count(
103 &self,
104 residency_sets: NonNull<NonNull<ProtocolObject<dyn MTLResidencySet>>>,
105 count: NSUInteger,
106 );
107 }
108);
109
110extern_class!(
111 #[unsafe(super(NSObject))]
113 #[derive(Debug, PartialEq, Eq, Hash)]
114 pub struct MTLCommandQueueDescriptor;
115);
116
117extern_conformance!(
118 unsafe impl NSCopying for MTLCommandQueueDescriptor {}
119);
120
121unsafe impl CopyingHelper for MTLCommandQueueDescriptor {
122 type Result = Self;
123}
124
125extern_conformance!(
126 unsafe impl NSObjectProtocol for MTLCommandQueueDescriptor {}
127);
128
129impl MTLCommandQueueDescriptor {
130 extern_methods!(
131 #[unsafe(method(maxCommandBufferCount))]
134 #[unsafe(method_family = none)]
135 pub fn maxCommandBufferCount(&self) -> NSUInteger;
136
137 #[unsafe(method(setMaxCommandBufferCount:))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn setMaxCommandBufferCount(&self, max_command_buffer_count: NSUInteger);
145
146 #[cfg(feature = "MTLLogState")]
147 #[unsafe(method(logState))]
150 #[unsafe(method_family = none)]
151 pub fn logState(&self) -> Option<Retained<ProtocolObject<dyn MTLLogState>>>;
152
153 #[cfg(feature = "MTLLogState")]
154 #[unsafe(method(setLogState:))]
156 #[unsafe(method_family = none)]
157 pub fn setLogState(&self, log_state: Option<&ProtocolObject<dyn MTLLogState>>);
158 );
159}
160
161impl MTLCommandQueueDescriptor {
163 extern_methods!(
164 #[unsafe(method(init))]
165 #[unsafe(method_family = init)]
166 pub fn init(this: Allocated<Self>) -> Retained<Self>;
167
168 #[unsafe(method(new))]
169 #[unsafe(method_family = new)]
170 pub fn new() -> Retained<Self>;
171 );
172}
173
174impl DefaultRetained for MTLCommandQueueDescriptor {
175 #[inline]
176 fn default_retained() -> Retained<Self> {
177 Self::new()
178 }
179}