1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

pub static MTLAttributeStrideStatic: NSUInteger = NSUIntegerMax as _;

extern_protocol!(
    pub unsafe trait MTLArgumentEncoder: NSObjectProtocol + IsRetainable {
        #[cfg(feature = "MTLDevice")]
        #[method_id(@__retain_semantics Other device)]
        unsafe fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>;

        #[method_id(@__retain_semantics Other label)]
        unsafe fn label(&self) -> Option<Retained<NSString>>;

        #[method(setLabel:)]
        unsafe fn setLabel(&self, label: Option<&NSString>);

        #[method(encodedLength)]
        fn encodedLength(&self) -> NSUInteger;

        #[method(alignment)]
        fn alignment(&self) -> NSUInteger;

        #[cfg(all(feature = "MTLBuffer", feature = "MTLResource"))]
        #[method(setArgumentBuffer:offset:)]
        unsafe fn setArgumentBuffer_offset(
            &self,
            argument_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
            offset: NSUInteger,
        );

        #[cfg(all(feature = "MTLBuffer", feature = "MTLResource"))]
        #[method(setArgumentBuffer:startOffset:arrayElement:)]
        unsafe fn setArgumentBuffer_startOffset_arrayElement(
            &self,
            argument_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
            start_offset: NSUInteger,
            array_element: NSUInteger,
        );

        #[cfg(all(feature = "MTLBuffer", feature = "MTLResource"))]
        #[method(setBuffer:offset:atIndex:)]
        unsafe fn setBuffer_offset_atIndex(
            &self,
            buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
            offset: NSUInteger,
            index: NSUInteger,
        );

        #[cfg(all(feature = "MTLBuffer", feature = "MTLResource"))]
        #[method(setBuffers:offsets:withRange:)]
        unsafe fn setBuffers_offsets_withRange(
            &self,
            buffers: NonNull<*const ProtocolObject<dyn MTLBuffer>>,
            offsets: NonNull<NSUInteger>,
            range: NSRange,
        );

        #[cfg(all(feature = "MTLResource", feature = "MTLTexture"))]
        #[method(setTexture:atIndex:)]
        unsafe fn setTexture_atIndex(
            &self,
            texture: Option<&ProtocolObject<dyn MTLTexture>>,
            index: NSUInteger,
        );

        #[cfg(all(feature = "MTLResource", feature = "MTLTexture"))]
        #[method(setTextures:withRange:)]
        unsafe fn setTextures_withRange(
            &self,
            textures: NonNull<*const ProtocolObject<dyn MTLTexture>>,
            range: NSRange,
        );

        #[cfg(feature = "MTLSampler")]
        #[method(setSamplerState:atIndex:)]
        unsafe fn setSamplerState_atIndex(
            &self,
            sampler: Option<&ProtocolObject<dyn MTLSamplerState>>,
            index: NSUInteger,
        );

        #[cfg(feature = "MTLSampler")]
        #[method(setSamplerStates:withRange:)]
        unsafe fn setSamplerStates_withRange(
            &self,
            samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>,
            range: NSRange,
        );

        #[method(constantDataAtIndex:)]
        unsafe fn constantDataAtIndex(&self, index: NSUInteger) -> NonNull<c_void>;

        #[cfg(feature = "MTLRenderPipeline")]
        #[method(setRenderPipelineState:atIndex:)]
        unsafe fn setRenderPipelineState_atIndex(
            &self,
            pipeline: Option<&ProtocolObject<dyn MTLRenderPipelineState>>,
            index: NSUInteger,
        );

        #[cfg(feature = "MTLRenderPipeline")]
        #[method(setRenderPipelineStates:withRange:)]
        unsafe fn setRenderPipelineStates_withRange(
            &self,
            pipelines: NonNull<*const ProtocolObject<dyn MTLRenderPipelineState>>,
            range: NSRange,
        );

        #[cfg(feature = "MTLComputePipeline")]
        #[method(setComputePipelineState:atIndex:)]
        unsafe fn setComputePipelineState_atIndex(
            &self,
            pipeline: Option<&ProtocolObject<dyn MTLComputePipelineState>>,
            index: NSUInteger,
        );

        #[cfg(feature = "MTLComputePipeline")]
        #[method(setComputePipelineStates:withRange:)]
        unsafe fn setComputePipelineStates_withRange(
            &self,
            pipelines: NonNull<*const ProtocolObject<dyn MTLComputePipelineState>>,
            range: NSRange,
        );

        #[cfg(all(feature = "MTLIndirectCommandBuffer", feature = "MTLResource"))]
        #[method(setIndirectCommandBuffer:atIndex:)]
        unsafe fn setIndirectCommandBuffer_atIndex(
            &self,
            indirect_command_buffer: Option<&ProtocolObject<dyn MTLIndirectCommandBuffer>>,
            index: NSUInteger,
        );

        #[cfg(all(feature = "MTLIndirectCommandBuffer", feature = "MTLResource"))]
        #[method(setIndirectCommandBuffers:withRange:)]
        unsafe fn setIndirectCommandBuffers_withRange(
            &self,
            buffers: NonNull<*const ProtocolObject<dyn MTLIndirectCommandBuffer>>,
            range: NSRange,
        );

        #[cfg(all(feature = "MTLAccelerationStructure", feature = "MTLResource"))]
        #[method(setAccelerationStructure:atIndex:)]
        unsafe fn setAccelerationStructure_atIndex(
            &self,
            acceleration_structure: Option<&ProtocolObject<dyn MTLAccelerationStructure>>,
            index: NSUInteger,
        );

        #[method_id(@__retain_semantics New newArgumentEncoderForBufferAtIndex:)]
        unsafe fn newArgumentEncoderForBufferAtIndex(
            &self,
            index: NSUInteger,
        ) -> Option<Retained<ProtocolObject<dyn MTLArgumentEncoder>>>;

        #[cfg(all(feature = "MTLResource", feature = "MTLVisibleFunctionTable"))]
        #[method(setVisibleFunctionTable:atIndex:)]
        unsafe fn setVisibleFunctionTable_atIndex(
            &self,
            visible_function_table: Option<&ProtocolObject<dyn MTLVisibleFunctionTable>>,
            index: NSUInteger,
        );

        #[cfg(all(feature = "MTLResource", feature = "MTLVisibleFunctionTable"))]
        #[method(setVisibleFunctionTables:withRange:)]
        unsafe fn setVisibleFunctionTables_withRange(
            &self,
            visible_function_tables: NonNull<*const ProtocolObject<dyn MTLVisibleFunctionTable>>,
            range: NSRange,
        );

        #[cfg(all(feature = "MTLIntersectionFunctionTable", feature = "MTLResource"))]
        #[method(setIntersectionFunctionTable:atIndex:)]
        unsafe fn setIntersectionFunctionTable_atIndex(
            &self,
            intersection_function_table: Option<&ProtocolObject<dyn MTLIntersectionFunctionTable>>,
            index: NSUInteger,
        );

        #[cfg(all(feature = "MTLIntersectionFunctionTable", feature = "MTLResource"))]
        #[method(setIntersectionFunctionTables:withRange:)]
        unsafe fn setIntersectionFunctionTables_withRange(
            &self,
            intersection_function_tables: NonNull<
                *const ProtocolObject<dyn MTLIntersectionFunctionTable>,
            >,
            range: NSRange,
        );
    }

    unsafe impl ProtocolType for dyn MTLArgumentEncoder {}
);