Fix #104915: Race condition writing subsurf optimal display edges #105156

Merged

1 Commits

Author SHA1 Message Date
Hans Goudey de78a588af Fix #104915: Race condition writing subsurf optimal display edges
Writing to a bitmap from multiple threads causes races when writing to
bits within the same integer. Instead, write to a separate boolean array
while subdividing, and move that to the final mesh bit vector after.

Notes:
 - The final copy to the bit vector could be replaced by a generic
   `copy_from(Span<bool>)` call in the future.
 - Theoretically we could entirely replace the `BitVector` with an
   `Array<bool>`, but 1/8 the memory use for edges is likely worth it.
2023-02-23 16:51:07 -05:00