diff options
-rw-r--r-- | source/blender/bmesh/intern/bmesh_marking.c | 108 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operators.c | 141 |
2 files changed, 102 insertions, 147 deletions
diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c index 7f2032d5f53..432c82afe4a 100644 --- a/source/blender/bmesh/intern/bmesh_marking.c +++ b/source/blender/bmesh/intern/bmesh_marking.c @@ -57,7 +57,6 @@ static void recount_totsels(BMesh *bm) tots[1] = &bm->totedgesel; tots[2] = &bm->totfacesel; -#pragma omp parallel for schedule(static) if (bm->totvert + bm->totedge + bm->totface >= BM_OMP_LIMIT) for (i = 0; i < 3; i++) { BMIter iter; BMElem *ele; @@ -253,44 +252,34 @@ void BM_mesh_select_mode_flush_ex(BMesh *bm, const short selectmode) if (selectmode & SCE_SELECT_VERTEX) { /* both loops only set edge/face flags and read off verts */ -#pragma omp parallel sections if (bm->totedge + bm->totface >= BM_OMP_LIMIT) - { -#pragma omp section + BM_ITER_MESH (e, &eiter, bm, BM_EDGES_OF_MESH) { + if (BM_elem_flag_test(e->v1, BM_ELEM_SELECT) && + BM_elem_flag_test(e->v2, BM_ELEM_SELECT) && + !BM_elem_flag_test(e, BM_ELEM_HIDDEN)) { - BM_ITER_MESH (e, &eiter, bm, BM_EDGES_OF_MESH) { - if (BM_elem_flag_test(e->v1, BM_ELEM_SELECT) && - BM_elem_flag_test(e->v2, BM_ELEM_SELECT) && - !BM_elem_flag_test(e, BM_ELEM_HIDDEN)) - { - BM_elem_flag_enable(e, BM_ELEM_SELECT); - } - else { - BM_elem_flag_disable(e, BM_ELEM_SELECT); - } - } + BM_elem_flag_enable(e, BM_ELEM_SELECT); } -#pragma omp section - { - BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) { - bool ok = true; - if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN)) { - l_iter = l_first = BM_FACE_FIRST_LOOP(f); - do { - if (!BM_elem_flag_test(l_iter->v, BM_ELEM_SELECT)) { - ok = false; - break; - } - } while ((l_iter = l_iter->next) != l_first); - } - else { + else { + BM_elem_flag_disable(e, BM_ELEM_SELECT); + } + } + BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) { + bool ok = true; + if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN)) { + l_iter = l_first = BM_FACE_FIRST_LOOP(f); + do { + if (!BM_elem_flag_test(l_iter->v, BM_ELEM_SELECT)) { ok = false; + break; } - - BM_elem_flag_set(f, BM_ELEM_SELECT, ok); - } + } while ((l_iter = l_iter->next) != l_first); } + else { + ok = false; + } + + BM_elem_flag_set(f, BM_ELEM_SELECT, ok); } - /* end sections */ } else if (selectmode & SCE_SELECT_EDGE) { BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) { @@ -375,42 +364,31 @@ void BM_mesh_select_flush(BMesh *bm) bool ok; - /* we can use 2 sections here because the second loop isnt checking edge selection */ -#pragma omp parallel sections if (bm->totedge + bm->totface >= BM_OMP_LIMIT) - { -#pragma omp section + BM_ITER_MESH (e, &eiter, bm, BM_EDGES_OF_MESH) { + if (BM_elem_flag_test(e->v1, BM_ELEM_SELECT) && + BM_elem_flag_test(e->v2, BM_ELEM_SELECT) && + !BM_elem_flag_test(e, BM_ELEM_HIDDEN)) { - BM_ITER_MESH (e, &eiter, bm, BM_EDGES_OF_MESH) { - if (BM_elem_flag_test(e->v1, BM_ELEM_SELECT) && - BM_elem_flag_test(e->v2, BM_ELEM_SELECT) && - !BM_elem_flag_test(e, BM_ELEM_HIDDEN)) - { - BM_elem_flag_enable(e, BM_ELEM_SELECT); - } - } + BM_elem_flag_enable(e, BM_ELEM_SELECT); } - -#pragma omp section - { - BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) { - ok = true; - if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN)) { - l_iter = l_first = BM_FACE_FIRST_LOOP(f); - do { - if (!BM_elem_flag_test(l_iter->v, BM_ELEM_SELECT)) { - ok = false; - break; - } - } while ((l_iter = l_iter->next) != l_first); - } - else { + } + BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) { + ok = true; + if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN)) { + l_iter = l_first = BM_FACE_FIRST_LOOP(f); + do { + if (!BM_elem_flag_test(l_iter->v, BM_ELEM_SELECT)) { ok = false; + break; } + } while ((l_iter = l_iter->next) != l_first); + } + else { + ok = false; + } - if (ok) { - BM_elem_flag_enable(f, BM_ELEM_SELECT); - } - } + if (ok) { + BM_elem_flag_enable(f, BM_ELEM_SELECT); } } @@ -1107,8 +1085,6 @@ void BM_mesh_elem_hflag_disable_test( { /* fast path for deselect all, avoid topology loops * since we know all will be de-selected anyway. */ - -#pragma omp parallel for schedule(static) if (bm->totvert + bm->totedge + bm->totface >= BM_OMP_LIMIT) for (i = 0; i < 3; i++) { BMIter iter; BMElem *ele; diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index 44445aae25a..3e12a43e457 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -550,37 +550,30 @@ static int bmo_mesh_flag_count( { int count_vert = 0, count_edge = 0, count_face = 0; -#pragma omp parallel sections if ((bm->totvert + bm->totedge + bm->totface >= BM_OMP_LIMIT) && \ - (ELEM(htype, BM_VERT, BM_EDGE, BM_FACE) == 0)) - { -#pragma omp section - if (htype & BM_VERT) { - BMIter iter; - BMVert *ele; - BM_ITER_MESH (ele, &iter, bm, BM_VERTS_OF_MESH) { - if (BMO_vert_flag_test_bool(bm, ele, oflag) == test_for_enabled) { - count_vert++; - } + if (htype & BM_VERT) { + BMIter iter; + BMVert *ele; + BM_ITER_MESH (ele, &iter, bm, BM_VERTS_OF_MESH) { + if (BMO_vert_flag_test_bool(bm, ele, oflag) == test_for_enabled) { + count_vert++; } } -#pragma omp section - if (htype & BM_EDGE) { - BMIter iter; - BMEdge *ele; - BM_ITER_MESH (ele, &iter, bm, BM_EDGES_OF_MESH) { - if (BMO_edge_flag_test_bool(bm, ele, oflag) == test_for_enabled) { - count_edge++; - } + } + if (htype & BM_EDGE) { + BMIter iter; + BMEdge *ele; + BM_ITER_MESH (ele, &iter, bm, BM_EDGES_OF_MESH) { + if (BMO_edge_flag_test_bool(bm, ele, oflag) == test_for_enabled) { + count_edge++; } } -#pragma omp section - if (htype & BM_FACE) { - BMIter iter; - BMFace *ele; - BM_ITER_MESH (ele, &iter, bm, BM_FACES_OF_MESH) { - if (BMO_face_flag_test_bool(bm, ele, oflag) == test_for_enabled) { - count_face++; - } + } + if (htype & BM_FACE) { + BMIter iter; + BMFace *ele; + BM_ITER_MESH (ele, &iter, bm, BM_FACES_OF_MESH) { + if (BMO_face_flag_test_bool(bm, ele, oflag) == test_for_enabled) { + count_face++; } } } @@ -601,33 +594,25 @@ int BMO_mesh_disabled_flag_count(BMesh *bm, const char htype, const short oflag) void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *UNUSED(op), const char htype, const short oflag) { - -#pragma omp parallel sections if ((bm->totvert + bm->totedge + bm->totface >= BM_OMP_LIMIT) && \ - (ELEM(htype, BM_VERT, BM_EDGE, BM_FACE) == 0)) - { -#pragma omp section - if (htype & BM_VERT) { - BMIter iter; - BMVert *ele; - BM_ITER_MESH (ele, &iter, bm, BM_VERTS_OF_MESH) { - BMO_vert_flag_disable(bm, ele, oflag); - } + if (htype & BM_VERT) { + BMIter iter; + BMVert *ele; + BM_ITER_MESH (ele, &iter, bm, BM_VERTS_OF_MESH) { + BMO_vert_flag_disable(bm, ele, oflag); } -#pragma omp section - if (htype & BM_EDGE) { - BMIter iter; - BMEdge *ele; - BM_ITER_MESH (ele, &iter, bm, BM_EDGES_OF_MESH) { - BMO_edge_flag_disable(bm, ele, oflag); - } + } + if (htype & BM_EDGE) { + BMIter iter; + BMEdge *ele; + BM_ITER_MESH (ele, &iter, bm, BM_EDGES_OF_MESH) { + BMO_edge_flag_disable(bm, ele, oflag); } -#pragma omp section - if (htype & BM_FACE) { - BMIter iter; - BMFace *ele; - BM_ITER_MESH (ele, &iter, bm, BM_FACES_OF_MESH) { - BMO_face_flag_disable(bm, ele, oflag); - } + } + if (htype & BM_FACE) { + BMIter iter; + BMFace *ele; + BM_ITER_MESH (ele, &iter, bm, BM_FACES_OF_MESH) { + BMO_face_flag_disable(bm, ele, oflag); } } } @@ -1383,38 +1368,32 @@ static void bmo_flag_layer_clear(BMesh *bm) const int totflags_offset = bm->totflags - 1; -#pragma omp parallel sections if (bm->totvert + bm->totedge + bm->totface >= BM_OMP_LIMIT) + /* now go through and memcpy all the flag */ { - /* now go through and memcpy all the flag */ -#pragma omp section - { - BMIter iter; - BMVert_OFlag *ele; - int i; - BM_ITER_MESH_INDEX (ele, &iter, bm, BM_VERTS_OF_MESH, i) { - ele->oflags[totflags_offset] = zero_flag; - BM_elem_index_set(&ele->base, i); /* set_inline */ - } + BMIter iter; + BMVert_OFlag *ele; + int i; + BM_ITER_MESH_INDEX (ele, &iter, bm, BM_VERTS_OF_MESH, i) { + ele->oflags[totflags_offset] = zero_flag; + BM_elem_index_set(&ele->base, i); /* set_inline */ } -#pragma omp section - { - BMIter iter; - BMEdge_OFlag *ele; - int i; - BM_ITER_MESH_INDEX (ele, &iter, bm, BM_EDGES_OF_MESH, i) { - ele->oflags[totflags_offset] = zero_flag; - BM_elem_index_set(&ele->base, i); /* set_inline */ - } + } + { + BMIter iter; + BMEdge_OFlag *ele; + int i; + BM_ITER_MESH_INDEX (ele, &iter, bm, BM_EDGES_OF_MESH, i) { + ele->oflags[totflags_offset] = zero_flag; + BM_elem_index_set(&ele->base, i); /* set_inline */ } -#pragma omp section - { - BMIter iter; - BMFace_OFlag *ele; - int i; - BM_ITER_MESH_INDEX (ele, &iter, bm, BM_FACES_OF_MESH, i) { - ele->oflags[totflags_offset] = zero_flag; - BM_elem_index_set(&ele->base, i); /* set_inline */ - } + } + { + BMIter iter; + BMFace_OFlag *ele; + int i; + BM_ITER_MESH_INDEX (ele, &iter, bm, BM_FACES_OF_MESH, i) { + ele->oflags[totflags_offset] = zero_flag; + BM_elem_index_set(&ele->base, i); /* set_inline */ } } |