diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-06-01 23:01:54 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-06-01 23:01:54 +0400 |
commit | db96d4972f201445451f4f12bd6424cc96b93d52 (patch) | |
tree | 6b6f18e12c57d2435a37a6bb6087aa13355823d2 | |
parent | 4ad5606f6450221549ddfa942e3b9421254ede1b (diff) |
Workaround #20467: disabled OpenMP multithreading on subsurf/multires/sculpt
for now, it's too fine grained and so becomes a performance bottleneck on some
platforms, while only providing a modest speedup on others. Couldn't find a
simple enough solution to solve this, so for now no multithreading here.
-rw-r--r-- | source/blender/blenkernel/intern/CCGSubSurf.c | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/multires.c | 4 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 24 |
3 files changed, 23 insertions, 23 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index 6778c9eb8ad..8fad398f00a 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -1159,7 +1159,7 @@ static void ccgSubSurf__calcVertNormals(CCGSubSurf *ss, int normalDataOffset = ss->normalDataOffset; int vertDataSize = ss->meshIFC.vertDataSize; - #pragma omp parallel for private(ptrIdx) schedule(static) + //#pragma omp parallel for private(ptrIdx) schedule(static) for (ptrIdx=0; ptrIdx<numEffectedF; ptrIdx++) { CCGFace *f = (CCGFace*) effectedF[ptrIdx]; int S, x, y; @@ -1285,7 +1285,7 @@ static void ccgSubSurf__calcVertNormals(CCGSubSurf *ss, } } - #pragma omp parallel for private(ptrIdx) schedule(static) + //#pragma omp parallel for private(ptrIdx) schedule(static) for (ptrIdx=0; ptrIdx<numEffectedF; ptrIdx++) { CCGFace *f = (CCGFace*) effectedF[ptrIdx]; int S, x, y; @@ -1351,7 +1351,7 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss, int vertDataSize = ss->meshIFC.vertDataSize; void *q = ss->q, *r = ss->r; - #pragma omp parallel for private(ptrIdx) schedule(static) + //#pragma omp parallel for private(ptrIdx) schedule(static) for (ptrIdx=0; ptrIdx<numEffectedF; ptrIdx++) { CCGFace *f = (CCGFace*) effectedF[ptrIdx]; int S, x, y; @@ -1685,17 +1685,17 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss, } } - #pragma omp parallel private(ptrIdx) + //#pragma omp parallel private(ptrIdx) { void *q, *r; - #pragma omp critical + //#pragma omp critical { q = MEM_mallocN(ss->meshIFC.vertDataSize, "CCGSubsurf q"); r = MEM_mallocN(ss->meshIFC.vertDataSize, "CCGSubsurf r"); } - #pragma omp for schedule(static) + //#pragma omp for schedule(static) for (ptrIdx=0; ptrIdx<numEffectedF; ptrIdx++) { CCGFace *f = (CCGFace*) effectedF[ptrIdx]; int S, x, y; @@ -1779,7 +1779,7 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss, } } - #pragma omp critical + //#pragma omp critical { MEM_freeN(q); MEM_freeN(r); @@ -1791,14 +1791,14 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss, gridSize = 1 + (1<<((nextLvl)-1)); cornerIdx = gridSize-1; - #pragma omp parallel for private(i) schedule(static) + //#pragma omp parallel for private(i) schedule(static) for (i=0; i<numEffectedE; i++) { CCGEdge *e = effectedE[i]; VertDataCopy(EDGE_getCo(e, nextLvl, 0), VERT_getCo(e->v0, nextLvl)); VertDataCopy(EDGE_getCo(e, nextLvl, edgeSize-1), VERT_getCo(e->v1, nextLvl)); } - #pragma omp parallel for private(i) schedule(static) + //#pragma omp parallel for private(i) schedule(static) for (i=0; i<numEffectedF; i++) { CCGFace *f = effectedF[i]; int S, x; diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index d8c39abc44a..1e310c1c3d0 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -552,7 +552,7 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, int invert, int dGridSize = multires_side_tot[totlvl]; dSkip = (dGridSize-1)/(gridSize-1); - #pragma omp parallel for private(i) schedule(static) + //#pragma omp parallel for private(i) schedule(static) for(i = 0; i < me->totface; ++i) { const int numVerts = mface[i].v4 ? 4 : 3; MDisps *mdisp = &mdisps[i]; @@ -560,7 +560,7 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, int invert, int /* when adding new faces in edit mode, need to allocate disps */ if(!mdisp->disps) - #pragma omp critical + //#pragma omp critical { multires_reallocate_mdisps(me, mdisps, totlvl); } diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 85c33500c5d..245ce9f5e0d 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -772,7 +772,7 @@ static void calc_area_normal(Sculpt *sd, SculptSession *ss, float area_normal[3] copy_v3_v3(out_dir, cache->view_normal_symmetry); /* threaded loop over nodes */ - #pragma omp parallel for private(n) schedule(static) + //#pragma omp parallel for private(n) schedule(static) for(n=0; n<totnode; n++) { PBVHVertexIter vd; SculptBrushTest test; @@ -809,7 +809,7 @@ static void calc_area_normal(Sculpt *sd, SculptSession *ss, float area_normal[3] BLI_pbvh_vertex_iter_end; } - #pragma omp critical + //#pragma omp critical { /* we sum per node and add together later for threads */ add_v3_v3(out, nout); @@ -847,7 +847,7 @@ static void do_draw_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int t offset[2]= area_normal[2]*ss->cache->radius*ss->cache->scale[2]*bstrength; /* threaded loop over nodes */ - #pragma omp parallel for private(n) schedule(static) + //#pragma omp parallel for private(n) schedule(static) for(n=0; n<totnode; n++) { PBVHVertexIter vd; SculptBrushTest test; @@ -961,7 +961,7 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no BLI_pbvh_node_get_grids(ss->pbvh, node, &grid_indices, &totgrid, NULL, &gridsize, &griddata, &gridadj); - #pragma omp critical + //#pragma omp critical tmpgrid= MEM_mallocN(sizeof(float)*3*gridsize*gridsize, "tmpgrid"); for(i = 0; i < totgrid; ++i) { @@ -1020,7 +1020,7 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no } } - #pragma omp critical + //#pragma omp critical MEM_freeN(tmpgrid); } @@ -1029,7 +1029,7 @@ static void do_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int int iteration, n; for(iteration = 0; iteration < 2; ++iteration) { - #pragma omp parallel for private(n) schedule(static) + //#pragma omp parallel for private(n) schedule(static) for(n=0; n<totnode; n++) { sculpt_undo_push_node(ss, nodes[n]); @@ -1052,7 +1052,7 @@ static void do_pinch_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int float bstrength= ss->cache->bstrength; int n; - #pragma omp parallel for private(n) schedule(static) + //#pragma omp parallel for private(n) schedule(static) for(n=0; n<totnode; n++) { PBVHVertexIter vd; SculptBrushTest test; @@ -1086,7 +1086,7 @@ static void do_grab_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int t copy_v3_v3(grab_delta, ss->cache->grab_delta_symmetry); - #pragma omp parallel for private(n) schedule(static) + //#pragma omp parallel for private(n) schedule(static) for(n=0; n<totnode; n++) { PBVHVertexIter vd; SculptBrushTest test; @@ -1129,7 +1129,7 @@ static void do_layer_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int offset[1]= ss->cache->scale[1]*area_normal[1]; offset[2]= ss->cache->scale[2]*area_normal[2]; - #pragma omp parallel for private(n) schedule(static) + //#pragma omp parallel for private(n) schedule(static) for(n=0; n<totnode; n++) { PBVHVertexIter vd; SculptBrushTest test; @@ -1186,7 +1186,7 @@ static void do_inflate_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, in float bstrength= ss->cache->bstrength; int n; - #pragma omp parallel for private(n) schedule(static) + //#pragma omp parallel for private(n) schedule(static) for(n=0; n<totnode; n++) { PBVHVertexIter vd; SculptBrushTest test; @@ -1229,7 +1229,7 @@ static void calc_flatten_center(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, outer_dist[i]= -1.0f; } - #pragma omp parallel for private(n) schedule(static) + //#pragma omp parallel for private(n) schedule(static) for(n=0; n<totnode; n++) { PBVHVertexIter vd; SculptBrushTest test; @@ -1951,7 +1951,7 @@ static void sculpt_restore_mesh(Sculpt *sd, SculptSession *ss) BLI_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode); - #pragma omp parallel for private(n) schedule(static) + //#pragma omp parallel for private(n) schedule(static) for(n=0; n<totnode; n++) { SculptUndoNode *unode; |