Fix: Crash in sculpt mode with shared normals caches #4

Closed
Hans Goudey wants to merge 3 commits from fix-pbvh-normals-crash into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Owner

Since the normals are stored in a shared cache, tagging them dirty
recreated the cache from scratch when it was shared. Instead,
add a function that updates the cache in the same call as tagging
it dirty. This keeps the old state of the cache around even if it was
shared, and reflects the way that it's really the PBVH and sculpt
mode managing the dirty status of normals while sculpt mode
is active.

One consequence is that the BVH cache and the triangulation
cache need to be tagged dirty manually. I'd like to avoid abstracting
this more than necessary, because I'm hoping in the long term
different caching abstractions like a more global cache that takes
implicit sharing versions into account will make this complexity
unnecessary.

Fixes #111628, #111563

Since the normals are stored in a shared cache, tagging them dirty recreated the cache from scratch when it was shared. Instead, add a function that updates the cache in the same call as tagging it dirty. This keeps the old state of the cache around even if it was shared, and reflects the way that it's really the PBVH and sculpt mode managing the dirty status of normals while sculpt mode is active. One consequence is that the BVH cache and the triangulation cache need to be tagged dirty manually. I'd like to avoid abstracting this more than necessary, because I'm hoping in the long term different caching abstractions like a more global cache that takes implicit sharing versions into account will make this complexity unnecessary. Fixes #111628, #111563
Hans Goudey added 3 commits 2023-08-29 02:52:05 +02:00
Hans Goudey requested review from Jacques Lucke 2023-08-29 02:52:11 +02:00
Hans Goudey changed title from Fix #111628, #111563: Crash in sculpt mode with shared normals caches to Fix: Crash in sculpt mode with shared normals caches 2023-08-29 02:52:28 +02:00
Hans Goudey closed this pull request 2023-08-29 05:17:33 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: HooglyBoogly/blender#4
No description provided.