forked from bartvdbraak/blender
[#18058] Black dots appear when blender renders with multi-thread and material nodes
Without thread locking the function that allocates new threads, black dots appear in renders. This wont affect composite nodes, Ton/Brecht - this is possibly too many lock/unlocks but I timed the render from the bug report and it didn't make a noticeable difference.
This commit is contained in:
parent
7260e8fe29
commit
f87a399978
@ -1999,19 +1999,23 @@ static bNodeThreadStack *ntreeGetThreadStack(bNodeTree *ntree, int thread)
|
||||
{
|
||||
ListBase *lb= &ntree->threadstack[thread];
|
||||
bNodeThreadStack *nts;
|
||||
|
||||
|
||||
/* for material shading this is called quite a lot (perhaps too much locking unlocking)
|
||||
* however without locking we get bug #18058 - Campbell */
|
||||
BLI_lock_thread(LOCK_CUSTOM1);
|
||||
|
||||
for(nts=lb->first; nts; nts=nts->next) {
|
||||
if(!nts->used) {
|
||||
nts->used= 1;
|
||||
BLI_unlock_thread(LOCK_CUSTOM1);
|
||||
return nts;
|
||||
}
|
||||
}
|
||||
|
||||
nts= MEM_callocN(sizeof(bNodeThreadStack), "bNodeThreadStack");
|
||||
nts->stack= MEM_dupallocN(ntree->stack);
|
||||
nts->used= 1;
|
||||
BLI_addtail(lb, nts);
|
||||
|
||||
BLI_unlock_thread(LOCK_CUSTOM1);
|
||||
return nts;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user