objc2_metal/generated/MTLAccelerationStructureCommandEncoder.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11 /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructurecommandencoder?language=objc)
12 #[cfg(feature = "MTLCommandEncoder")]
13 pub unsafe trait MTLAccelerationStructureCommandEncoder: MTLCommandEncoder {
14 #[cfg(all(
15 feature = "MTLAccelerationStructure",
16 feature = "MTLAllocation",
17 feature = "MTLBuffer",
18 feature = "MTLResource"
19 ))]
20 /// Encode an acceleration structure build into the command buffer. All bottom-level acceleration
21 /// structure builds must have completed before a top-level acceleration structure build may begin. The
22 /// resulting acceleration structure will not retain any references to the input vertex buffer, instance buffer, etc.
23 ///
24 /// The acceleration structure build will not be completed until the command buffer has been committed
25 /// and finished executing. However, it is safe to encode ray tracing work against the acceleration
26 /// structure as long as the command buffers are scheduled and synchronized such that the command buffer
27 /// will have completed by the time the ray tracing starts.
28 ///
29 /// The acceleration structure and scratch buffer must be at least the size returned by the
30 /// [MTLDevice accelerationStructureSizesWithDescriptor:] query.
31 ///
32 ///
33 /// Parameter `accelerationStructure`: Acceleration structure storage to build into
34 ///
35 /// Parameter `descriptor`: Object describing the acceleration structure to build
36 ///
37 /// Parameter `scratchBuffer`: Scratch buffer to use while building the acceleration structure. The
38 /// contents may be overwritten and are undefined after the build has
39 /// started/completed.
40 ///
41 /// Parameter `scratchBufferOffset`: Offset into the scratch buffer
42 #[unsafe(method(buildAccelerationStructure:descriptor:scratchBuffer:scratchBufferOffset:))]
43 #[unsafe(method_family = none)]
44 fn buildAccelerationStructure_descriptor_scratchBuffer_scratchBufferOffset(
45 &self,
46 acceleration_structure: &ProtocolObject<dyn MTLAccelerationStructure>,
47 descriptor: &MTLAccelerationStructureDescriptor,
48 scratch_buffer: &ProtocolObject<dyn MTLBuffer>,
49 scratch_buffer_offset: NSUInteger,
50 );
51
52 #[cfg(all(
53 feature = "MTLAccelerationStructure",
54 feature = "MTLAllocation",
55 feature = "MTLBuffer",
56 feature = "MTLResource"
57 ))]
58 /// Encode an acceleration structure refit into the command buffer. Refitting can be used to
59 /// update the acceleration structure when geometry changes and is much faster than rebuilding from
60 /// scratch. However, the quality of the acceleration structure and the subsequent ray tracing
61 /// performance will degrade depending on how much the geometry changes.
62 ///
63 /// Refitting can not be used after certain changes, such as adding or removing geometry. Acceleration
64 /// structures can be refit in place by specifying the same source and destination acceleration structures
65 /// or by providing a nil destination acceleration structure. If the source and destination acceleration
66 /// structures are not the same, they must not overlap in memory.
67 ///
68 /// The destination acceleration structure must be at least as large as the source acceleration structure,
69 /// unless the source acceleration structure has been compacted, in which case the destination acceleration
70 /// structure must be at least as large as the compacted size of the source acceleration structure.
71 ///
72 /// The scratch buffer must be at least the size returned by the accelerationStructureSizesWithDescriptor
73 /// method of the MTLDevice.
74 ///
75 ///
76 /// Parameter `descriptor`: Object describing the acceleration structure to build
77 ///
78 /// Parameter `sourceAccelerationStructure`: Acceleration structure to copy from
79 ///
80 /// Parameter `destinationAccelerationStructure`: Acceleration structure to copy to
81 ///
82 /// Parameter `scratchBuffer`: Scratch buffer to use while refitting the acceleration
83 /// structure. The contents may be overwritten and are undefined
84 /// after the refit has started/completed.
85 ///
86 /// Parameter `scratchBufferOffset`: Offset into the scratch buffer.
87 ///
88 /// # Safety
89 ///
90 /// - `source_acceleration_structure` may need to be synchronized.
91 /// - `source_acceleration_structure` may be unretained, you must ensure it is kept alive while in use.
92 /// - `destination_acceleration_structure` may need to be synchronized.
93 /// - `destination_acceleration_structure` may be unretained, you must ensure it is kept alive while in use.
94 /// - `scratch_buffer` may need to be synchronized.
95 /// - `scratch_buffer` may be unretained, you must ensure it is kept alive while in use.
96 /// - `scratch_buffer` contents should be of the correct type.
97 /// - `scratchBufferOffset` might not be bounds-checked.
98 #[unsafe(method(refitAccelerationStructure:descriptor:destination:scratchBuffer:scratchBufferOffset:))]
99 #[unsafe(method_family = none)]
100 unsafe fn refitAccelerationStructure_descriptor_destination_scratchBuffer_scratchBufferOffset(
101 &self,
102 source_acceleration_structure: &ProtocolObject<dyn MTLAccelerationStructure>,
103 descriptor: &MTLAccelerationStructureDescriptor,
104 destination_acceleration_structure: Option<
105 &ProtocolObject<dyn MTLAccelerationStructure>,
106 >,
107 scratch_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
108 scratch_buffer_offset: NSUInteger,
109 );
110
111 #[cfg(all(
112 feature = "MTLAccelerationStructure",
113 feature = "MTLAllocation",
114 feature = "MTLBuffer",
115 feature = "MTLResource"
116 ))]
117 /// Encode an acceleration structure refit into the command buffer. Refitting can be used to
118 /// update the acceleration structure when geometry changes and is much faster than rebuilding from
119 /// scratch. However, the quality of the acceleration structure and the subsequent ray tracing
120 /// performance will degrade depending on how much the geometry changes.
121 ///
122 /// Refitting can not be used after certain changes, such as adding or removing geometry. Acceleration
123 /// structures can be refit in place by specifying the same source and destination acceleration structures
124 /// or by providing a nil destination acceleration structure. If the source and destination acceleration
125 /// structures are not the same, they must not overlap in memory.
126 ///
127 /// The destination acceleration structure must be at least as large as the source acceleration structure,
128 /// unless the source acceleration structure has been compacted, in which case the destination acceleration
129 /// structure must be at least as large as the compacted size of the source acceleration structure.
130 ///
131 /// The scratch buffer must be at least the size returned by the accelerationStructureSizesWithDescriptor
132 /// method of the MTLDevice.
133 ///
134 ///
135 /// Parameter `descriptor`: Object describing the acceleration structure to build
136 ///
137 /// Parameter `sourceAccelerationStructure`: Acceleration structure to copy from
138 ///
139 /// Parameter `destinationAccelerationStructure`: Acceleration structure to copy to
140 ///
141 /// Parameter `scratchBuffer`: Scratch buffer to use while refitting the acceleration
142 /// structure. The contents may be overwritten and are undefined
143 /// after the refit has started/completed.
144 ///
145 /// Parameter `scratchBufferOffset`: Offset into the scratch buffer.
146 ///
147 /// Parameter `options`: Options specifying the elements of the acceleration structure to refit.
148 ///
149 /// # Safety
150 ///
151 /// - `source_acceleration_structure` may need to be synchronized.
152 /// - `source_acceleration_structure` may be unretained, you must ensure it is kept alive while in use.
153 /// - `destination_acceleration_structure` may need to be synchronized.
154 /// - `destination_acceleration_structure` may be unretained, you must ensure it is kept alive while in use.
155 /// - `scratch_buffer` may need to be synchronized.
156 /// - `scratch_buffer` may be unretained, you must ensure it is kept alive while in use.
157 /// - `scratch_buffer` contents should be of the correct type.
158 /// - `scratchBufferOffset` might not be bounds-checked.
159 #[unsafe(method(refitAccelerationStructure:descriptor:destination:scratchBuffer:scratchBufferOffset:options:))]
160 #[unsafe(method_family = none)]
161 unsafe fn refitAccelerationStructure_descriptor_destination_scratchBuffer_scratchBufferOffset_options(
162 &self,
163 source_acceleration_structure: &ProtocolObject<dyn MTLAccelerationStructure>,
164 descriptor: &MTLAccelerationStructureDescriptor,
165 destination_acceleration_structure: Option<
166 &ProtocolObject<dyn MTLAccelerationStructure>,
167 >,
168 scratch_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
169 scratch_buffer_offset: NSUInteger,
170 options: MTLAccelerationStructureRefitOptions,
171 );
172
173 #[cfg(all(
174 feature = "MTLAccelerationStructure",
175 feature = "MTLAllocation",
176 feature = "MTLResource"
177 ))]
178 /// Copy an acceleration structure. The source and destination acceleration structures must not
179 /// overlap in memory. If this is a top level acceleration structure, references to bottom level
180 /// acceleration structures will be preserved.
181 ///
182 /// The destination acceleration structure must be at least as large as the source acceleration structure,
183 /// unless the source acceleration structure has been compacted, in which case the destination acceleration
184 /// structure must be at least as large as the compacted size of the source acceleration structure.
185 ///
186 ///
187 /// Parameter `sourceAccelerationStructure`: Acceleration structure to copy from
188 ///
189 /// Parameter `destinationAccelerationStructure`: Acceleration structure to copy to
190 ///
191 /// # Safety
192 ///
193 /// - `source_acceleration_structure` may need to be synchronized.
194 /// - `source_acceleration_structure` may be unretained, you must ensure it is kept alive while in use.
195 /// - `destination_acceleration_structure` may need to be synchronized.
196 /// - `destination_acceleration_structure` may be unretained, you must ensure it is kept alive while in use.
197 #[unsafe(method(copyAccelerationStructure:toAccelerationStructure:))]
198 #[unsafe(method_family = none)]
199 unsafe fn copyAccelerationStructure_toAccelerationStructure(
200 &self,
201 source_acceleration_structure: &ProtocolObject<dyn MTLAccelerationStructure>,
202 destination_acceleration_structure: &ProtocolObject<dyn MTLAccelerationStructure>,
203 );
204
205 #[cfg(all(
206 feature = "MTLAccelerationStructure",
207 feature = "MTLAllocation",
208 feature = "MTLBuffer",
209 feature = "MTLResource"
210 ))]
211 /// Compute the compacted size for an acceleration structure and write it into a buffer.
212 ///
213 /// This size is potentially smaller than the source acceleration structure. To perform compaction,
214 /// read this size from the buffer once the command buffer has completed and use it to allocate a
215 /// smaller acceleration structure. Then create another encoder and call the
216 /// copyAndCompactAccelerationStructure method.
217 ///
218 ///
219 /// Parameter `accelerationStructure`: Source acceleration structure
220 ///
221 /// Parameter `buffer`: Destination size buffer. The compacted size will be written as a 32 bit
222 /// unsigned integer representing the compacted size in bytes.
223 ///
224 /// Parameter `offset`: Offset into the size buffer
225 #[unsafe(method(writeCompactedAccelerationStructureSize:toBuffer:offset:))]
226 #[unsafe(method_family = none)]
227 fn writeCompactedAccelerationStructureSize_toBuffer_offset(
228 &self,
229 acceleration_structure: &ProtocolObject<dyn MTLAccelerationStructure>,
230 buffer: &ProtocolObject<dyn MTLBuffer>,
231 offset: NSUInteger,
232 );
233
234 #[cfg(all(
235 feature = "MTLAccelerationStructure",
236 feature = "MTLAllocation",
237 feature = "MTLBuffer",
238 feature = "MTLDataType",
239 feature = "MTLResource"
240 ))]
241 /// Compute the compacted size for an acceleration structure and write it into a buffer.
242 ///
243 /// This size is potentially smaller than the source acceleration structure. To perform compaction,
244 /// read this size from the buffer once the command buffer has completed and use it to allocate a
245 /// smaller acceleration structure. Then create another encoder and call the
246 /// copyAndCompactAccelerationStructure method.
247 ///
248 ///
249 /// Parameter `accelerationStructure`: Source acceleration structure
250 ///
251 /// Parameter `buffer`: Destination size buffer. The compacted size will be written as either
252 /// a 32 bit or 64 bit value depending on the sizeDataType argument
253 /// unsigned integer representing the compacted size in bytes.
254 ///
255 /// Parameter `offset`: Offset into the size buffer
256 ///
257 /// Parameter `sizeDataType`: Data type of the size to write into the buffer. Must be either
258 /// MTLDataTypeUInt (32 bit) or MTLDataTypeULong (64 bit)
259 ///
260 /// # Safety
261 ///
262 /// - `acceleration_structure` may need to be synchronized.
263 /// - `acceleration_structure` may be unretained, you must ensure it is kept alive while in use.
264 /// - `buffer` may need to be synchronized.
265 /// - `buffer` may be unretained, you must ensure it is kept alive while in use.
266 /// - `buffer` contents should be of the correct type.
267 /// - `offset` might not be bounds-checked.
268 #[unsafe(method(writeCompactedAccelerationStructureSize:toBuffer:offset:sizeDataType:))]
269 #[unsafe(method_family = none)]
270 unsafe fn writeCompactedAccelerationStructureSize_toBuffer_offset_sizeDataType(
271 &self,
272 acceleration_structure: &ProtocolObject<dyn MTLAccelerationStructure>,
273 buffer: &ProtocolObject<dyn MTLBuffer>,
274 offset: NSUInteger,
275 size_data_type: MTLDataType,
276 );
277
278 #[cfg(all(
279 feature = "MTLAccelerationStructure",
280 feature = "MTLAllocation",
281 feature = "MTLResource"
282 ))]
283 /// Copy and compact an acceleration structure. The source and destination acceleration structures
284 /// must not overlap in memory. If this is a top level acceleration structure, references to bottom level
285 /// acceleration structures will be preserved.
286 ///
287 /// The destination acceleration structure must be at least as large as the compacted size of the source
288 /// acceleration structure, which is computed by the writeCompactedAccelerationStructureSize method.
289 ///
290 ///
291 /// Parameter `sourceAccelerationStructure`: Acceleration structure to copy and compact
292 ///
293 /// Parameter `destinationAccelerationStructure`: Acceleration structure to copy to
294 #[unsafe(method(copyAndCompactAccelerationStructure:toAccelerationStructure:))]
295 #[unsafe(method_family = none)]
296 fn copyAndCompactAccelerationStructure_toAccelerationStructure(
297 &self,
298 source_acceleration_structure: &ProtocolObject<dyn MTLAccelerationStructure>,
299 destination_acceleration_structure: &ProtocolObject<dyn MTLAccelerationStructure>,
300 );
301
302 #[cfg(feature = "MTLFence")]
303 /// Update the fence to capture all GPU work so far enqueued by this encoder.
304 ///
305 /// The fence is updated at build submission to maintain global order and prevent deadlock.
306 /// Drivers may delay fence updates until the end of the encoder. Drivers may also wait on fences at the beginning of an encoder. It is therefore illegal to wait on a fence after it has been updated in the same encoder.
307 #[unsafe(method(updateFence:))]
308 #[unsafe(method_family = none)]
309 fn updateFence(&self, fence: &ProtocolObject<dyn MTLFence>);
310
311 #[cfg(feature = "MTLFence")]
312 /// Prevent further GPU work until the fence is reached.
313 ///
314 /// The fence is evaluated at build submission to maintain global order and prevent deadlock.
315 /// Drivers may delay fence updates until the end of the encoder. Drivers may also wait on fences at the beginning of an encoder. It is therefore illegal to wait on a fence after it has been updated in the same encoder.
316 #[unsafe(method(waitForFence:))]
317 #[unsafe(method_family = none)]
318 fn waitForFence(&self, fence: &ProtocolObject<dyn MTLFence>);
319
320 #[cfg(all(feature = "MTLAllocation", feature = "MTLResource"))]
321 /// Declare that a resource may be accessed by the command encoder through an argument buffer
322 ///
323 ///
324 /// For tracked MTLResources, this method protects against data hazards. This method must be called before encoding any acceleration structure commands which may access the resource through an argument buffer.
325 ///
326 /// Warning: Prior to iOS 13, macOS 10.15, this method does not protect against data hazards. If you are deploying to older versions of macOS or iOS, use fences to ensure data hazards are resolved.
327 #[unsafe(method(useResource:usage:))]
328 #[unsafe(method_family = none)]
329 fn useResource_usage(
330 &self,
331 resource: &ProtocolObject<dyn MTLResource>,
332 usage: MTLResourceUsage,
333 );
334
335 #[cfg(all(feature = "MTLAllocation", feature = "MTLResource"))]
336 /// Declare that an array of resources may be accessed through an argument buffer by the command encoder
337 ///
338 /// For tracked MTL Resources, this method protects against data hazards. This method must be called before encoding any acceleration structure commands which may access the resources through an argument buffer.
339 ///
340 /// Warning: Prior to iOS 13, macOS 10.15, this method does not protect against data hazards. If you are deploying to older versions of macOS or iOS, use fences to ensure data hazards are resolved.
341 ///
342 /// # Safety
343 ///
344 /// - `resources` must be a valid pointer.
345 /// - `count` might not be bounds-checked.
346 #[unsafe(method(useResources:count:usage:))]
347 #[unsafe(method_family = none)]
348 unsafe fn useResources_count_usage(
349 &self,
350 resources: NonNull<NonNull<ProtocolObject<dyn MTLResource>>>,
351 count: NSUInteger,
352 usage: MTLResourceUsage,
353 );
354
355 #[cfg(all(feature = "MTLAllocation", feature = "MTLHeap"))]
356 /// Declare that the resources allocated from a heap may be accessed as readonly by the encoder through an argument buffer
357 ///
358 /// For tracked MTLHeaps, this method protects against data hazards. This method must be called before encoding any acceleration structure commands which may access the resources allocated from the heap through an argument buffer. This method may cause all of the color attachments allocated from the heap to become decompressed. Therefore, it is recommended that the useResource:usage: or useResources:count:usage: methods be used for color attachments instead, with a minimal (i.e. read-only) usage.
359 ///
360 /// Warning: Prior to iOS 13, macOS 10.15, this method does not protect against data hazards. If you are deploying to older versions of macOS or iOS, use fences to ensure data hazards are resolved.
361 #[unsafe(method(useHeap:))]
362 #[unsafe(method_family = none)]
363 fn useHeap(&self, heap: &ProtocolObject<dyn MTLHeap>);
364
365 #[cfg(all(feature = "MTLAllocation", feature = "MTLHeap"))]
366 /// Declare that the resources allocated from an array of heaps may be accessed as readonly by the encoder through an argument buffer
367 ///
368 /// For tracked MTLHeaps, this method protects against data hazards. This method must be called before encoding any acceleration structure commands which may access the resources allocated from the heaps through an argument buffer. This method may cause all of the color attachments allocated from the heaps to become decompressed. Therefore, it is recommended that the useResource:usage: or useResources:count:usage: methods be used for color attachments instead, with a minimal (i.e. read-only) usage.
369 ///
370 /// Warning: Prior to iOS 13, macOS 10.15, this method does not protect against data hazards. If you are deploying to older versions of macOS or iOS, use fences to ensure data hazards are resolved.
371 ///
372 /// # Safety
373 ///
374 /// - `heaps` must be a valid pointer.
375 /// - `count` might not be bounds-checked.
376 #[unsafe(method(useHeaps:count:))]
377 #[unsafe(method_family = none)]
378 unsafe fn useHeaps_count(
379 &self,
380 heaps: NonNull<NonNull<ProtocolObject<dyn MTLHeap>>>,
381 count: NSUInteger,
382 );
383
384 #[cfg(feature = "MTLCounters")]
385 /// Sample hardware counters at this point in the acceleration structure
386 /// encoder and store the counter sample into the sample buffer at the specified index.
387 ///
388 /// Parameter `sampleBuffer`: The sample buffer to sample into
389 ///
390 /// Parameter `sampleIndex`: The index into the counter buffer to write the sample
391 ///
392 /// Parameter `barrier`: Insert a barrier before taking the sample. Passing
393 /// YES will ensure that all work encoded before this operation in the encoder is
394 /// complete but does not isolate the work with respect to other encoders. Passing
395 /// NO will allow the sample to be taken concurrently with other operations in this
396 /// encoder.
397 /// In general, passing YES will lead to more repeatable counter results but
398 /// may negatively impact performance. Passing NO will generally be higher performance
399 /// but counter results may not be repeatable.
400 ///
401 /// # Safety
402 ///
403 /// `sampleIndex` might not be bounds-checked.
404 #[unsafe(method(sampleCountersInBuffer:atSampleIndex:withBarrier:))]
405 #[unsafe(method_family = none)]
406 unsafe fn sampleCountersInBuffer_atSampleIndex_withBarrier(
407 &self,
408 sample_buffer: &ProtocolObject<dyn MTLCounterSampleBuffer>,
409 sample_index: NSUInteger,
410 barrier: bool,
411 );
412 }
413);
414
415extern_class!(
416 /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructurepasssamplebufferattachmentdescriptor?language=objc)
417 #[unsafe(super(NSObject))]
418 #[derive(Debug, PartialEq, Eq, Hash)]
419 pub struct MTLAccelerationStructurePassSampleBufferAttachmentDescriptor;
420);
421
422extern_conformance!(
423 unsafe impl NSCopying for MTLAccelerationStructurePassSampleBufferAttachmentDescriptor {}
424);
425
426unsafe impl CopyingHelper for MTLAccelerationStructurePassSampleBufferAttachmentDescriptor {
427 type Result = Self;
428}
429
430extern_conformance!(
431 unsafe impl NSObjectProtocol for MTLAccelerationStructurePassSampleBufferAttachmentDescriptor {}
432);
433
434impl MTLAccelerationStructurePassSampleBufferAttachmentDescriptor {
435 extern_methods!(
436 #[cfg(feature = "MTLCounters")]
437 /// The sample buffer to store samples for the acceleration structure pass defined samples.
438 /// If sampleBuffer is non-nil, the sample indices will be used to store samples into
439 /// the sample buffer. If no sample buffer is provided, no samples will be taken.
440 /// If any of the sample indices are specified as MTLCounterDontSample, no sample
441 /// will be taken for that action.
442 #[unsafe(method(sampleBuffer))]
443 #[unsafe(method_family = none)]
444 pub fn sampleBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLCounterSampleBuffer>>>;
445
446 #[cfg(feature = "MTLCounters")]
447 /// Setter for [`sampleBuffer`][Self::sampleBuffer].
448 #[unsafe(method(setSampleBuffer:))]
449 #[unsafe(method_family = none)]
450 pub fn setSampleBuffer(
451 &self,
452 sample_buffer: Option<&ProtocolObject<dyn MTLCounterSampleBuffer>>,
453 );
454
455 /// The sample index to use to store the sample taken at the start of
456 /// command encoder processing. Setting the value to MTLCounterDontSample will cause
457 /// this sample to be omitted.
458 ///
459 /// On devices where MTLCounterSamplingPointAtStageBoundary is unsupported,
460 /// this sample index is invalid and must be set to MTLCounterDontSample or creation of an
461 /// acceleration structure pass will fail.
462 #[unsafe(method(startOfEncoderSampleIndex))]
463 #[unsafe(method_family = none)]
464 pub fn startOfEncoderSampleIndex(&self) -> NSUInteger;
465
466 /// Setter for [`startOfEncoderSampleIndex`][Self::startOfEncoderSampleIndex].
467 ///
468 /// # Safety
469 ///
470 /// This might not be bounds-checked.
471 #[unsafe(method(setStartOfEncoderSampleIndex:))]
472 #[unsafe(method_family = none)]
473 pub unsafe fn setStartOfEncoderSampleIndex(
474 &self,
475 start_of_encoder_sample_index: NSUInteger,
476 );
477
478 /// The sample index to use to store the sample taken at the end of
479 /// command encoder processing. Setting the value to MTLCounterDontSample will cause
480 /// this sample to be omitted.
481 ///
482 /// On devices where MTLCounterSamplingPointAtStageBoundary is unsupported,
483 /// this sample index is invalid and must be set to MTLCounterDontSample or creation of an
484 /// acceleration structure pass will fail.
485 #[unsafe(method(endOfEncoderSampleIndex))]
486 #[unsafe(method_family = none)]
487 pub fn endOfEncoderSampleIndex(&self) -> NSUInteger;
488
489 /// Setter for [`endOfEncoderSampleIndex`][Self::endOfEncoderSampleIndex].
490 ///
491 /// # Safety
492 ///
493 /// This might not be bounds-checked.
494 #[unsafe(method(setEndOfEncoderSampleIndex:))]
495 #[unsafe(method_family = none)]
496 pub unsafe fn setEndOfEncoderSampleIndex(&self, end_of_encoder_sample_index: NSUInteger);
497 );
498}
499
500/// Methods declared on superclass `NSObject`.
501impl MTLAccelerationStructurePassSampleBufferAttachmentDescriptor {
502 extern_methods!(
503 #[unsafe(method(init))]
504 #[unsafe(method_family = init)]
505 pub fn init(this: Allocated<Self>) -> Retained<Self>;
506
507 #[unsafe(method(new))]
508 #[unsafe(method_family = new)]
509 pub fn new() -> Retained<Self>;
510 );
511}
512
513impl DefaultRetained for MTLAccelerationStructurePassSampleBufferAttachmentDescriptor {
514 #[inline]
515 fn default_retained() -> Retained<Self> {
516 Self::new()
517 }
518}
519
520extern_class!(
521 /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructurepasssamplebufferattachmentdescriptorarray?language=objc)
522 #[unsafe(super(NSObject))]
523 #[derive(Debug, PartialEq, Eq, Hash)]
524 pub struct MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray;
525);
526
527extern_conformance!(
528 unsafe impl NSObjectProtocol for MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray {}
529);
530
531impl MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray {
532 extern_methods!(
533 /// # Safety
534 ///
535 /// `attachmentIndex` might not be bounds-checked.
536 #[unsafe(method(objectAtIndexedSubscript:))]
537 #[unsafe(method_family = none)]
538 pub unsafe fn objectAtIndexedSubscript(
539 &self,
540 attachment_index: NSUInteger,
541 ) -> Retained<MTLAccelerationStructurePassSampleBufferAttachmentDescriptor>;
542
543 /// # Safety
544 ///
545 /// `attachmentIndex` might not be bounds-checked.
546 #[unsafe(method(setObject:atIndexedSubscript:))]
547 #[unsafe(method_family = none)]
548 pub unsafe fn setObject_atIndexedSubscript(
549 &self,
550 attachment: Option<&MTLAccelerationStructurePassSampleBufferAttachmentDescriptor>,
551 attachment_index: NSUInteger,
552 );
553 );
554}
555
556/// Methods declared on superclass `NSObject`.
557impl MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray {
558 extern_methods!(
559 #[unsafe(method(init))]
560 #[unsafe(method_family = init)]
561 pub fn init(this: Allocated<Self>) -> Retained<Self>;
562
563 #[unsafe(method(new))]
564 #[unsafe(method_family = new)]
565 pub fn new() -> Retained<Self>;
566 );
567}
568
569impl DefaultRetained for MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray {
570 #[inline]
571 fn default_retained() -> Retained<Self> {
572 Self::new()
573 }
574}
575
576extern_class!(
577 /// MTLAccelerationStructurePassDescriptor represents a collection of attachments to be used to create a concrete acceleration structure encoder.
578 ///
579 /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructurepassdescriptor?language=objc)
580 #[unsafe(super(NSObject))]
581 #[derive(Debug, PartialEq, Eq, Hash)]
582 pub struct MTLAccelerationStructurePassDescriptor;
583);
584
585extern_conformance!(
586 unsafe impl NSCopying for MTLAccelerationStructurePassDescriptor {}
587);
588
589unsafe impl CopyingHelper for MTLAccelerationStructurePassDescriptor {
590 type Result = Self;
591}
592
593extern_conformance!(
594 unsafe impl NSObjectProtocol for MTLAccelerationStructurePassDescriptor {}
595);
596
597impl MTLAccelerationStructurePassDescriptor {
598 extern_methods!(
599 /// Create an autoreleased default acceleration structure pass descriptor
600 #[unsafe(method(accelerationStructurePassDescriptor))]
601 #[unsafe(method_family = none)]
602 pub fn accelerationStructurePassDescriptor(
603 ) -> Retained<MTLAccelerationStructurePassDescriptor>;
604
605 /// An array of sample buffers and associated sample indices.
606 #[unsafe(method(sampleBufferAttachments))]
607 #[unsafe(method_family = none)]
608 pub fn sampleBufferAttachments(
609 &self,
610 ) -> Retained<MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray>;
611 );
612}
613
614/// Methods declared on superclass `NSObject`.
615impl MTLAccelerationStructurePassDescriptor {
616 extern_methods!(
617 #[unsafe(method(init))]
618 #[unsafe(method_family = init)]
619 pub fn init(this: Allocated<Self>) -> Retained<Self>;
620
621 #[unsafe(method(new))]
622 #[unsafe(method_family = new)]
623 pub fn new() -> Retained<Self>;
624 );
625}
626
627impl DefaultRetained for MTLAccelerationStructurePassDescriptor {
628 #[inline]
629 fn default_retained() -> Retained<Self> {
630 Self::new()
631 }
632}