diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-06-22 19:09:41 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-06-22 19:09:41 +0400 |
commit | e0368d31a5b3a593d9650de688fdaf77e6975103 (patch) | |
tree | 2beda97970dc6e435ae1af16eb008a8237c668b1 /source/blender/blenkernel/intern/CCGSubSurf.c | |
parent | 844274c27ab557c53288ead3944c2981e700f962 (diff) |
Enabled openmp multithreading for multires/subsurf again, but only
if there are >= 1 million faces estimated in the resulting mesh.
(merge from render25 branch)
Diffstat (limited to 'source/blender/blenkernel/intern/CCGSubSurf.c')
-rw-r--r-- | source/blender/blenkernel/intern/CCGSubSurf.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index 8fad398f00a..bbd68fb797b 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) if(numEffectedF*edgeSize*edgeSize*4 >= CCG_OMP_LIMIT) 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) if(numEffectedF*edgeSize*edgeSize*4 >= CCG_OMP_LIMIT) 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) if(numEffectedF*edgeSize*edgeSize*4 >= CCG_OMP_LIMIT) 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) if(numEffectedF*edgeSize*edgeSize*4 >= CCG_OMP_LIMIT) { 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) if(numEffectedF*edgeSize*edgeSize*4 >= CCG_OMP_LIMIT) 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) if(numEffectedF*edgeSize*edgeSize*4 >= CCG_OMP_LIMIT) for (i=0; i<numEffectedF; i++) { CCGFace *f = effectedF[i]; int S, x; |