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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
/* automatically generated by rust-bindgen */

#[doc = " Vertex attribute stream, similar to glVertexPointer"]
#[doc = " Each element takes size bytes, with stride controlling the spacing between successive elements."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct meshopt_Stream {
    pub data: *const ::std::os::raw::c_void,
    pub size: usize,
    pub stride: usize,
}
extern "C" {
    #[doc = " Generates a vertex remap table from the vertex buffer and an optional index buffer and returns number of unique vertices"]
    #[doc = " As a result, all vertices that are binary equivalent map to the same (new) location, with no gaps in the resulting sequence."]
    #[doc = " Resulting remap table maps old vertices to new vertices and can be used in meshopt_remapVertexBuffer/meshopt_remapIndexBuffer."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the resulting remap table (vertex_count elements)"]
    #[doc = " indices can be NULL if the input is unindexed"]
    pub fn meshopt_generateVertexRemap(
        destination: *mut ::std::os::raw::c_uint,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertices: *const ::std::os::raw::c_void,
        vertex_count: usize,
        vertex_size: usize,
    ) -> usize;
}
extern "C" {
    #[doc = " Generates a vertex remap table from multiple vertex streams and an optional index buffer and returns number of unique vertices"]
    #[doc = " As a result, all vertices that are binary equivalent map to the same (new) location, with no gaps in the resulting sequence."]
    #[doc = " Resulting remap table maps old vertices to new vertices and can be used in meshopt_remapVertexBuffer/meshopt_remapIndexBuffer."]
    #[doc = " To remap vertex buffers, you will need to call meshopt_remapVertexBuffer for each vertex stream."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the resulting remap table (vertex_count elements)"]
    #[doc = " indices can be NULL if the input is unindexed"]
    pub fn meshopt_generateVertexRemapMulti(
        destination: *mut ::std::os::raw::c_uint,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertex_count: usize,
        streams: *const meshopt_Stream,
        stream_count: usize,
    ) -> usize;
}
extern "C" {
    #[doc = " Generates vertex buffer from the source vertex buffer and remap table generated by meshopt_generateVertexRemap"]
    #[doc = ""]
    #[doc = " destination must contain enough space for the resulting vertex buffer (unique_vertex_count elements, returned by meshopt_generateVertexRemap)"]
    #[doc = " vertex_count should be the initial vertex count and not the value returned by meshopt_generateVertexRemap"]
    pub fn meshopt_remapVertexBuffer(
        destination: *mut ::std::os::raw::c_void,
        vertices: *const ::std::os::raw::c_void,
        vertex_count: usize,
        vertex_size: usize,
        remap: *const ::std::os::raw::c_uint,
    );
}
extern "C" {
    #[doc = " Generate index buffer from the source index buffer and remap table generated by meshopt_generateVertexRemap"]
    #[doc = ""]
    #[doc = " destination must contain enough space for the resulting index buffer (index_count elements)"]
    #[doc = " indices can be NULL if the input is unindexed"]
    pub fn meshopt_remapIndexBuffer(
        destination: *mut ::std::os::raw::c_uint,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        remap: *const ::std::os::raw::c_uint,
    );
}
extern "C" {
    #[doc = " Generate index buffer that can be used for more efficient rendering when only a subset of the vertex attributes is necessary"]
    #[doc = " All vertices that are binary equivalent (wrt first vertex_size bytes) map to the first vertex in the original vertex buffer."]
    #[doc = " This makes it possible to use the index buffer for Z pre-pass or shadowmap rendering, while using the original index buffer for regular rendering."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the resulting index buffer (index_count elements)"]
    pub fn meshopt_generateShadowIndexBuffer(
        destination: *mut ::std::os::raw::c_uint,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertices: *const ::std::os::raw::c_void,
        vertex_count: usize,
        vertex_size: usize,
        vertex_stride: usize,
    );
}
extern "C" {
    #[doc = " Generate index buffer that can be used for more efficient rendering when only a subset of the vertex attributes is necessary"]
    #[doc = " All vertices that are binary equivalent (wrt specified streams) map to the first vertex in the original vertex buffer."]
    #[doc = " This makes it possible to use the index buffer for Z pre-pass or shadowmap rendering, while using the original index buffer for regular rendering."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the resulting index buffer (index_count elements)"]
    pub fn meshopt_generateShadowIndexBufferMulti(
        destination: *mut ::std::os::raw::c_uint,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertex_count: usize,
        streams: *const meshopt_Stream,
        stream_count: usize,
    );
}
extern "C" {
    #[doc = " Vertex transform cache optimizer"]
    #[doc = " Reorders indices to reduce the number of GPU vertex shader invocations"]
    #[doc = " If index buffer contains multiple ranges for multiple draw calls, this functions needs to be called on each range individually."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the resulting index buffer (index_count elements)"]
    pub fn meshopt_optimizeVertexCache(
        destination: *mut ::std::os::raw::c_uint,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertex_count: usize,
    );
}
extern "C" {
    #[doc = " Vertex transform cache optimizer for FIFO caches"]
    #[doc = " Reorders indices to reduce the number of GPU vertex shader invocations"]
    #[doc = " Generally takes ~3x less time to optimize meshes but produces inferior results compared to meshopt_optimizeVertexCache"]
    #[doc = " If index buffer contains multiple ranges for multiple draw calls, this functions needs to be called on each range individually."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the resulting index buffer (index_count elements)"]
    #[doc = " cache_size should be less than the actual GPU cache size to avoid cache thrashing"]
    pub fn meshopt_optimizeVertexCacheFifo(
        destination: *mut ::std::os::raw::c_uint,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertex_count: usize,
        cache_size: ::std::os::raw::c_uint,
    );
}
extern "C" {
    #[doc = " Overdraw optimizer"]
    #[doc = " Reorders indices to reduce the number of GPU vertex shader invocations and the pixel overdraw"]
    #[doc = " If index buffer contains multiple ranges for multiple draw calls, this functions needs to be called on each range individually."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the resulting index buffer (index_count elements)"]
    #[doc = " indices must contain index data that is the result of meshopt_optimizeVertexCache (*not* the original mesh indices!)"]
    #[doc = " vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer"]
    #[doc = " threshold indicates how much the overdraw optimizer can degrade vertex cache efficiency (1.05 = up to 5%) to reduce overdraw more efficiently"]
    pub fn meshopt_optimizeOverdraw(
        destination: *mut ::std::os::raw::c_uint,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertex_positions: *const f32,
        vertex_count: usize,
        vertex_positions_stride: usize,
        threshold: f32,
    );
}
extern "C" {
    #[doc = " Vertex fetch cache optimizer"]
    #[doc = " Reorders vertices and changes indices to reduce the amount of GPU memory fetches during vertex processing"]
    #[doc = " Returns the number of unique vertices, which is the same as input vertex count unless some vertices are unused"]
    #[doc = " This functions works for a single vertex stream; for multiple vertex streams, use meshopt_optimizeVertexFetchRemap + meshopt_remapVertexBuffer for each stream."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the resulting vertex buffer (vertex_count elements)"]
    #[doc = " indices is used both as an input and as an output index buffer"]
    pub fn meshopt_optimizeVertexFetch(
        destination: *mut ::std::os::raw::c_void,
        indices: *mut ::std::os::raw::c_uint,
        index_count: usize,
        vertices: *const ::std::os::raw::c_void,
        vertex_count: usize,
        vertex_size: usize,
    ) -> usize;
}
extern "C" {
    #[doc = " Vertex fetch cache optimizer"]
    #[doc = " Generates vertex remap to reduce the amount of GPU memory fetches during vertex processing"]
    #[doc = " Returns the number of unique vertices, which is the same as input vertex count unless some vertices are unused"]
    #[doc = " The resulting remap table should be used to reorder vertex/index buffers using meshopt_remapVertexBuffer/meshopt_remapIndexBuffer"]
    #[doc = ""]
    #[doc = " destination must contain enough space for the resulting remap table (vertex_count elements)"]
    pub fn meshopt_optimizeVertexFetchRemap(
        destination: *mut ::std::os::raw::c_uint,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertex_count: usize,
    ) -> usize;
}
extern "C" {
    #[doc = " Index buffer encoder"]
    #[doc = " Encodes index data into an array of bytes that is generally much smaller (<1.5 bytes/triangle) and compresses better (<1 bytes/triangle) compared to original."]
    #[doc = " Returns encoded data size on success, 0 on error; the only error condition is if buffer doesn't have enough space"]
    #[doc = " For maximum efficiency the index buffer being encoded has to be optimized for vertex cache and vertex fetch first."]
    #[doc = ""]
    #[doc = " buffer must contain enough space for the encoded index buffer (use meshopt_encodeIndexBufferBound to compute worst case size)"]
    pub fn meshopt_encodeIndexBuffer(
        buffer: *mut ::std::os::raw::c_uchar,
        buffer_size: usize,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
    ) -> usize;
}
extern "C" {
    pub fn meshopt_encodeIndexBufferBound(index_count: usize, vertex_count: usize) -> usize;
}
extern "C" {
    #[doc = " Index buffer decoder"]
    #[doc = " Decodes index data from an array of bytes generated by meshopt_encodeIndexBuffer"]
    #[doc = " Returns 0 if decoding was successful, and an error code otherwise"]
    #[doc = " The decoder is safe to use for untrusted input, but it may produce garbage data (e.g. out of range indices)."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the resulting index buffer (index_count elements)"]
    pub fn meshopt_decodeIndexBuffer(
        destination: *mut ::std::os::raw::c_void,
        index_count: usize,
        index_size: usize,
        buffer: *const ::std::os::raw::c_uchar,
        buffer_size: usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " Vertex buffer encoder"]
    #[doc = " Encodes vertex data into an array of bytes that is generally smaller and compresses better compared to original."]
    #[doc = " Returns encoded data size on success, 0 on error; the only error condition is if buffer doesn't have enough space"]
    #[doc = " This function works for a single vertex stream; for multiple vertex streams, call meshopt_encodeVertexBuffer for each stream."]
    #[doc = ""]
    #[doc = " buffer must contain enough space for the encoded vertex buffer (use meshopt_encodeVertexBufferBound to compute worst case size)"]
    pub fn meshopt_encodeVertexBuffer(
        buffer: *mut ::std::os::raw::c_uchar,
        buffer_size: usize,
        vertices: *const ::std::os::raw::c_void,
        vertex_count: usize,
        vertex_size: usize,
    ) -> usize;
}
extern "C" {
    pub fn meshopt_encodeVertexBufferBound(vertex_count: usize, vertex_size: usize) -> usize;
}
extern "C" {
    #[doc = " Vertex buffer decoder"]
    #[doc = " Decodes vertex data from an array of bytes generated by meshopt_encodeVertexBuffer"]
    #[doc = " Returns 0 if decoding was successful, and an error code otherwise"]
    #[doc = " The decoder is safe to use for untrusted input, but it may produce garbage data."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the resulting vertex buffer (vertex_count * vertex_size bytes)"]
    pub fn meshopt_decodeVertexBuffer(
        destination: *mut ::std::os::raw::c_void,
        vertex_count: usize,
        vertex_size: usize,
        buffer: *const ::std::os::raw::c_uchar,
        buffer_size: usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " Experimental: Mesh simplifier"]
    #[doc = " Reduces the number of triangles in the mesh, attempting to preserve mesh appearance as much as possible"]
    #[doc = " The algorithm tries to preserve mesh topology and can stop short of the target goal based on topology constraints or target error."]
    #[doc = " If not all attributes from the input mesh are required, it's recommended to reindex the mesh using meshopt_generateShadowIndexBuffer prior to simplification."]
    #[doc = " Returns the number of indices after simplification, with destination containing new index data"]
    #[doc = " The resulting index buffer references vertices from the original vertex buffer."]
    #[doc = " If the original vertex data isn't required, creating a compact vertex buffer using meshopt_optimizeVertexFetch is recommended."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the *source* index buffer (since optimization is iterative, this means index_count elements - *not* target_index_count!)"]
    #[doc = " vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer"]
    pub fn meshopt_simplify(
        destination: *mut ::std::os::raw::c_uint,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertex_positions: *const f32,
        vertex_count: usize,
        vertex_positions_stride: usize,
        target_index_count: usize,
        target_error: f32,
    ) -> usize;
}
extern "C" {
    #[doc = " Experimental: Mesh simplifier (sloppy)"]
    #[doc = " Reduces the number of triangles in the mesh, sacrificing mesh apperance for simplification performance"]
    #[doc = " The algorithm doesn't preserve mesh topology but is always able to reach target triangle count."]
    #[doc = " Returns the number of indices after simplification, with destination containing new index data"]
    #[doc = " The resulting index buffer references vertices from the original vertex buffer."]
    #[doc = " If the original vertex data isn't required, creating a compact vertex buffer using meshopt_optimizeVertexFetch is recommended."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the target index buffer"]
    #[doc = " vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer"]
    pub fn meshopt_simplifySloppy(
        destination: *mut ::std::os::raw::c_uint,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertex_positions: *const f32,
        vertex_count: usize,
        vertex_positions_stride: usize,
        target_index_count: usize,
    ) -> usize;
}
extern "C" {
    #[doc = " Experimental: Point cloud simplifier"]
    #[doc = " Reduces the number of points in the cloud to reach the given target"]
    #[doc = " Returns the number of points after simplification, with destination containing new index data"]
    #[doc = " The resulting index buffer references vertices from the original vertex buffer."]
    #[doc = " If the original vertex data isn't required, creating a compact vertex buffer using meshopt_optimizeVertexFetch is recommended."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the target index buffer"]
    #[doc = " vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer"]
    pub fn meshopt_simplifyPoints(
        destination: *mut ::std::os::raw::c_uint,
        vertex_positions: *const f32,
        vertex_count: usize,
        vertex_positions_stride: usize,
        target_vertex_count: usize,
    ) -> usize;
}
extern "C" {
    #[doc = " Mesh stripifier"]
    #[doc = " Converts a previously vertex cache optimized triangle list to triangle strip, stitching strips using restart index or degenerate triangles"]
    #[doc = " Returns the number of indices in the resulting strip, with destination containing new index data"]
    #[doc = " For maximum efficiency the index buffer being converted has to be optimized for vertex cache first."]
    #[doc = " Using restart indices can result in ~10% smaller index buffers, but on some GPUs restart indices may result in decreased performance."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the target index buffer, worst case can be computed with meshopt_stripifyBound"]
    #[doc = " restart_index should be 0xffff or 0xffffffff depending on index size, or 0 to use degenerate triangles"]
    pub fn meshopt_stripify(
        destination: *mut ::std::os::raw::c_uint,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertex_count: usize,
        restart_index: ::std::os::raw::c_uint,
    ) -> usize;
}
extern "C" {
    pub fn meshopt_stripifyBound(index_count: usize) -> usize;
}
extern "C" {
    #[doc = " Mesh unstripifier"]
    #[doc = " Converts a triangle strip to a triangle list"]
    #[doc = " Returns the number of indices in the resulting list, with destination containing new index data"]
    #[doc = ""]
    #[doc = " destination must contain enough space for the target index buffer, worst case can be computed with meshopt_unstripifyBound"]
    pub fn meshopt_unstripify(
        destination: *mut ::std::os::raw::c_uint,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        restart_index: ::std::os::raw::c_uint,
    ) -> usize;
}
extern "C" {
    pub fn meshopt_unstripifyBound(index_count: usize) -> usize;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct meshopt_VertexCacheStatistics {
    pub vertices_transformed: ::std::os::raw::c_uint,
    pub warps_executed: ::std::os::raw::c_uint,
    pub acmr: f32,
    pub atvr: f32,
}
extern "C" {
    #[doc = " Vertex transform cache analyzer"]
    #[doc = " Returns cache hit statistics using a simplified FIFO model"]
    #[doc = " Results may not match actual GPU performance"]
    pub fn meshopt_analyzeVertexCache(
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertex_count: usize,
        cache_size: ::std::os::raw::c_uint,
        warp_size: ::std::os::raw::c_uint,
        primgroup_size: ::std::os::raw::c_uint,
    ) -> meshopt_VertexCacheStatistics;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct meshopt_OverdrawStatistics {
    pub pixels_covered: ::std::os::raw::c_uint,
    pub pixels_shaded: ::std::os::raw::c_uint,
    pub overdraw: f32,
}
extern "C" {
    #[doc = " Overdraw analyzer"]
    #[doc = " Returns overdraw statistics using a software rasterizer"]
    #[doc = " Results may not match actual GPU performance"]
    #[doc = ""]
    #[doc = " vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer"]
    pub fn meshopt_analyzeOverdraw(
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertex_positions: *const f32,
        vertex_count: usize,
        vertex_positions_stride: usize,
    ) -> meshopt_OverdrawStatistics;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct meshopt_VertexFetchStatistics {
    pub bytes_fetched: ::std::os::raw::c_uint,
    pub overfetch: f32,
}
extern "C" {
    #[doc = " Vertex fetch cache analyzer"]
    #[doc = " Returns cache hit statistics using a simplified direct mapped model"]
    #[doc = " Results may not match actual GPU performance"]
    pub fn meshopt_analyzeVertexFetch(
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertex_count: usize,
        vertex_size: usize,
    ) -> meshopt_VertexFetchStatistics;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct meshopt_Meshlet {
    pub vertices: [::std::os::raw::c_uint; 64usize],
    pub indices: [[::std::os::raw::c_uchar; 3usize]; 126usize],
    pub triangle_count: ::std::os::raw::c_uchar,
    pub vertex_count: ::std::os::raw::c_uchar,
}
impl ::std::fmt::Debug for meshopt_Meshlet {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write ! ( f , "meshopt_Meshlet {{ vertices: [{}], indices: [{}], triangle_count: {:?}, vertex_count: {:?} }}" , self . vertices . iter ( ) . enumerate ( ) . map ( | ( i , v ) | format ! ( "{}{:?}" , if i > 0 { ", " } else { "" } , v ) ) . collect :: < String > ( ) , self . indices . iter ( ) . enumerate ( ) . map ( | ( i , v ) | format ! ( "{}{:?}" , if i > 0 { ", " } else { "" } , v ) ) . collect :: < String > ( ) , self . triangle_count , self . vertex_count )
    }
}
extern "C" {
    #[doc = " Experimental: Meshlet builder"]
    #[doc = " Splits the mesh into a set of meshlets where each meshlet has a micro index buffer indexing into meshlet vertices that refer to the original vertex buffer"]
    #[doc = " The resulting data can be used to render meshes using NVidia programmable mesh shading pipeline, or in other cluster-based renderers."]
    #[doc = " For maximum efficiency the index buffer being converted has to be optimized for vertex cache first."]
    #[doc = ""]
    #[doc = " destination must contain enough space for all meshlets, worst case size can be computed with meshopt_buildMeshletsBound"]
    #[doc = " max_vertices and max_triangles can't exceed limits statically declared in meshopt_Meshlet (max_vertices <= 64, max_triangles <= 126)"]
    pub fn meshopt_buildMeshlets(
        destination: *mut meshopt_Meshlet,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertex_count: usize,
        max_vertices: usize,
        max_triangles: usize,
    ) -> usize;
}
extern "C" {
    pub fn meshopt_buildMeshletsBound(
        index_count: usize,
        max_vertices: usize,
        max_triangles: usize,
    ) -> usize;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct meshopt_Bounds {
    pub center: [f32; 3usize],
    pub radius: f32,
    pub cone_apex: [f32; 3usize],
    pub cone_axis: [f32; 3usize],
    pub cone_cutoff: f32,
    pub cone_axis_s8: [::std::os::raw::c_schar; 3usize],
    pub cone_cutoff_s8: ::std::os::raw::c_schar,
}
extern "C" {
    #[doc = " Experimental: Cluster bounds generator"]
    #[doc = " Creates bounding volumes that can be used for frustum, backface and occlusion culling."]
    #[doc = ""]
    #[doc = " For backface culling with orthographic projection, use the following formula to reject backfacing clusters:"]
    #[doc = "   dot(view, cone_axis) >= cone_cutoff"]
    #[doc = ""]
    #[doc = " For perspective projection, you can the formula that needs cone apex in addition to axis & cutoff:"]
    #[doc = "   dot(normalize(cone_apex - camera_position), cone_axis) >= cone_cutoff"]
    #[doc = ""]
    #[doc = " Alternatively, you can use the formula that doesn't need cone apex and uses bounding sphere instead:"]
    #[doc = "   dot(normalize(center - camera_position), cone_axis) >= cone_cutoff + radius / length(center - camera_position)"]
    #[doc = " or an equivalent formula that doesn't have a singularity at center = camera_position:"]
    #[doc = "   dot(center - camera_position, cone_axis) >= cone_cutoff * length(center - camera_position) + radius"]
    #[doc = ""]
    #[doc = " The formula that uses the apex is slightly more accurate but needs the apex; if you are already using bounding sphere"]
    #[doc = " to do frustum/occlusion culling, the formula that doesn't use the apex may be preferable."]
    #[doc = ""]
    #[doc = " vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer"]
    #[doc = " index_count should be less than or equal to 256*3 (the function assumes clusters of limited size)"]
    pub fn meshopt_computeClusterBounds(
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertex_positions: *const f32,
        vertex_count: usize,
        vertex_positions_stride: usize,
    ) -> meshopt_Bounds;
}
extern "C" {
    pub fn meshopt_computeMeshletBounds(
        meshlet: *const meshopt_Meshlet,
        vertex_positions: *const f32,
        vertex_count: usize,
        vertex_positions_stride: usize,
    ) -> meshopt_Bounds;
}
extern "C" {
    #[doc = " Experimental: Spatial sorter"]
    #[doc = " Generates a remap table that can be used to reorder points for spatial locality."]
    #[doc = " Resulting remap table maps old vertices to new vertices and can be used in meshopt_remapVertexBuffer."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the resulting remap table (vertex_count elements)"]
    pub fn meshopt_spatialSortRemap(
        destination: *mut ::std::os::raw::c_uint,
        vertex_positions: *const f32,
        vertex_count: usize,
        vertex_positions_stride: usize,
    );
}
extern "C" {
    #[doc = " Experimental: Spatial sorter"]
    #[doc = " Reorders triangles for spatial locality, and generates a new index buffer. The resulting index buffer can be used with other functions like optimizeVertexCache."]
    #[doc = ""]
    #[doc = " destination must contain enough space for the resulting index buffer (index_count elements)"]
    #[doc = " indices must contain index data that is the result of meshopt_optimizeVertexCache (*not* the original mesh indices!)"]
    #[doc = " vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer"]
    pub fn meshopt_spatialSortTriangles(
        destination: *mut ::std::os::raw::c_uint,
        indices: *const ::std::os::raw::c_uint,
        index_count: usize,
        vertex_positions: *const f32,
        vertex_count: usize,
        vertex_positions_stride: usize,
    );
}
extern "C" {
    #[doc = " Set allocation callbacks"]
    #[doc = " These callbacks will be used instead of the default operator new/operator delete for all temporary allocations in the library."]
    #[doc = " Note that all algorithms only allocate memory for temporary use."]
    #[doc = " allocate/deallocate are always called in a stack-like order - last pointer to be allocated is deallocated first."]
    pub fn meshopt_setAllocator(
        allocate: ::std::option::Option<
            unsafe extern "C" fn(arg1: usize) -> *mut ::std::os::raw::c_void,
        >,
        deallocate: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
    );
}