summaryrefslogtreecommitdiff
path: root/indra/llmeshoptimizer
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-07-12 16:47:45 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-07-12 16:50:10 +0300
commiteb13133e3e0020c73399414cea4d9b39ef526cd3 (patch)
tree483afbc59153a21b70d9acbc124b6f6f533c8dde /indra/llmeshoptimizer
parent17131ac20336b5561b574a9c121c6a5876be2d53 (diff)
DRTVWR-542 WIP #5
Diffstat (limited to 'indra/llmeshoptimizer')
-rw-r--r--indra/llmeshoptimizer/llmeshoptimizer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/llmeshoptimizer/llmeshoptimizer.cpp b/indra/llmeshoptimizer/llmeshoptimizer.cpp
index 02e97ef984..dbf8e5b631 100644
--- a/indra/llmeshoptimizer/llmeshoptimizer.cpp
+++ b/indra/llmeshoptimizer/llmeshoptimizer.cpp
@@ -50,12 +50,17 @@ U64 LLMeshOptimizer::simplify(U16 *destination,
F32* result_error
)
{
+ const size_t vertex_stride = 4; // should be either 0 or 4
+
+ // Consider running meshopt_generateShadowIndexBuffer<unsigned short> first.
+ // meshopt_generateShadowIndexBuffer is only needed if models don't use some of the vertices,
+ // but since we call optimize() in a lot of cases, it likely isn't needed
return meshopt_simplify<unsigned short>(destination,
indices,
index_count,
(const float*)vertex_positions, // verify that it is correct to convert to float
vertex_count,
- sizeof(LLVector4a), // should be either 0 or 4
+ vertex_stride,
target_index_count,
target_error,
result_error