Subdiv: Simplify final vertex counting #105159

Merged
Hans Goudey merged 1 commits from HooglyBoogly/blender:subdiv-vert-count-simplify into main 2023-02-26 23:58:00 +01:00

1 Commits

Author SHA1 Message Date
Hans Goudey 8377b9cc3e Subdiv: Simplify final vertex counting
The initial subdivision context counting ended up using unnecessarily
complicated logic to count the number of final vertices. In a first pass
it added vertices for every coarse edge. Then it added the same number
of vertices for every loose edge. That adds up to the same number of
vertices for the edges, so the separation is redundant and can be
replaced with a single multiplication.

In a test of a mesh with 2 million faces and 3 million vertices, this
saved 2.8ms (though the whole subdivision process takes around 700ms).
2023-02-23 18:37:39 -05:00