diff options
author | Hans Goudey <h.goudey@me.com> | 2022-05-05 10:26:08 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-05-05 10:28:46 +0300 |
commit | 6513ce258f734f50fa152a8f88240368e176389b (patch) | |
tree | f752d1e5e780a9c1ecb47aa6b9ece3e4cd5572c9 /intern/cycles/util | |
parent | 0f567ada9d1c60f9ff9a457f83f5c870d0673dab (diff) |
Geometry Nodes: Improve performance of mesh to points node
There are fancier possibilities for improvements, like taking ownership
of existing arrays in some cases, but this patch takes a simpler brute
force approach for now.
The first change is to move from the previous loop to using the new
`materialize_compressed_to_uninitialized` method on virtual arrays,
which adds only the selected values to the output. That is a nice
improvement in some cases, corresponding to the "Without Threading"
column in the chart below.
The next change is to call that function in parallel on slices of
the output. To avoid generating too much code, we can avoid
templating based on the type and devirtualizing completely.
The test input is a 4 million point grid, generated by the grid
primitive node. Color and 2D vector attributes were also transferred
to the points.
| Test | Before | Final No Threading | Final | Change |
| --------- | ------ | ------------------ | ------ | ------ |
| All Verts | 209 ms | 186 ms | 170 ms | 0.8x |
| 1% | 148 ms | 143 ms | 133 ms | 0.9x |
| All Faces | 326 ms | 303 ms | 87 ms | 0.27x |
| 1% Faces | 70 ms | 68 ms | 34 ms | 0.49x |
Differential Revision: https://developer.blender.org/D14661
Diffstat (limited to 'intern/cycles/util')
0 files changed, 0 insertions, 0 deletions