Fix wrong upate flag when updating the PBVH visibility

This function was using the wrong flag to update the visibility state of
the nodes, so I assume that most of the partially visible optimizations
were not working.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8243
This commit is contained in:
Pablo Dobarro
2020-07-07 23:01:51 +02:00
parent e5ebaa9fd6
commit 1fb667da01

View File

@@ -1542,7 +1542,7 @@ static void pbvh_update_visibility_task_cb(void *__restrict userdata,
PBVHUpdateData *data = userdata;
PBVH *pbvh = data->pbvh;
PBVHNode *node = data->nodes[n];
if (node->flag & PBVH_UpdateMask) {
if (node->flag & PBVH_UpdateVisibility) {
switch (BKE_pbvh_type(pbvh)) {
case PBVH_FACES:
pbvh_faces_node_visibility_update(pbvh, node);
@@ -1554,7 +1554,7 @@ static void pbvh_update_visibility_task_cb(void *__restrict userdata,
pbvh_bmesh_node_visibility_update(node);
break;
}
node->flag &= ~PBVH_UpdateMask;
node->flag &= ~PBVH_UpdateVisibility;
}
}