use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLDataType(pub NSUInteger);
impl MTLDataType {
#[doc(alias = "MTLDataTypeNone")]
pub const None: Self = Self(0);
#[doc(alias = "MTLDataTypeStruct")]
pub const Struct: Self = Self(1);
#[doc(alias = "MTLDataTypeArray")]
pub const Array: Self = Self(2);
#[doc(alias = "MTLDataTypeFloat")]
pub const Float: Self = Self(3);
#[doc(alias = "MTLDataTypeFloat2")]
pub const Float2: Self = Self(4);
#[doc(alias = "MTLDataTypeFloat3")]
pub const Float3: Self = Self(5);
#[doc(alias = "MTLDataTypeFloat4")]
pub const Float4: Self = Self(6);
#[doc(alias = "MTLDataTypeFloat2x2")]
pub const Float2x2: Self = Self(7);
#[doc(alias = "MTLDataTypeFloat2x3")]
pub const Float2x3: Self = Self(8);
#[doc(alias = "MTLDataTypeFloat2x4")]
pub const Float2x4: Self = Self(9);
#[doc(alias = "MTLDataTypeFloat3x2")]
pub const Float3x2: Self = Self(10);
#[doc(alias = "MTLDataTypeFloat3x3")]
pub const Float3x3: Self = Self(11);
#[doc(alias = "MTLDataTypeFloat3x4")]
pub const Float3x4: Self = Self(12);
#[doc(alias = "MTLDataTypeFloat4x2")]
pub const Float4x2: Self = Self(13);
#[doc(alias = "MTLDataTypeFloat4x3")]
pub const Float4x3: Self = Self(14);
#[doc(alias = "MTLDataTypeFloat4x4")]
pub const Float4x4: Self = Self(15);
#[doc(alias = "MTLDataTypeHalf")]
pub const Half: Self = Self(16);
#[doc(alias = "MTLDataTypeHalf2")]
pub const Half2: Self = Self(17);
#[doc(alias = "MTLDataTypeHalf3")]
pub const Half3: Self = Self(18);
#[doc(alias = "MTLDataTypeHalf4")]
pub const Half4: Self = Self(19);
#[doc(alias = "MTLDataTypeHalf2x2")]
pub const Half2x2: Self = Self(20);
#[doc(alias = "MTLDataTypeHalf2x3")]
pub const Half2x3: Self = Self(21);
#[doc(alias = "MTLDataTypeHalf2x4")]
pub const Half2x4: Self = Self(22);
#[doc(alias = "MTLDataTypeHalf3x2")]
pub const Half3x2: Self = Self(23);
#[doc(alias = "MTLDataTypeHalf3x3")]
pub const Half3x3: Self = Self(24);
#[doc(alias = "MTLDataTypeHalf3x4")]
pub const Half3x4: Self = Self(25);
#[doc(alias = "MTLDataTypeHalf4x2")]
pub const Half4x2: Self = Self(26);
#[doc(alias = "MTLDataTypeHalf4x3")]
pub const Half4x3: Self = Self(27);
#[doc(alias = "MTLDataTypeHalf4x4")]
pub const Half4x4: Self = Self(28);
#[doc(alias = "MTLDataTypeInt")]
pub const Int: Self = Self(29);
#[doc(alias = "MTLDataTypeInt2")]
pub const Int2: Self = Self(30);
#[doc(alias = "MTLDataTypeInt3")]
pub const Int3: Self = Self(31);
#[doc(alias = "MTLDataTypeInt4")]
pub const Int4: Self = Self(32);
#[doc(alias = "MTLDataTypeUInt")]
pub const UInt: Self = Self(33);
#[doc(alias = "MTLDataTypeUInt2")]
pub const UInt2: Self = Self(34);
#[doc(alias = "MTLDataTypeUInt3")]
pub const UInt3: Self = Self(35);
#[doc(alias = "MTLDataTypeUInt4")]
pub const UInt4: Self = Self(36);
#[doc(alias = "MTLDataTypeShort")]
pub const Short: Self = Self(37);
#[doc(alias = "MTLDataTypeShort2")]
pub const Short2: Self = Self(38);
#[doc(alias = "MTLDataTypeShort3")]
pub const Short3: Self = Self(39);
#[doc(alias = "MTLDataTypeShort4")]
pub const Short4: Self = Self(40);
#[doc(alias = "MTLDataTypeUShort")]
pub const UShort: Self = Self(41);
#[doc(alias = "MTLDataTypeUShort2")]
pub const UShort2: Self = Self(42);
#[doc(alias = "MTLDataTypeUShort3")]
pub const UShort3: Self = Self(43);
#[doc(alias = "MTLDataTypeUShort4")]
pub const UShort4: Self = Self(44);
#[doc(alias = "MTLDataTypeChar")]
pub const Char: Self = Self(45);
#[doc(alias = "MTLDataTypeChar2")]
pub const Char2: Self = Self(46);
#[doc(alias = "MTLDataTypeChar3")]
pub const Char3: Self = Self(47);
#[doc(alias = "MTLDataTypeChar4")]
pub const Char4: Self = Self(48);
#[doc(alias = "MTLDataTypeUChar")]
pub const UChar: Self = Self(49);
#[doc(alias = "MTLDataTypeUChar2")]
pub const UChar2: Self = Self(50);
#[doc(alias = "MTLDataTypeUChar3")]
pub const UChar3: Self = Self(51);
#[doc(alias = "MTLDataTypeUChar4")]
pub const UChar4: Self = Self(52);
#[doc(alias = "MTLDataTypeBool")]
pub const Bool: Self = Self(53);
#[doc(alias = "MTLDataTypeBool2")]
pub const Bool2: Self = Self(54);
#[doc(alias = "MTLDataTypeBool3")]
pub const Bool3: Self = Self(55);
#[doc(alias = "MTLDataTypeBool4")]
pub const Bool4: Self = Self(56);
#[doc(alias = "MTLDataTypeTexture")]
pub const Texture: Self = Self(58);
#[doc(alias = "MTLDataTypeSampler")]
pub const Sampler: Self = Self(59);
#[doc(alias = "MTLDataTypePointer")]
pub const Pointer: Self = Self(60);
#[doc(alias = "MTLDataTypeR8Unorm")]
pub const R8Unorm: Self = Self(62);
#[doc(alias = "MTLDataTypeR8Snorm")]
pub const R8Snorm: Self = Self(63);
#[doc(alias = "MTLDataTypeR16Unorm")]
pub const R16Unorm: Self = Self(64);
#[doc(alias = "MTLDataTypeR16Snorm")]
pub const R16Snorm: Self = Self(65);
#[doc(alias = "MTLDataTypeRG8Unorm")]
pub const RG8Unorm: Self = Self(66);
#[doc(alias = "MTLDataTypeRG8Snorm")]
pub const RG8Snorm: Self = Self(67);
#[doc(alias = "MTLDataTypeRG16Unorm")]
pub const RG16Unorm: Self = Self(68);
#[doc(alias = "MTLDataTypeRG16Snorm")]
pub const RG16Snorm: Self = Self(69);
#[doc(alias = "MTLDataTypeRGBA8Unorm")]
pub const RGBA8Unorm: Self = Self(70);
#[doc(alias = "MTLDataTypeRGBA8Unorm_sRGB")]
pub const RGBA8Unorm_sRGB: Self = Self(71);
#[doc(alias = "MTLDataTypeRGBA8Snorm")]
pub const RGBA8Snorm: Self = Self(72);
#[doc(alias = "MTLDataTypeRGBA16Unorm")]
pub const RGBA16Unorm: Self = Self(73);
#[doc(alias = "MTLDataTypeRGBA16Snorm")]
pub const RGBA16Snorm: Self = Self(74);
#[doc(alias = "MTLDataTypeRGB10A2Unorm")]
pub const RGB10A2Unorm: Self = Self(75);
#[doc(alias = "MTLDataTypeRG11B10Float")]
pub const RG11B10Float: Self = Self(76);
#[doc(alias = "MTLDataTypeRGB9E5Float")]
pub const RGB9E5Float: Self = Self(77);
#[doc(alias = "MTLDataTypeRenderPipeline")]
pub const RenderPipeline: Self = Self(78);
#[doc(alias = "MTLDataTypeComputePipeline")]
pub const ComputePipeline: Self = Self(79);
#[doc(alias = "MTLDataTypeIndirectCommandBuffer")]
pub const IndirectCommandBuffer: Self = Self(80);
#[doc(alias = "MTLDataTypeLong")]
pub const Long: Self = Self(81);
#[doc(alias = "MTLDataTypeLong2")]
pub const Long2: Self = Self(82);
#[doc(alias = "MTLDataTypeLong3")]
pub const Long3: Self = Self(83);
#[doc(alias = "MTLDataTypeLong4")]
pub const Long4: Self = Self(84);
#[doc(alias = "MTLDataTypeULong")]
pub const ULong: Self = Self(85);
#[doc(alias = "MTLDataTypeULong2")]
pub const ULong2: Self = Self(86);
#[doc(alias = "MTLDataTypeULong3")]
pub const ULong3: Self = Self(87);
#[doc(alias = "MTLDataTypeULong4")]
pub const ULong4: Self = Self(88);
#[doc(alias = "MTLDataTypeVisibleFunctionTable")]
pub const VisibleFunctionTable: Self = Self(115);
#[doc(alias = "MTLDataTypeIntersectionFunctionTable")]
pub const IntersectionFunctionTable: Self = Self(116);
#[doc(alias = "MTLDataTypePrimitiveAccelerationStructure")]
pub const PrimitiveAccelerationStructure: Self = Self(117);
#[doc(alias = "MTLDataTypeInstanceAccelerationStructure")]
pub const InstanceAccelerationStructure: Self = Self(118);
#[doc(alias = "MTLDataTypeBFloat")]
pub const BFloat: Self = Self(121);
#[doc(alias = "MTLDataTypeBFloat2")]
pub const BFloat2: Self = Self(122);
#[doc(alias = "MTLDataTypeBFloat3")]
pub const BFloat3: Self = Self(123);
#[doc(alias = "MTLDataTypeBFloat4")]
pub const BFloat4: Self = Self(124);
}
unsafe impl Encode for MTLDataType {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for MTLDataType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLBindingType(pub NSInteger);
impl MTLBindingType {
#[doc(alias = "MTLBindingTypeBuffer")]
pub const Buffer: Self = Self(0);
#[doc(alias = "MTLBindingTypeThreadgroupMemory")]
pub const ThreadgroupMemory: Self = Self(1);
#[doc(alias = "MTLBindingTypeTexture")]
pub const Texture: Self = Self(2);
#[doc(alias = "MTLBindingTypeSampler")]
pub const Sampler: Self = Self(3);
#[doc(alias = "MTLBindingTypeImageblockData")]
pub const ImageblockData: Self = Self(16);
#[doc(alias = "MTLBindingTypeImageblock")]
pub const Imageblock: Self = Self(17);
#[doc(alias = "MTLBindingTypeVisibleFunctionTable")]
pub const VisibleFunctionTable: Self = Self(24);
#[doc(alias = "MTLBindingTypePrimitiveAccelerationStructure")]
pub const PrimitiveAccelerationStructure: Self = Self(25);
#[doc(alias = "MTLBindingTypeInstanceAccelerationStructure")]
pub const InstanceAccelerationStructure: Self = Self(26);
#[doc(alias = "MTLBindingTypeIntersectionFunctionTable")]
pub const IntersectionFunctionTable: Self = Self(27);
#[doc(alias = "MTLBindingTypeObjectPayload")]
pub const ObjectPayload: Self = Self(34);
}
unsafe impl Encode for MTLBindingType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for MTLBindingType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[deprecated]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLArgumentType(pub NSUInteger);
impl MTLArgumentType {
#[deprecated]
#[doc(alias = "MTLArgumentTypeBuffer")]
pub const Buffer: Self = Self(0);
#[deprecated]
#[doc(alias = "MTLArgumentTypeThreadgroupMemory")]
pub const ThreadgroupMemory: Self = Self(1);
#[deprecated]
#[doc(alias = "MTLArgumentTypeTexture")]
pub const Texture: Self = Self(2);
#[deprecated]
#[doc(alias = "MTLArgumentTypeSampler")]
pub const Sampler: Self = Self(3);
#[doc(alias = "MTLArgumentTypeImageblockData")]
pub const ImageblockData: Self = Self(16);
#[doc(alias = "MTLArgumentTypeImageblock")]
pub const Imageblock: Self = Self(17);
#[doc(alias = "MTLArgumentTypeVisibleFunctionTable")]
pub const VisibleFunctionTable: Self = Self(24);
#[doc(alias = "MTLArgumentTypePrimitiveAccelerationStructure")]
pub const PrimitiveAccelerationStructure: Self = Self(25);
#[doc(alias = "MTLArgumentTypeInstanceAccelerationStructure")]
pub const InstanceAccelerationStructure: Self = Self(26);
#[doc(alias = "MTLArgumentTypeIntersectionFunctionTable")]
pub const IntersectionFunctionTable: Self = Self(27);
}
unsafe impl Encode for MTLArgumentType {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for MTLArgumentType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLBindingAccess(pub NSUInteger);
impl MTLBindingAccess {
#[doc(alias = "MTLBindingAccessReadOnly")]
pub const ReadOnly: Self = Self(0);
#[doc(alias = "MTLBindingAccessReadWrite")]
pub const ReadWrite: Self = Self(1);
#[doc(alias = "MTLBindingAccessWriteOnly")]
pub const WriteOnly: Self = Self(2);
#[deprecated]
pub const MTLArgumentAccessReadOnly: Self = Self(MTLBindingAccess::ReadOnly.0);
#[deprecated]
pub const MTLArgumentAccessReadWrite: Self = Self(MTLBindingAccess::ReadWrite.0);
#[deprecated]
pub const MTLArgumentAccessWriteOnly: Self = Self(MTLBindingAccess::WriteOnly.0);
}
unsafe impl Encode for MTLBindingAccess {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for MTLBindingAccess {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type MTLArgumentAccess = MTLBindingAccess;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLType;
unsafe impl ClassType for MTLType {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for MTLType {}
extern_methods!(
unsafe impl MTLType {
#[method(dataType)]
pub unsafe fn dataType(&self) -> MTLDataType;
}
);
extern_methods!(
unsafe impl MTLType {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLStructMember;
unsafe impl ClassType for MTLStructMember {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for MTLStructMember {}
extern_methods!(
unsafe impl MTLStructMember {
#[method_id(@__retain_semantics Other name)]
pub fn name(&self) -> Retained<NSString>;
#[method(offset)]
pub fn offset(&self) -> NSUInteger;
#[method(dataType)]
pub fn dataType(&self) -> MTLDataType;
#[method_id(@__retain_semantics Other structType)]
pub fn structType(&self) -> Option<Retained<MTLStructType>>;
#[method_id(@__retain_semantics Other arrayType)]
pub fn arrayType(&self) -> Option<Retained<MTLArrayType>>;
#[method_id(@__retain_semantics Other textureReferenceType)]
pub unsafe fn textureReferenceType(&self) -> Option<Retained<MTLTextureReferenceType>>;
#[method_id(@__retain_semantics Other pointerType)]
pub unsafe fn pointerType(&self) -> Option<Retained<MTLPointerType>>;
#[method(argumentIndex)]
pub unsafe fn argumentIndex(&self) -> NSUInteger;
}
);
extern_methods!(
unsafe impl MTLStructMember {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLStructType;
unsafe impl ClassType for MTLStructType {
#[inherits(NSObject)]
type Super = MTLType;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for MTLStructType {}
extern_methods!(
unsafe impl MTLStructType {
#[method_id(@__retain_semantics Other members)]
pub fn members(&self) -> Retained<NSArray<MTLStructMember>>;
#[method_id(@__retain_semantics Other memberByName:)]
pub fn memberByName(&self, name: &NSString) -> Option<Retained<MTLStructMember>>;
}
);
extern_methods!(
unsafe impl MTLStructType {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLArrayType;
unsafe impl ClassType for MTLArrayType {
#[inherits(NSObject)]
type Super = MTLType;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for MTLArrayType {}
extern_methods!(
unsafe impl MTLArrayType {
#[method(elementType)]
pub fn elementType(&self) -> MTLDataType;
#[method(arrayLength)]
pub fn arrayLength(&self) -> NSUInteger;
#[method(stride)]
pub fn stride(&self) -> NSUInteger;
#[method(argumentIndexStride)]
pub unsafe fn argumentIndexStride(&self) -> NSUInteger;
#[method_id(@__retain_semantics Other elementStructType)]
pub fn elementStructType(&self) -> Option<Retained<MTLStructType>>;
#[method_id(@__retain_semantics Other elementArrayType)]
pub fn elementArrayType(&self) -> Option<Retained<MTLArrayType>>;
#[method_id(@__retain_semantics Other elementTextureReferenceType)]
pub unsafe fn elementTextureReferenceType(
&self,
) -> Option<Retained<MTLTextureReferenceType>>;
#[method_id(@__retain_semantics Other elementPointerType)]
pub unsafe fn elementPointerType(&self) -> Option<Retained<MTLPointerType>>;
}
);
extern_methods!(
unsafe impl MTLArrayType {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLPointerType;
unsafe impl ClassType for MTLPointerType {
#[inherits(NSObject)]
type Super = MTLType;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for MTLPointerType {}
extern_methods!(
unsafe impl MTLPointerType {
#[method(elementType)]
pub unsafe fn elementType(&self) -> MTLDataType;
#[method(access)]
pub unsafe fn access(&self) -> MTLBindingAccess;
#[method(alignment)]
pub unsafe fn alignment(&self) -> NSUInteger;
#[method(dataSize)]
pub unsafe fn dataSize(&self) -> NSUInteger;
#[method(elementIsArgumentBuffer)]
pub unsafe fn elementIsArgumentBuffer(&self) -> bool;
#[method_id(@__retain_semantics Other elementStructType)]
pub unsafe fn elementStructType(&self) -> Option<Retained<MTLStructType>>;
#[method_id(@__retain_semantics Other elementArrayType)]
pub unsafe fn elementArrayType(&self) -> Option<Retained<MTLArrayType>>;
}
);
extern_methods!(
unsafe impl MTLPointerType {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLTextureReferenceType;
unsafe impl ClassType for MTLTextureReferenceType {
#[inherits(NSObject)]
type Super = MTLType;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for MTLTextureReferenceType {}
extern_methods!(
unsafe impl MTLTextureReferenceType {
#[method(textureDataType)]
pub unsafe fn textureDataType(&self) -> MTLDataType;
#[cfg(feature = "MTLTexture")]
#[method(textureType)]
pub unsafe fn textureType(&self) -> MTLTextureType;
#[method(access)]
pub unsafe fn access(&self) -> MTLBindingAccess;
#[method(isDepthTexture)]
pub unsafe fn isDepthTexture(&self) -> bool;
}
);
extern_methods!(
unsafe impl MTLTextureReferenceType {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated]
pub struct MTLArgument;
unsafe impl ClassType for MTLArgument {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for MTLArgument {}
extern_methods!(
unsafe impl MTLArgument {
#[deprecated]
#[method_id(@__retain_semantics Other name)]
pub fn name(&self) -> Retained<NSString>;
#[deprecated]
#[method(type)]
pub unsafe fn r#type(&self) -> MTLArgumentType;
#[deprecated]
#[method(access)]
pub fn access(&self) -> MTLBindingAccess;
#[deprecated]
#[method(index)]
pub fn index(&self) -> NSUInteger;
#[deprecated]
#[method(isActive)]
pub fn isActive(&self) -> bool;
#[deprecated]
#[method(bufferAlignment)]
pub fn bufferAlignment(&self) -> NSUInteger;
#[deprecated]
#[method(bufferDataSize)]
pub fn bufferDataSize(&self) -> NSUInteger;
#[deprecated]
#[method(bufferDataType)]
pub fn bufferDataType(&self) -> MTLDataType;
#[deprecated]
#[method_id(@__retain_semantics Other bufferStructType)]
pub fn bufferStructType(&self) -> Option<Retained<MTLStructType>>;
#[method_id(@__retain_semantics Other bufferPointerType)]
pub unsafe fn bufferPointerType(&self) -> Option<Retained<MTLPointerType>>;
#[deprecated]
#[method(threadgroupMemoryAlignment)]
pub fn threadgroupMemoryAlignment(&self) -> NSUInteger;
#[deprecated]
#[method(threadgroupMemoryDataSize)]
pub fn threadgroupMemoryDataSize(&self) -> NSUInteger;
#[cfg(feature = "MTLTexture")]
#[deprecated]
#[method(textureType)]
pub fn textureType(&self) -> MTLTextureType;
#[deprecated]
#[method(textureDataType)]
pub fn textureDataType(&self) -> MTLDataType;
#[method(isDepthTexture)]
pub unsafe fn isDepthTexture(&self) -> bool;
#[method(arrayLength)]
pub unsafe fn arrayLength(&self) -> NSUInteger;
}
);
extern_methods!(
unsafe impl MTLArgument {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern_protocol!(
pub unsafe trait MTLBinding: NSObjectProtocol + IsRetainable {
#[method_id(@__retain_semantics Other name)]
unsafe fn name(&self) -> Retained<NSString>;
#[method(type)]
unsafe fn r#type(&self) -> MTLBindingType;
#[method(access)]
unsafe fn access(&self) -> MTLBindingAccess;
#[method(index)]
unsafe fn index(&self) -> NSUInteger;
#[method(isUsed)]
unsafe fn isUsed(&self) -> bool;
#[method(isArgument)]
unsafe fn isArgument(&self) -> bool;
}
unsafe impl ProtocolType for dyn MTLBinding {}
);
extern_protocol!(
pub unsafe trait MTLBufferBinding: MTLBinding + IsRetainable {
#[method(bufferAlignment)]
unsafe fn bufferAlignment(&self) -> NSUInteger;
#[method(bufferDataSize)]
unsafe fn bufferDataSize(&self) -> NSUInteger;
#[method(bufferDataType)]
unsafe fn bufferDataType(&self) -> MTLDataType;
#[method_id(@__retain_semantics Other bufferStructType)]
unsafe fn bufferStructType(&self) -> Option<Retained<MTLStructType>>;
#[method_id(@__retain_semantics Other bufferPointerType)]
unsafe fn bufferPointerType(&self) -> Option<Retained<MTLPointerType>>;
}
unsafe impl ProtocolType for dyn MTLBufferBinding {}
);
extern_protocol!(
pub unsafe trait MTLThreadgroupBinding: MTLBinding + IsRetainable {
#[method(threadgroupMemoryAlignment)]
unsafe fn threadgroupMemoryAlignment(&self) -> NSUInteger;
#[method(threadgroupMemoryDataSize)]
unsafe fn threadgroupMemoryDataSize(&self) -> NSUInteger;
}
unsafe impl ProtocolType for dyn MTLThreadgroupBinding {}
);
extern_protocol!(
pub unsafe trait MTLTextureBinding: MTLBinding + IsRetainable {
#[cfg(feature = "MTLTexture")]
#[method(textureType)]
unsafe fn textureType(&self) -> MTLTextureType;
#[method(textureDataType)]
unsafe fn textureDataType(&self) -> MTLDataType;
#[method(isDepthTexture)]
unsafe fn isDepthTexture(&self) -> bool;
#[method(arrayLength)]
unsafe fn arrayLength(&self) -> NSUInteger;
}
unsafe impl ProtocolType for dyn MTLTextureBinding {}
);
extern_protocol!(
pub unsafe trait MTLObjectPayloadBinding: MTLBinding + IsRetainable {
#[method(objectPayloadAlignment)]
unsafe fn objectPayloadAlignment(&self) -> NSUInteger;
#[method(objectPayloadDataSize)]
unsafe fn objectPayloadDataSize(&self) -> NSUInteger;
}
unsafe impl ProtocolType for dyn MTLObjectPayloadBinding {}
);