From e76b43efcfafb5da02679325c49f46d833ded4e9 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 10 May 2021 16:49:26 +0200 Subject: [PATCH 1/2] Fix T88180: Enable HQ normal workaround for RX 580X cards. This needs to be backported to 2.83. --- source/blender/gpu/opengl/gl_backend.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/blender/gpu/opengl/gl_backend.cc b/source/blender/gpu/opengl/gl_backend.cc index ef7788194a1..a04d4be0e52 100644 --- a/source/blender/gpu/opengl/gl_backend.cc +++ b/source/blender/gpu/opengl/gl_backend.cc @@ -286,9 +286,10 @@ static void detect_workarounds() strstr(renderer, " RX 480 ") || strstr(renderer, " RX 490 ") || strstr(renderer, " RX 560 ") || strstr(renderer, " RX 560X ") || strstr(renderer, " RX 570 ") || strstr(renderer, " RX 580 ") || - strstr(renderer, " RX 590 ") || strstr(renderer, " RX550/550 ") || - strstr(renderer, " (TM) 520 ") || strstr(renderer, " (TM) 530 ") || - strstr(renderer, " R5 ") || strstr(renderer, " R7 ") || strstr(renderer, " R9 ")) { + strstr(renderer, " RX 580X ") || strstr(renderer, " RX 590 ") || + strstr(renderer, " RX550/550 ") || strstr(renderer, " (TM) 520 ") || + strstr(renderer, " (TM) 530 ") || strstr(renderer, " R5 ") || strstr(renderer, " R7 ") || + strstr(renderer, " R9 ")) { GCaps.use_hq_normals_workaround = true; } } From 8815e3e3303933e2cc662f15fc9d11ca68a47d16 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Wed, 5 May 2021 17:27:32 +0200 Subject: [PATCH 2/2] Fix T88060: Expand freezing when deleting a Face Set with multiple loose parts When checking if the mesh has only one Face Set only the current active component for expand needs to be checked. Otherwhise other components that won't be modified by Expand that contain other IDs will be taken into account, making the Face Set deletion go into an infinite loop. Reviewed By: JacquesLucke Maniphest Tasks: T88060 Differential Revision: https://developer.blender.org/D11169 --- .../editors/sculpt_paint/sculpt_expand.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/sculpt_paint/sculpt_expand.c b/source/blender/editors/sculpt_paint/sculpt_expand.c index 8b8ed42a694..e6259ebecb7 100644 --- a/source/blender/editors/sculpt_paint/sculpt_expand.c +++ b/source/blender/editors/sculpt_paint/sculpt_expand.c @@ -1892,13 +1892,22 @@ static int sculpt_expand_modal(bContext *C, wmOperator *op, const wmEvent *event * The faces that were using the `delete_id` Face Set are filled * using the content from their neighbors. */ -static void sculpt_expand_delete_face_set_id( - int *r_face_sets, Mesh *mesh, MeshElemMap *pmap, const int totface, const int delete_id) +static void sculpt_expand_delete_face_set_id(int *r_face_sets, + SculptSession *ss, + ExpandCache *expand_cache, + Mesh *mesh, + const int delete_id) { + const int totface = ss->totvert; + MeshElemMap *pmap = ss->pmap; + /* Check that all the face sets IDs in the mesh are not equal to `delete_id` * before attempting to delete it. */ bool all_same_id = true; for (int i = 0; i < totface; i++) { + if (!sculpt_expand_is_face_in_active_component(ss, expand_cache, i)) { + continue; + } if (r_face_sets[i] != delete_id) { all_same_id = false; break; @@ -2070,9 +2079,9 @@ static int sculpt_expand_invoke(bContext *C, wmOperator *op, const wmEvent *even if (ss->expand_cache->modify_active_face_set) { sculpt_expand_delete_face_set_id(ss->expand_cache->initial_face_sets, + ss, + ss->expand_cache, ob->data, - ss->pmap, - ss->totfaces, ss->expand_cache->next_face_set); }