Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Eagar <joeedh@gmail.com>2022-11-10 22:30:04 +0300
committerJoseph Eagar <joeedh@gmail.com>2022-11-10 22:30:04 +0300
commit3c089c0a88983b6fcd5ebed7480625fc4c1bf8a8 (patch)
tree6f80927cb7accca9a6fbfa24245b8df10977651c
parent59618c764699e81d0a3615d755cd02b1f556bac3 (diff)
Sculpt: Fix T102209: Multiresolution levels greater than 6 crashes
pbvh->leaf_limit needs to be at least 4 to split nodes original face boundaries properly.
-rw-r--r--source/blender/blenkernel/intern/pbvh.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 98e89b09060..24ea2de98f6 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -833,7 +833,12 @@ void BKE_pbvh_build_grids(PBVH *pbvh,
pbvh->gridkey = *key;
pbvh->grid_hidden = grid_hidden;
pbvh->subdiv_ccg = subdiv_ccg;
- pbvh->leaf_limit = max_ii(LEAF_LIMIT / (gridsize * gridsize), 1);
+
+ /* Ensure leaf limit is at least 4 so there's room
+ * to split at original face boundaries.
+ * Fixes T102209.
+ */
+ pbvh->leaf_limit = max_ii(LEAF_LIMIT / (gridsize * gridsize), 4);
/* We need the base mesh attribute layout for PBVH draw. */
pbvh->vdata = &me->vdata;