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.
Details
- Reviewers
Sergey Sharybin (sergey)
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
| 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. | |
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.