Page MenuHome

Cleanup: Simplify arguments to sculpt draw functions
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Jun 14 2022, 8:43 PM.

Details

Summary

Instead of passing pointers to specific mesh data, rely on
retrieving that data from the mesh internally. This makes
it easier to support retrieving additional data from Mesh
(like active attribute names in D15101 or D15169). It also makes
the functions simpler conceptually, because they're drawing
a mesh with an acceleration strcture on top.

The BKE_id_attribute_copy_domains_temp call was unnecessary
because the GPU_pbvh_mesh_buffers_update function was only
called when Mesh/PBVH_FACES is used in the first place.

Diff Detail

Repository
rB Blender

Event Timeline

source/blender/blenkernel/intern/pbvh.c
1327

pbvh->verts is duplicated if modifiers are active, so you can't pull it from pbvh->mesh->mvert.

source/blender/gpu/intern/gpu_buffers.c
393

This function is multithreaded, and also vertex normals are managed by the PBVH.

  • Pass vertices and vertex normals separately from the mesh

Good points, thanks!

Hans Goudey (HooglyBoogly) marked 2 inline comments as done.Jun 16 2022, 11:41 AM
This revision is now accepted and ready to land.Jul 27 2022, 5:42 PM