So far the brush refactors haven't affected the multires implementations
much. Besides replacing the vertex iteration macro they are fundamentally
the same. This commit refactors the multires implementations to use the
same structure as the base mesh code. The motivations are improving CPU
cache use, removing constant checks from hot loops, and allowing use of
SIMD. This generally works by gathering the AoS multires format into
local arrays.
Quite a few brush evaluation functions have been duplicated to work on
non-indexed data. This will be necessary as we start to handle brushes
that use original data anyway. I don't think this duplication is very
bad though; since the functions are right next to each other it's easy
to change them at the same time. In the future we might investigate
gathering data into local arrays for the mesh implementations too.
In the brush benchmark file from #118145, this improved brush evaluation
performance by roughly 15%, mostly by removing the separate step of
accumulating changes with the proxies system.
Pull Request: https://projects.blender.org/blender/blender/pulls/123703