WIP: Mesh: Improve and simplify modifier evaluation logic #119968

Draft
Hans Goudey wants to merge 19 commits from HooglyBoogly/blender:fix-modifier-eval-geometry-set-improve into main

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

19 Commits

Author SHA1 Message Date
Hans Goudey 855736200a Progress 2024-04-23 15:08:56 -04:00
Hans Goudey 4fc9721a6d Merge branch 'main' into fix-modifier-eval-geometry-set-improve 2024-04-23 13:55:29 -04:00
Hans Goudey 2cc68bfde3 Progress 2024-04-02 22:25:28 -04:00
Hans Goudey 22b56d3e84 Merge branch 'cleanup-mesh-wrapper-finalize-remove' into fix-modifier-eval-geometry-set-improve 2024-04-02 22:18:28 -04:00
Hans Goudey 5aac5fb23a Merge branch 'main' into cleanup-mesh-wrapper-finalize-remove 2024-04-02 21:28:51 -04:00
Hans Goudey 92010194e6 Merge branch 'main' into cleanup-mesh-wrapper-finalize-remove 2024-04-02 19:46:41 -04:00
Hans Goudey 04fbb2ffd3 Merge branch 'main' into cleanup-mesh-wrapper-finalize-remove 2024-04-02 15:50:29 -04:00
Hans Goudey a1728cc496 Cleanup: Use ImplicitSharingInfo type instead of C handle 2024-04-02 15:45:26 -04:00
Hans Goudey f1cf6c22d9 Mesh: Remove unnecessary wrapper_type_finalize logic
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
After some discussions and investigation over the last couple months,
it's not clear what the "wrapper type finalize" logic is necessary for.
For edit meshes and regular meshes, normals are calculated lazily when
building the draw cache.

Apart from the unnecessary complication for mesh GPU draw data
extraction, this code also causes normals to always be calculated
when turning an edit mesh wrapper into a regular mesh. However, those
normals are immediately discared since the edit deform cache is deleted
in the next line.

Beyond the obvious simplification, the motivation for this change is to
avoid requesting write access on the evaluated mesh and cage mesh. This
works better with implicit sharing, allowing other improvements.
2024-03-29 11:07:33 -04:00
Hans Goudey 7ca0735b52 Progress 2024-03-28 21:58:55 -04:00
Hans Goudey 87aba00c0f Merge branch 'main' into fix-modifier-eval-geometry-set-improve 2024-03-28 21:52:29 -04:00
Hans Goudey e08b28fa5a Progress 2024-03-28 21:41:40 -04:00
Hans Goudey de4a20337e Progress 2024-03-28 21:38:09 -04:00
Hans Goudey 71b84c9656 Merge branch 'main' into fix-modifier-eval-geometry-set-improve 2024-03-28 21:20:57 -04:00
Hans Goudey 540ea56b1f Merge branch 'main' into fix-modifier-eval-geometry-set-improve 2024-03-28 16:43:02 -04:00
Hans Goudey 54f94093cc Progress? 2024-03-27 23:50:26 -04:00
Hans Goudey bb2c0ac5a2 Progress 2024-03-27 23:03:31 -04:00
Hans Goudey 933d4bdc35 Merge branch 'main' into fix-modifier-eval-geometry-set-improve 2024-03-27 22:34:34 -04:00
Hans Goudey 115b3f858f Mesh: Improve and simplify modifier evaluation logic
Fixes #119938

Make use of GeometrySet and implicit sharing to significantly
simplify the handling of mesh evaluation in the modifier stack.

TODO: Proper description, testing

One thing to check is whether it's actually okay to store mesh_input
as a read-only mesh in the evaluated geometry set. I would hope so,
but we may be required to store it separately and add some complexity
back, I'm not sure.
2024-03-27 11:46:49 -04:00