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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use objc2_metal::*;
use crate::*;
extern_class!(
/// A vertex buffer and optional index and mask buffer for a set of polygons
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpspolygonbuffer?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated]
pub struct MPSPolygonBuffer;
);
extern_conformance!(
unsafe impl NSCoding for MPSPolygonBuffer {}
);
extern_conformance!(
unsafe impl NSCopying for MPSPolygonBuffer {}
);
unsafe impl CopyingHelper for MPSPolygonBuffer {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MPSPolygonBuffer {}
);
extern_conformance!(
unsafe impl NSSecureCoding for MPSPolygonBuffer {}
);
impl MPSPolygonBuffer {
extern_methods!(
/// Initialize the polygon buffer
#[deprecated]
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
/// Initialize the polygon buffer with an NSCoder. Buffer properties such as the vertex
/// buffer, instance buffer, etc. are set to nil. Encode and decode these buffers along with the
/// polygon buffer instead.
///
/// # Safety
///
/// `a_decoder` possibly has further requirements.
#[deprecated]
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
a_decoder: &NSCoder,
) -> Option<Retained<Self>>;
#[deprecated]
#[unsafe(method(polygonBuffer))]
#[unsafe(method_family = none)]
pub unsafe fn polygonBuffer() -> Retained<Self>;
/// Create a a copy of this polygon buffer
///
///
/// Buffer properties of the polygon buffer such as the vertex buffer, instance, buffer,
/// etc. are set to nil. Copy these buffers and assign them to the new polygon buffer or reassign
/// the existing buffers to the new polygon buffer.
///
///
/// Parameter `zone`: This parameter is ignored. Memory zones are no longer used by Objective-C.
///
/// # Safety
///
/// `zone` must be a valid pointer or null.
#[deprecated]
#[unsafe(method(copyWithZone:))]
#[unsafe(method_family = copy)]
pub unsafe fn copyWithZone(&self, zone: *mut NSZone) -> Retained<Self>;
/// Vertex buffer containing vertex data encoded as three 32 bit floats per vertex. Note
/// that by default each vertex is aligned to the alignment of the vector_float3 type: 16 bytes.
/// This can be changed using the vertexStride property. A vertex buffer must be provided before
/// the acceleration structure is built.
///
/// When using triangle polygons, degenerate (zero or negative area) triangles are ignored
/// during acceleration structure construction. This can be used to pad triangle indices if needed.
///
/// Quadrilateral polygons are internally treated as two triangles. If the quadrilateral has
/// vertices v0, v1, v2, and v3, the two triangles will have vertices v0, v1, v2 and v0, v2, v3.
/// A quadrilateral may be used to represent a triangle by repeating the last vertex. If the first
/// triangle is degenerate (zero or negative area), the entire quadrilateral will be ignored. This
/// can be used to pad quadrilateral indices if needed. All four vertices of a quadrilateral must
/// be coplanar and the quadrilateral must be convex.
#[deprecated]
#[unsafe(method(vertexBuffer))]
#[unsafe(method_family = none)]
pub unsafe fn vertexBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
/// Setter for [`vertexBuffer`][Self::vertexBuffer].
///
/// # Safety
///
/// - `vertex_buffer` may need to be synchronized.
/// - `vertex_buffer` may be unretained, you must ensure it is kept alive while in use.
/// - `vertex_buffer` contents should be of the correct type.
#[deprecated]
#[unsafe(method(setVertexBuffer:))]
#[unsafe(method_family = none)]
pub unsafe fn setVertexBuffer(&self, vertex_buffer: Option<&ProtocolObject<dyn MTLBuffer>>);
/// Offset, in bytes, into the vertex buffer. Defaults to 0 bytes. Must be aligned to 4
/// bytes.
#[deprecated]
#[unsafe(method(vertexBufferOffset))]
#[unsafe(method_family = none)]
pub unsafe fn vertexBufferOffset(&self) -> NSUInteger;
/// Setter for [`vertexBufferOffset`][Self::vertexBufferOffset].
#[deprecated]
#[unsafe(method(setVertexBufferOffset:))]
#[unsafe(method_family = none)]
pub unsafe fn setVertexBufferOffset(&self, vertex_buffer_offset: NSUInteger);
/// Index buffer containing index data. Each index references a vertex in the vertex buffer.
/// May be nil.
#[deprecated]
#[unsafe(method(indexBuffer))]
#[unsafe(method_family = none)]
pub unsafe fn indexBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
/// Setter for [`indexBuffer`][Self::indexBuffer].
///
/// # Safety
///
/// - `index_buffer` may need to be synchronized.
/// - `index_buffer` may be unretained, you must ensure it is kept alive while in use.
/// - `index_buffer` contents should be of the correct type.
#[deprecated]
#[unsafe(method(setIndexBuffer:))]
#[unsafe(method_family = none)]
pub unsafe fn setIndexBuffer(&self, index_buffer: Option<&ProtocolObject<dyn MTLBuffer>>);
/// Offset, in bytes, into the index buffer. Defaults to 0 bytes. Must be aligned to a
/// multiple of the index type. Changes to this property require rebuilding the acceleration
/// structure.
#[deprecated]
#[unsafe(method(indexBufferOffset))]
#[unsafe(method_family = none)]
pub unsafe fn indexBufferOffset(&self) -> NSUInteger;
/// Setter for [`indexBufferOffset`][Self::indexBufferOffset].
#[deprecated]
#[unsafe(method(setIndexBufferOffset:))]
#[unsafe(method_family = none)]
pub unsafe fn setIndexBufferOffset(&self, index_buffer_offset: NSUInteger);
/// Mask buffer containing one uint32_t mask per polygon. May be nil. Otherwise, the mask
/// type must be specified on the MPSRayIntersector with which it is used.
#[deprecated]
#[unsafe(method(maskBuffer))]
#[unsafe(method_family = none)]
pub unsafe fn maskBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
/// Setter for [`maskBuffer`][Self::maskBuffer].
///
/// # Safety
///
/// - `mask_buffer` may need to be synchronized.
/// - `mask_buffer` may be unretained, you must ensure it is kept alive while in use.
/// - `mask_buffer` contents should be of the correct type.
#[deprecated]
#[unsafe(method(setMaskBuffer:))]
#[unsafe(method_family = none)]
pub unsafe fn setMaskBuffer(&self, mask_buffer: Option<&ProtocolObject<dyn MTLBuffer>>);
/// Offset, in bytes, into the mask buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.
#[deprecated]
#[unsafe(method(maskBufferOffset))]
#[unsafe(method_family = none)]
pub unsafe fn maskBufferOffset(&self) -> NSUInteger;
/// Setter for [`maskBufferOffset`][Self::maskBufferOffset].
#[deprecated]
#[unsafe(method(setMaskBufferOffset:))]
#[unsafe(method_family = none)]
pub unsafe fn setMaskBufferOffset(&self, mask_buffer_offset: NSUInteger);
/// Number of polygons. Changes to this property require rebuilding the acceleration
/// structure.
#[deprecated]
#[unsafe(method(polygonCount))]
#[unsafe(method_family = none)]
pub unsafe fn polygonCount(&self) -> NSUInteger;
/// Setter for [`polygonCount`][Self::polygonCount].
#[deprecated]
#[unsafe(method(setPolygonCount:))]
#[unsafe(method_family = none)]
pub unsafe fn setPolygonCount(&self, polygon_count: NSUInteger);
);
}
/// Methods declared on superclass `NSObject`.
impl MPSPolygonBuffer {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}