087612c042
Many high-level functions with unrelated code were templated based on the color attribute domain and type. In the end, those were just a few branches though, similar to other branches. So to reduce binary bloat and clarify code, move tempates to the point where separate types are actually needed. Also move constant code out of loops, and use generic arrays and spans to store some caches. The binary ended up 53 KB smaller for me, which isn't much but it's in the right direction. Performance wise nothing really changes. The vast majority of time in vertex paint is spent on unrelated things like calculating normals or uploading GPU buffers anyway. The one ugly part I didn't account for when I started is the casting between the "ColorGeometry" and "ColorPaint" types. I'm not sure that this is correct, but it's just a more explicit version of what was there already. Pull Request: https://projects.blender.org/blender/blender/pulls/109941