Page MenuHome

Fix T79146: Sculpt Mode lags until the entire mesh is visible
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Dec 27 2020, 3:54 AM.

Details

Summary

This was caused when the BKE_pbvh_draw_cb function was used with
update_only_visible set to false. In that case, all nodes with the flag
were updating, but the update flag was only cleared for visible nodes.
This was causing constant updates per redraw in no visible nodes until
they enter the view frustum and their flag was cleared.

In order to fix this and prevent it from happening again:

  • Updating the buffers, flushing the updates and clearing the flags are

now part of the same function. It does not make sense to do these in
separate places.

  • The BKE_pbvh_draw_cb function was refactored so the

pbvh_update_draw_buffers is only called once. It should now be easier to
understand what the function does when it is used to update only visible
nodes or all nodes.

Diff Detail

Repository
rB Blender

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Dec 27 2020, 3:54 AM
Pablo Dobarro (pablodp606) created this revision.

Not sure if I'm following protocol here...
... but for what it's worth...

I applied the diff to my local build and it fixed the issues!
Now I can enjoy all the performances improvements that that everyone keeps raving about. ;)

Video proof:

Thanks Pablo!

Besides cosmetic comments below patch LGTM.

Since @Sergey Sharybin (sergey) is back, maybe he also want to have a look here?

source/blender/blenkernel/intern/pbvh.c
1369–1370

You 'cleanup' a for i in code below, but use a again here? ;)

2736

totnode != 0

This revision is now accepted and ready to land.Dec 28 2020, 10:32 AM