Skip to content

Commit 8cc792d

Browse files
committed
meshletcodec: Clarify header comments
In particular, decodeMeshlet now calls out the vertices=NULL/vertex_count=0 case as valid.
1 parent 7f3585d commit 8cc792d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/meshoptimizer.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ MESHOPTIMIZER_API int meshopt_decodeIndexSequence(void* destination, size_t inde
300300
* Encodes meshlet data into an array of bytes that is generally smaller and compresses better compared to original.
301301
* Returns encoded data size on success, 0 on error; the only error condition is if buffer doesn't have enough space
302302
* This function encodes a single meshlet; when encoding multiple meshlets, additional headers may be necessary to store vertex/triangle count and encoded size.
303-
* For maximum efficiency the meshlet being encoded should be optimized using meshopt_optimizeMeshlet; additionally, underlying vertex data should be optimized for locality (fetch).
303+
* For maximum efficiency the meshlet being encoded should be optimized using meshopt_optimizeMeshlet; additionally, vertex reference data should be optimized for locality (fetch).
304304
*
305305
* buffer must contain enough space for the encoded meshlet (use meshopt_encodeMeshletBound to compute worst case size)
306306
* vertices may be NULL, in which case vertex_count must be 0 and only triangle data is encoded
@@ -318,8 +318,9 @@ MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_encodeMeshletBound(size_t max_vertices
318318
* vertices must contain enough space for the resulting vertex data, aligned to 4 bytes (align(vertex_count * vertex_size, 4) bytes)
319319
* vertex_size must be 2 (16-bit vertex references) or 4 (32-bit vertex references)
320320
* triangles must contain enough space for the resulting triangle data, aligned to 4 bytes (align(triangle_count * triangle_size, 4) bytes)
321-
* triangle_size must be 3 (8-bit indices) or 4 (32-bit triangles, stored as (a) | (b << 8) | (c << 16))
321+
* triangle_size must be 3 (8-bit triangle indices) or 4 (32-bit packed triangles, stored as (a) | (b << 8) | (c << 16))
322322
* vertex_count, triangle_count match those used during encoding exactly; buffer_size must be equal to the encoded size returned by meshopt_encodeMeshlet.
323+
* vertices may be NULL, in which case vertex_count must be 0 and the meshlet must contain just triangle data
323324
*
324325
* When using "raw" decoding (meshopt_decodeMeshletRaw), both vertices and triangles should have available space further aligned to 16 bytes for efficient SIMD decoding.
325326
*/

0 commit comments

Comments
 (0)