|
|
@@ -1,5 +1,5 @@
|
|
|
/**
|
|
|
- * meshoptimizer - version 0.19
|
|
|
+ * meshoptimizer - version 0.20
|
|
|
*
|
|
|
* Copyright (C) 2016-2023, by Arseny Kapoulkine ([email protected])
|
|
|
* Report bugs and download new versions at https://github.com/zeux/meshoptimizer
|
|
|
@@ -12,7 +12,7 @@
|
|
|
#include <stddef.h>
|
|
|
|
|
|
/* Version macro; major * 1000 + minor * 10 + patch */
|
|
|
-#define MESHOPTIMIZER_VERSION 190 /* 0.19 */
|
|
|
+#define MESHOPTIMIZER_VERSION 200 /* 0.20 */
|
|
|
|
|
|
/* If no API is defined, assume default */
|
|
|
#ifndef MESHOPTIMIZER_API
|
|
|
@@ -67,6 +67,7 @@ MESHOPTIMIZER_API size_t meshopt_generateVertexRemap(unsigned int* destination,
|
|
|
*
|
|
|
* destination must contain enough space for the resulting remap table (vertex_count elements)
|
|
|
* indices can be NULL if the input is unindexed
|
|
|
+ * stream_count must be <= 16
|
|
|
*/
|
|
|
MESHOPTIMIZER_API size_t meshopt_generateVertexRemapMulti(unsigned int* destination, const unsigned int* indices, size_t index_count, size_t vertex_count, const struct meshopt_Stream* streams, size_t stream_count);
|
|
|
|
|
|
@@ -103,6 +104,7 @@ MESHOPTIMIZER_API void meshopt_generateShadowIndexBuffer(unsigned int* destinati
|
|
|
* Note that binary equivalence considers all size bytes in each stream, including padding which should be zero-initialized.
|
|
|
*
|
|
|
* destination must contain enough space for the resulting index buffer (index_count elements)
|
|
|
+ * stream_count must be <= 16
|
|
|
*/
|
|
|
MESHOPTIMIZER_API void meshopt_generateShadowIndexBufferMulti(unsigned int* destination, const unsigned int* indices, size_t index_count, size_t vertex_count, const struct meshopt_Stream* streams, size_t stream_count);
|
|
|
|
|
|
@@ -354,6 +356,7 @@ MESHOPTIMIZER_API size_t meshopt_simplify(unsigned int* destination, const unsig
|
|
|
*
|
|
|
* vertex_attributes should have attribute_count floats for each vertex
|
|
|
* attribute_weights should have attribute_count floats in total; the weights determine relative priority of attributes between each other and wrt position. The recommended weight range is [1e-3..1e-1], assuming attribute data is in [0..1] range.
|
|
|
+ * attribute_count must be <= 16
|
|
|
* TODO target_error/result_error currently use combined distance+attribute error; this may change in the future
|
|
|
*/
|
|
|
MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, size_t target_index_count, float target_error, unsigned int options, float* result_error);
|
|
|
@@ -382,8 +385,9 @@ MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifySloppy(unsigned int* destinati
|
|
|
*
|
|
|
* destination must contain enough space for the target index buffer (target_vertex_count elements)
|
|
|
* vertex_positions should have float3 position in the first 12 bytes of each vertex
|
|
|
+ * vertex_colors should can be NULL; when it's not NULL, it should have float3 color in the first 12 bytes of each vertex
|
|
|
*/
|
|
|
-MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_vertex_count);
|
|
|
+MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_colors, size_t vertex_colors_stride, float color_weight, size_t target_vertex_count);
|
|
|
|
|
|
/**
|
|
|
* Returns the error scaling factor used by the simplifier to convert between absolute and relative extents
|
|
|
@@ -531,13 +535,14 @@ MESHOPTIMIZER_API struct meshopt_Bounds meshopt_computeClusterBounds(const unsig
|
|
|
MESHOPTIMIZER_API struct meshopt_Bounds meshopt_computeMeshletBounds(const unsigned int* meshlet_vertices, const unsigned char* meshlet_triangles, size_t triangle_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride);
|
|
|
|
|
|
/**
|
|
|
- * Experimental: Spatial sorter
|
|
|
+ * Spatial sorter
|
|
|
* Generates a remap table that can be used to reorder points for spatial locality.
|
|
|
* Resulting remap table maps old vertices to new vertices and can be used in meshopt_remapVertexBuffer.
|
|
|
*
|
|
|
* destination must contain enough space for the resulting remap table (vertex_count elements)
|
|
|
+ * vertex_positions should have float3 position in the first 12 bytes of each vertex
|
|
|
*/
|
|
|
-MESHOPTIMIZER_EXPERIMENTAL void meshopt_spatialSortRemap(unsigned int* destination, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride);
|
|
|
+MESHOPTIMIZER_API void meshopt_spatialSortRemap(unsigned int* destination, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride);
|
|
|
|
|
|
/**
|
|
|
* Experimental: Spatial sorter
|
|
|
@@ -642,11 +647,11 @@ inline size_t meshopt_encodeIndexSequence(unsigned char* buffer, size_t buffer_s
|
|
|
template <typename T>
|
|
|
inline int meshopt_decodeIndexSequence(T* destination, size_t index_count, const unsigned char* buffer, size_t buffer_size);
|
|
|
template <typename T>
|
|
|
-inline size_t meshopt_simplify(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options = 0, float* result_error = 0);
|
|
|
+inline size_t meshopt_simplify(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options = 0, float* result_error = NULL);
|
|
|
template <typename T>
|
|
|
-inline size_t meshopt_simplifyWithAttributes(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, size_t target_index_count, float target_error, unsigned int options = 0, float* result_error = 0);
|
|
|
+inline size_t meshopt_simplifyWithAttributes(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, size_t target_index_count, float target_error, unsigned int options = 0, float* result_error = NULL);
|
|
|
template <typename T>
|
|
|
-inline size_t meshopt_simplifySloppy(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* result_error = 0);
|
|
|
+inline size_t meshopt_simplifySloppy(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* result_error = NULL);
|
|
|
template <typename T>
|
|
|
inline size_t meshopt_stripify(T* destination, const T* indices, size_t index_count, size_t vertex_count, T restart_index);
|
|
|
template <typename T>
|
|
|
@@ -757,7 +762,7 @@ struct meshopt_IndexAdapter<T, false>
|
|
|
|
|
|
meshopt_IndexAdapter(T* result_, const T* input, size_t count_)
|
|
|
: result(result_)
|
|
|
- , data(0)
|
|
|
+ , data(NULL)
|
|
|
, count(count_)
|
|
|
{
|
|
|
size_t size = count > size_t(-1) / sizeof(unsigned int) ? size_t(-1) : count * sizeof(unsigned int);
|
|
|
@@ -797,33 +802,33 @@ struct meshopt_IndexAdapter<T, true>
|
|
|
template <typename T>
|
|
|
inline size_t meshopt_generateVertexRemap(unsigned int* destination, const T* indices, size_t index_count, const void* vertices, size_t vertex_count, size_t vertex_size)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, indices ? index_count : 0);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, indices ? index_count : 0);
|
|
|
|
|
|
- return meshopt_generateVertexRemap(destination, indices ? in.data : 0, index_count, vertices, vertex_count, vertex_size);
|
|
|
+ return meshopt_generateVertexRemap(destination, indices ? in.data : NULL, index_count, vertices, vertex_count, vertex_size);
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
inline size_t meshopt_generateVertexRemapMulti(unsigned int* destination, const T* indices, size_t index_count, size_t vertex_count, const meshopt_Stream* streams, size_t stream_count)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, indices ? index_count : 0);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, indices ? index_count : 0);
|
|
|
|
|
|
- return meshopt_generateVertexRemapMulti(destination, indices ? in.data : 0, index_count, vertex_count, streams, stream_count);
|
|
|
+ return meshopt_generateVertexRemapMulti(destination, indices ? in.data : NULL, index_count, vertex_count, streams, stream_count);
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
inline void meshopt_remapIndexBuffer(T* destination, const T* indices, size_t index_count, const unsigned int* remap)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, indices ? index_count : 0);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, indices ? index_count : 0);
|
|
|
meshopt_IndexAdapter<T> out(destination, 0, index_count);
|
|
|
|
|
|
- meshopt_remapIndexBuffer(out.data, indices ? in.data : 0, index_count, remap);
|
|
|
+ meshopt_remapIndexBuffer(out.data, indices ? in.data : NULL, index_count, remap);
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
inline void meshopt_generateShadowIndexBuffer(T* destination, const T* indices, size_t index_count, const void* vertices, size_t vertex_count, size_t vertex_size, size_t vertex_stride)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
- meshopt_IndexAdapter<T> out(destination, 0, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> out(destination, NULL, index_count);
|
|
|
|
|
|
meshopt_generateShadowIndexBuffer(out.data, in.data, index_count, vertices, vertex_count, vertex_size, vertex_stride);
|
|
|
}
|
|
|
@@ -831,8 +836,8 @@ inline void meshopt_generateShadowIndexBuffer(T* destination, const T* indices,
|
|
|
template <typename T>
|
|
|
inline void meshopt_generateShadowIndexBufferMulti(T* destination, const T* indices, size_t index_count, size_t vertex_count, const meshopt_Stream* streams, size_t stream_count)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
- meshopt_IndexAdapter<T> out(destination, 0, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> out(destination, NULL, index_count);
|
|
|
|
|
|
meshopt_generateShadowIndexBufferMulti(out.data, in.data, index_count, vertex_count, streams, stream_count);
|
|
|
}
|
|
|
@@ -840,8 +845,8 @@ inline void meshopt_generateShadowIndexBufferMulti(T* destination, const T* indi
|
|
|
template <typename T>
|
|
|
inline void meshopt_generateAdjacencyIndexBuffer(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
- meshopt_IndexAdapter<T> out(destination, 0, index_count * 2);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> out(destination, NULL, index_count * 2);
|
|
|
|
|
|
meshopt_generateAdjacencyIndexBuffer(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride);
|
|
|
}
|
|
|
@@ -849,8 +854,8 @@ inline void meshopt_generateAdjacencyIndexBuffer(T* destination, const T* indice
|
|
|
template <typename T>
|
|
|
inline void meshopt_generateTessellationIndexBuffer(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
- meshopt_IndexAdapter<T> out(destination, 0, index_count * 4);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> out(destination, NULL, index_count * 4);
|
|
|
|
|
|
meshopt_generateTessellationIndexBuffer(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride);
|
|
|
}
|
|
|
@@ -858,8 +863,8 @@ inline void meshopt_generateTessellationIndexBuffer(T* destination, const T* ind
|
|
|
template <typename T>
|
|
|
inline void meshopt_optimizeVertexCache(T* destination, const T* indices, size_t index_count, size_t vertex_count)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
- meshopt_IndexAdapter<T> out(destination, 0, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> out(destination, NULL, index_count);
|
|
|
|
|
|
meshopt_optimizeVertexCache(out.data, in.data, index_count, vertex_count);
|
|
|
}
|
|
|
@@ -867,8 +872,8 @@ inline void meshopt_optimizeVertexCache(T* destination, const T* indices, size_t
|
|
|
template <typename T>
|
|
|
inline void meshopt_optimizeVertexCacheStrip(T* destination, const T* indices, size_t index_count, size_t vertex_count)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
- meshopt_IndexAdapter<T> out(destination, 0, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> out(destination, NULL, index_count);
|
|
|
|
|
|
meshopt_optimizeVertexCacheStrip(out.data, in.data, index_count, vertex_count);
|
|
|
}
|
|
|
@@ -876,8 +881,8 @@ inline void meshopt_optimizeVertexCacheStrip(T* destination, const T* indices, s
|
|
|
template <typename T>
|
|
|
inline void meshopt_optimizeVertexCacheFifo(T* destination, const T* indices, size_t index_count, size_t vertex_count, unsigned int cache_size)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
- meshopt_IndexAdapter<T> out(destination, 0, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> out(destination, NULL, index_count);
|
|
|
|
|
|
meshopt_optimizeVertexCacheFifo(out.data, in.data, index_count, vertex_count, cache_size);
|
|
|
}
|
|
|
@@ -885,8 +890,8 @@ inline void meshopt_optimizeVertexCacheFifo(T* destination, const T* indices, si
|
|
|
template <typename T>
|
|
|
inline void meshopt_optimizeOverdraw(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, float threshold)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
- meshopt_IndexAdapter<T> out(destination, 0, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> out(destination, NULL, index_count);
|
|
|
|
|
|
meshopt_optimizeOverdraw(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, threshold);
|
|
|
}
|
|
|
@@ -894,7 +899,7 @@ inline void meshopt_optimizeOverdraw(T* destination, const T* indices, size_t in
|
|
|
template <typename T>
|
|
|
inline size_t meshopt_optimizeVertexFetchRemap(unsigned int* destination, const T* indices, size_t index_count, size_t vertex_count)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
|
|
|
return meshopt_optimizeVertexFetchRemap(destination, in.data, index_count, vertex_count);
|
|
|
}
|
|
|
@@ -910,7 +915,7 @@ inline size_t meshopt_optimizeVertexFetch(void* destination, T* indices, size_t
|
|
|
template <typename T>
|
|
|
inline size_t meshopt_encodeIndexBuffer(unsigned char* buffer, size_t buffer_size, const T* indices, size_t index_count)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
|
|
|
return meshopt_encodeIndexBuffer(buffer, buffer_size, in.data, index_count);
|
|
|
}
|
|
|
@@ -927,7 +932,7 @@ inline int meshopt_decodeIndexBuffer(T* destination, size_t index_count, const u
|
|
|
template <typename T>
|
|
|
inline size_t meshopt_encodeIndexSequence(unsigned char* buffer, size_t buffer_size, const T* indices, size_t index_count)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
|
|
|
return meshopt_encodeIndexSequence(buffer, buffer_size, in.data, index_count);
|
|
|
}
|
|
|
@@ -944,8 +949,8 @@ inline int meshopt_decodeIndexSequence(T* destination, size_t index_count, const
|
|
|
template <typename T>
|
|
|
inline size_t meshopt_simplify(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options, float* result_error)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
- meshopt_IndexAdapter<T> out(destination, 0, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> out(destination, NULL, index_count);
|
|
|
|
|
|
return meshopt_simplify(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, target_index_count, target_error, options, result_error);
|
|
|
}
|
|
|
@@ -953,8 +958,8 @@ inline size_t meshopt_simplify(T* destination, const T* indices, size_t index_co
|
|
|
template <typename T>
|
|
|
inline size_t meshopt_simplifyWithAttributes(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, size_t target_index_count, float target_error, unsigned int options, float* result_error)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
- meshopt_IndexAdapter<T> out(destination, 0, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> out(destination, NULL, index_count);
|
|
|
|
|
|
return meshopt_simplifyWithAttributes(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, vertex_attributes, vertex_attributes_stride, attribute_weights, attribute_count, target_index_count, target_error, options, result_error);
|
|
|
}
|
|
|
@@ -962,8 +967,8 @@ inline size_t meshopt_simplifyWithAttributes(T* destination, const T* indices, s
|
|
|
template <typename T>
|
|
|
inline size_t meshopt_simplifySloppy(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* result_error)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
- meshopt_IndexAdapter<T> out(destination, 0, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> out(destination, NULL, index_count);
|
|
|
|
|
|
return meshopt_simplifySloppy(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, target_index_count, target_error, result_error);
|
|
|
}
|
|
|
@@ -971,8 +976,8 @@ inline size_t meshopt_simplifySloppy(T* destination, const T* indices, size_t in
|
|
|
template <typename T>
|
|
|
inline size_t meshopt_stripify(T* destination, const T* indices, size_t index_count, size_t vertex_count, T restart_index)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
- meshopt_IndexAdapter<T> out(destination, 0, (index_count / 3) * 5);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> out(destination, NULL, (index_count / 3) * 5);
|
|
|
|
|
|
return meshopt_stripify(out.data, in.data, index_count, vertex_count, unsigned(restart_index));
|
|
|
}
|
|
|
@@ -980,8 +985,8 @@ inline size_t meshopt_stripify(T* destination, const T* indices, size_t index_co
|
|
|
template <typename T>
|
|
|
inline size_t meshopt_unstripify(T* destination, const T* indices, size_t index_count, T restart_index)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
- meshopt_IndexAdapter<T> out(destination, 0, (index_count - 2) * 3);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> out(destination, NULL, (index_count - 2) * 3);
|
|
|
|
|
|
return meshopt_unstripify(out.data, in.data, index_count, unsigned(restart_index));
|
|
|
}
|
|
|
@@ -989,7 +994,7 @@ inline size_t meshopt_unstripify(T* destination, const T* indices, size_t index_
|
|
|
template <typename T>
|
|
|
inline meshopt_VertexCacheStatistics meshopt_analyzeVertexCache(const T* indices, size_t index_count, size_t vertex_count, unsigned int cache_size, unsigned int warp_size, unsigned int buffer_size)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
|
|
|
return meshopt_analyzeVertexCache(in.data, index_count, vertex_count, cache_size, warp_size, buffer_size);
|
|
|
}
|
|
|
@@ -997,7 +1002,7 @@ inline meshopt_VertexCacheStatistics meshopt_analyzeVertexCache(const T* indices
|
|
|
template <typename T>
|
|
|
inline meshopt_OverdrawStatistics meshopt_analyzeOverdraw(const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
|
|
|
return meshopt_analyzeOverdraw(in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride);
|
|
|
}
|
|
|
@@ -1005,7 +1010,7 @@ inline meshopt_OverdrawStatistics meshopt_analyzeOverdraw(const T* indices, size
|
|
|
template <typename T>
|
|
|
inline meshopt_VertexFetchStatistics meshopt_analyzeVertexFetch(const T* indices, size_t index_count, size_t vertex_count, size_t vertex_size)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
|
|
|
return meshopt_analyzeVertexFetch(in.data, index_count, vertex_count, vertex_size);
|
|
|
}
|
|
|
@@ -1013,7 +1018,7 @@ inline meshopt_VertexFetchStatistics meshopt_analyzeVertexFetch(const T* indices
|
|
|
template <typename T>
|
|
|
inline size_t meshopt_buildMeshlets(meshopt_Meshlet* meshlets, unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t max_vertices, size_t max_triangles, float cone_weight)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
|
|
|
return meshopt_buildMeshlets(meshlets, meshlet_vertices, meshlet_triangles, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, max_vertices, max_triangles, cone_weight);
|
|
|
}
|
|
|
@@ -1021,7 +1026,7 @@ inline size_t meshopt_buildMeshlets(meshopt_Meshlet* meshlets, unsigned int* mes
|
|
|
template <typename T>
|
|
|
inline size_t meshopt_buildMeshletsScan(meshopt_Meshlet* meshlets, unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, const T* indices, size_t index_count, size_t vertex_count, size_t max_vertices, size_t max_triangles)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
|
|
|
return meshopt_buildMeshletsScan(meshlets, meshlet_vertices, meshlet_triangles, in.data, index_count, vertex_count, max_vertices, max_triangles);
|
|
|
}
|
|
|
@@ -1029,7 +1034,7 @@ inline size_t meshopt_buildMeshletsScan(meshopt_Meshlet* meshlets, unsigned int*
|
|
|
template <typename T>
|
|
|
inline meshopt_Bounds meshopt_computeClusterBounds(const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
|
|
|
return meshopt_computeClusterBounds(in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride);
|
|
|
}
|
|
|
@@ -1037,8 +1042,8 @@ inline meshopt_Bounds meshopt_computeClusterBounds(const T* indices, size_t inde
|
|
|
template <typename T>
|
|
|
inline void meshopt_spatialSortTriangles(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride)
|
|
|
{
|
|
|
- meshopt_IndexAdapter<T> in(0, indices, index_count);
|
|
|
- meshopt_IndexAdapter<T> out(destination, 0, index_count);
|
|
|
+ meshopt_IndexAdapter<T> in(NULL, indices, index_count);
|
|
|
+ meshopt_IndexAdapter<T> out(destination, NULL, index_count);
|
|
|
|
|
|
meshopt_spatialSortTriangles(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride);
|
|
|
}
|