use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTL4ShaderReflection(pub NSUInteger);
bitflags::bitflags! {
impl MTL4ShaderReflection: NSUInteger {
#[doc(alias = "MTL4ShaderReflectionNone")]
const None = 0;
#[doc(alias = "MTL4ShaderReflectionBindingInfo")]
const BindingInfo = 1<<0;
#[doc(alias = "MTL4ShaderReflectionBufferTypeInfo")]
const BufferTypeInfo = 1<<1;
}
}
unsafe impl Encode for MTL4ShaderReflection {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for MTL4ShaderReflection {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTL4AlphaToOneState(pub NSInteger);
impl MTL4AlphaToOneState {
#[doc(alias = "MTL4AlphaToOneStateDisabled")]
pub const Disabled: Self = Self(0);
#[doc(alias = "MTL4AlphaToOneStateEnabled")]
pub const Enabled: Self = Self(1);
}
unsafe impl Encode for MTL4AlphaToOneState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for MTL4AlphaToOneState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTL4AlphaToCoverageState(pub NSInteger);
impl MTL4AlphaToCoverageState {
#[doc(alias = "MTL4AlphaToCoverageStateDisabled")]
pub const Disabled: Self = Self(0);
#[doc(alias = "MTL4AlphaToCoverageStateEnabled")]
pub const Enabled: Self = Self(1);
}
unsafe impl Encode for MTL4AlphaToCoverageState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for MTL4AlphaToCoverageState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTL4BlendState(pub NSInteger);
impl MTL4BlendState {
#[doc(alias = "MTL4BlendStateDisabled")]
pub const Disabled: Self = Self(0);
#[doc(alias = "MTL4BlendStateEnabled")]
pub const Enabled: Self = Self(1);
#[doc(alias = "MTL4BlendStateUnspecialized")]
pub const Unspecialized: Self = Self(2);
}
unsafe impl Encode for MTL4BlendState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for MTL4BlendState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTL4IndirectCommandBufferSupportState(pub NSInteger);
impl MTL4IndirectCommandBufferSupportState {
#[doc(alias = "MTL4IndirectCommandBufferSupportStateDisabled")]
pub const Disabled: Self = Self(0);
#[doc(alias = "MTL4IndirectCommandBufferSupportStateEnabled")]
pub const Enabled: Self = Self(1);
}
unsafe impl Encode for MTL4IndirectCommandBufferSupportState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for MTL4IndirectCommandBufferSupportState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTL4PipelineOptions;
);
extern_conformance!(
unsafe impl NSCopying for MTL4PipelineOptions {}
);
unsafe impl CopyingHelper for MTL4PipelineOptions {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MTL4PipelineOptions {}
);
impl MTL4PipelineOptions {
extern_methods!(
#[cfg(feature = "MTLPipeline")]
#[unsafe(method(shaderValidation))]
#[unsafe(method_family = none)]
pub fn shaderValidation(&self) -> MTLShaderValidation;
#[cfg(feature = "MTLPipeline")]
#[unsafe(method(setShaderValidation:))]
#[unsafe(method_family = none)]
pub fn setShaderValidation(&self, shader_validation: MTLShaderValidation);
#[unsafe(method(shaderReflection))]
#[unsafe(method_family = none)]
pub fn shaderReflection(&self) -> MTL4ShaderReflection;
#[unsafe(method(setShaderReflection:))]
#[unsafe(method_family = none)]
pub fn setShaderReflection(&self, shader_reflection: MTL4ShaderReflection);
);
}
impl MTL4PipelineOptions {
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 MTL4PipelineOptions {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTL4PipelineDescriptor;
);
extern_conformance!(
unsafe impl NSCopying for MTL4PipelineDescriptor {}
);
unsafe impl CopyingHelper for MTL4PipelineDescriptor {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MTL4PipelineDescriptor {}
);
impl MTL4PipelineDescriptor {
extern_methods!(
#[unsafe(method(label))]
#[unsafe(method_family = none)]
pub fn label(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setLabel:))]
#[unsafe(method_family = none)]
pub fn setLabel(&self, label: Option<&NSString>);
#[unsafe(method(options))]
#[unsafe(method_family = none)]
pub fn options(&self) -> Option<Retained<MTL4PipelineOptions>>;
#[unsafe(method(setOptions:))]
#[unsafe(method_family = none)]
pub fn setOptions(&self, options: Option<&MTL4PipelineOptions>);
);
}
impl MTL4PipelineDescriptor {
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 MTL4PipelineDescriptor {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}