use objc2::{
extern_class, extern_conformance, extern_methods,
rc::{Allocated, Retained},
runtime::NSObject,
};
use objc2_foundation::{CopyingHelper, NSCopying, NSObjectProtocol};
use super::MTLComputePassSampleBufferAttachmentDescriptorArray;
use crate::compute_command_encoder::MTLDispatchType;
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 compute_pass_descriptor() -> Retained<MTLComputePassDescriptor>;
#[unsafe(method(dispatchType))]
#[unsafe(method_family = none)]
pub fn dispatch_type(&self) -> MTLDispatchType;
#[unsafe(method(setDispatchType:))]
#[unsafe(method_family = none)]
pub fn set_dispatch_type(
&self,
dispatch_type: MTLDispatchType,
);
#[unsafe(method(sampleBufferAttachments))]
#[unsafe(method_family = none)]
pub fn sample_buffer_attachments(&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>;
);
}