Page MenuHome

Refactor: Store is_duplicate as part of each SubdivCCGNeighbors element
Needs RevisionPublic

Authored by Pablo Dobarro (pablodp606) on Sep 17 2020, 12:00 AM.

Details

Summary

This adds a new SubdivCCGNeighborCoord struct with a is_duplicate field,
which is now used in SubdivCCGNeighbors. This is the first step to remove
all logic of storing the duplicates last in the neighbors array, which
is used in the PBVH neighbor iterators.

Diff Detail

Repository
rB Blender
Branch
neighbor-storage-refactor-1 (branched from master)
Build Status
Buildable 10243
Build 10243: arc lint + arc unit

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Sep 17 2020, 12:00 AM
Pablo Dobarro (pablodp606) created this revision.
Sergey Sharybin (sergey) requested changes to this revision.Sep 17 2020, 10:19 AM
Sergey Sharybin (sergey) added inline comments.
source/blender/blenkernel/BKE_subdiv_ccg.h
113

Explain what this actually means.

290

This should not exist anymore.

source/blender/blenkernel/intern/subdiv_ccg.c
1332–1350

If you make it something like

BLI_INLINE SubdivCCGNeighborCoord construct_neighbour_coord(const int grid_index, const int x, const int y, const bool is_duplicate)

you wouldn't need to different flavours of the same-ish function, and will be able to use this function in more places (as opposite of sometimes constructing coordinate in-place, and sometimes constructing grid-coord followed up with conversion).

1708

The indexing can become continuous, no need to do this ordering magic.

This revision now requires changes to proceed.Sep 17 2020, 10:19 AM

For now I'm just adding the SubdivCCGNeighbors without removing the previous logic using num_duplicates. To remove this, all the num_duplicates logic will need to be also removed from sculpt mode (neighbors from SubdivCCGNeighbors are copied to another struct used by sculpt mode which also works using num_duplicates, so that will also need to be changed). Should I do everything in a single patch?

Ok, lets keep it incremental. No problem with this at all.

But there are also notes which you can/should resolve for this initial step.