Mesh: Reduce custom normal calculation memory usage #107592

Merged
Hans Goudey merged 32 commits from HooglyBoogly/blender:corner-normals-refactor-storage into main 2023-05-10 14:41:16 +02:00
1 changed files with 5 additions and 0 deletions
Showing only changes of commit ffc8d2aefd - Show all commits

View File

@ -1407,6 +1407,11 @@ void normals_calc_loop(const Span<float3> vert_positions,
* same item, and reverse the indices to create an array of all the indices that reference each
* item. Group each item's indices together consecutively, encoding the grouping in #r_offsets,
* which is meant to be used by #OffsetIndices.
*
* \param r_offsets: An array to be filled with the first index of each item in

It's not obvious what r_offsets & r_reverse_indices represent, which should be stated in plan text (in this doc-string).

Or, wrap reverse_index_array in a function which takes lnors_spacearr and include a description of what the values represent there.

Either way noting that fan_corners_data & fan_corner_offset_indices represent inline isn't practical as they're declared twice.

It's not obvious what `r_offsets` & `r_reverse_indices` represent, which should be stated in plan text (in this doc-string). Or, wrap `reverse_index_array` in a function which takes `lnors_spacearr` and include a description of what the values represent there. Either way noting that `fan_corners_data` & `fan_corner_offset_indices` represent inline isn't practical as they're declared twice.
* \a r_reverse_indices, used to split the indices into chunks by item. (See #OffsetIndices).
* \param r_reverse_indices: The indices into \a item_indices that point to each item, split by \a
* r_offsets.
*/
static void reverse_index_array(const Span<int> item_indices,
const int items_num,