use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLComputePassSampleBufferAttachmentDescriptor;
);
extern_conformance!(
unsafe impl NSCopying for MTLComputePassSampleBufferAttachmentDescriptor {}
);
unsafe impl CopyingHelper for MTLComputePassSampleBufferAttachmentDescriptor {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MTLComputePassSampleBufferAttachmentDescriptor {}
);
impl MTLComputePassSampleBufferAttachmentDescriptor {
extern_methods!(
#[cfg(feature = "MTLCounters")]
#[unsafe(method(sampleBuffer))]
#[unsafe(method_family = none)]
pub fn sampleBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLCounterSampleBuffer>>>;
#[cfg(feature = "MTLCounters")]
#[unsafe(method(setSampleBuffer:))]
#[unsafe(method_family = none)]
pub fn setSampleBuffer(
&self,
sample_buffer: Option<&ProtocolObject<dyn MTLCounterSampleBuffer>>,
);
#[unsafe(method(startOfEncoderSampleIndex))]
#[unsafe(method_family = none)]
pub fn startOfEncoderSampleIndex(&self) -> NSUInteger;
#[unsafe(method(setStartOfEncoderSampleIndex:))]
#[unsafe(method_family = none)]
pub unsafe fn setStartOfEncoderSampleIndex(
&self,
start_of_encoder_sample_index: NSUInteger,
);
#[unsafe(method(endOfEncoderSampleIndex))]
#[unsafe(method_family = none)]
pub fn endOfEncoderSampleIndex(&self) -> NSUInteger;
#[unsafe(method(setEndOfEncoderSampleIndex:))]
#[unsafe(method_family = none)]
pub unsafe fn setEndOfEncoderSampleIndex(&self, end_of_encoder_sample_index: NSUInteger);
);
}
impl MTLComputePassSampleBufferAttachmentDescriptor {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
impl DefaultRetained for MTLComputePassSampleBufferAttachmentDescriptor {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLComputePassSampleBufferAttachmentDescriptorArray;
);
extern_conformance!(
unsafe impl NSObjectProtocol for MTLComputePassSampleBufferAttachmentDescriptorArray {}
);
impl MTLComputePassSampleBufferAttachmentDescriptorArray {
extern_methods!(
#[unsafe(method(objectAtIndexedSubscript:))]
#[unsafe(method_family = none)]
pub unsafe fn objectAtIndexedSubscript(
&self,
attachment_index: NSUInteger,
) -> Retained<MTLComputePassSampleBufferAttachmentDescriptor>;
#[unsafe(method(setObject:atIndexedSubscript:))]
#[unsafe(method_family = none)]
pub unsafe fn setObject_atIndexedSubscript(
&self,
attachment: Option<&MTLComputePassSampleBufferAttachmentDescriptor>,
attachment_index: NSUInteger,
);
);
}
impl MTLComputePassSampleBufferAttachmentDescriptorArray {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
impl DefaultRetained for MTLComputePassSampleBufferAttachmentDescriptorArray {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLComputePassDescriptor;
);
extern_conformance!(
unsafe impl NSCopying for MTLComputePassDescriptor {}
);
unsafe impl CopyingHelper for MTLComputePassDescriptor {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MTLComputePassDescriptor {}
);
impl MTLComputePassDescriptor {
extern_methods!(
#[unsafe(method(computePassDescriptor))]
#[unsafe(method_family = none)]
pub fn computePassDescriptor() -> Retained<MTLComputePassDescriptor>;
#[cfg(feature = "MTLCommandBuffer")]
#[unsafe(method(dispatchType))]
#[unsafe(method_family = none)]
pub fn dispatchType(&self) -> MTLDispatchType;
#[cfg(feature = "MTLCommandBuffer")]
#[unsafe(method(setDispatchType:))]
#[unsafe(method_family = none)]
pub fn setDispatchType(&self, dispatch_type: MTLDispatchType);
#[unsafe(method(sampleBufferAttachments))]
#[unsafe(method_family = none)]
pub fn sampleBufferAttachments(
&self,
) -> Retained<MTLComputePassSampleBufferAttachmentDescriptorArray>;
);
}
impl MTLComputePassDescriptor {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
impl DefaultRetained for MTLComputePassDescriptor {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}