Hans Goudey 98e33adac2 Mesh: Further optimize topology map creation
We need a separate array that we can change in during the parallel
group construction. That array tells where in each group the index
is added. Building this array is expensive, since construcing a new
`Array` fills its elements serially. There are two possible solutions:

1. Use a copy of the offsets to increment result indices directly
2. Rely on OS-optimized `calloc` instead of `malloc` and a copy/fill

Both depend on using `fetch_and_add` instead of `add_and_fetch`.

The vertex to corner and edge to corner map creation is optimized
by this commit, though the benefits will be useful elsewhere in the
future.

|          | Before  | 1. offsets copy | 2. calloc       |
| -------- | ------- | --------------- | --------------- |
| Grid 1m  | 3.1 ms  | 1.9 ms (1.63x)  | 1.8 ms (1.72x)  |
| Grid 16m | 51.8 ms | 33.3 ms (1.55x) | 32.7 ms (1.58x) |

This commit implements the calloc solution, since it's slightly faster
and simpler. In the future, `Array` could do this optimization itself
when it detects that its fill value is just zero bytes.

Pull Request: https://projects.blender.org/blender/blender/pulls/112065
2023-09-08 16:18:38 +02:00
2023-08-30 22:36:36 +02:00
2023-09-06 19:33:33 +02:00
2023-09-06 19:15:47 +10:00
2023-09-08 17:12:29 +10:00
2023-08-29 15:09:05 +10:00
2023-08-16 19:29:47 +02:00

Blender

Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.

Blender screenshot

Project Pages

Development

License

Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.

See blender.org/about/license for details.

Description
No description provided
Readme 841 MiB
Languages
C++ 78%
Python 14.9%
C 2.9%
GLSL 1.9%
CMake 1.2%
Other 0.9%