mirror of
https://github.com/openharmony/third_party_meshoptimizer.git
synced 2026-07-20 23:46:19 -04:00
737c2697e0
Previously, we would only read vertex_lock data for the primary vertex (the vertex with the smallest index among those with the same position). When using sparse mode, this would be the first vertex referenced by the index buffer due to how the sparse remap works. If the input locks were inconsistent between all copies, there could be a situation where a vertex with the wrong index was asked to be locked, and the vertex would still be not-locked and could move. When *not* using sparse mode, this was particularly problematic as the flags would be read from the vertex that might not be referenced by the index buffer at all. We now propagate the locked status into the primary vertex in a separate pass; this requires re-locking the wedges in a separate pass, but all of this is very quick especially when using sparse mode.