diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-06-08 14:46:33 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-06-08 14:53:54 +0300 |
commit | ec0ba4095f9e60057309e6a72e6661170a22a7ee (patch) | |
tree | 68ad66cb208599c8dd62d6aa3d81cddbb5df8f2c /source/blender/nodes/texture | |
parent | d63615272cc667d9e64fa1fe86a8be3d60519f2c (diff) |
Fix T44979: Crash when rendering with more threads than the system ones
Revert "Nodes: Remove hardcoded BLENDER_MAX_THREADS number of threads"
This reverts commit fdc653e8ce77a188138dc707207139c3d1e6b166.
The threads override is not affected by the scene, and hence the limit of the
threads was not giving correct result. Need to re-consider some things here.
Diffstat (limited to 'source/blender/nodes/texture')
-rw-r--r-- | source/blender/nodes/texture/node_texture_tree.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/nodes/texture/node_texture_tree.c b/source/blender/nodes/texture/node_texture_tree.c index 3482227f044..d716c2565c7 100644 --- a/source/blender/nodes/texture/node_texture_tree.c +++ b/source/blender/nodes/texture/node_texture_tree.c @@ -232,8 +232,7 @@ bNodeTreeExec *ntreeTexBeginExecTree_internal(bNodeExecContext *context, bNodeTr exec = ntree_exec_begin(context, ntree, parent_key); /* allocate the thread stack listbase array */ - exec->tot_thread = BLI_system_thread_count(); - exec->threadstack = MEM_callocN(exec->tot_thread * sizeof(ListBase), "thread stack array"); + exec->threadstack = MEM_callocN(BLENDER_MAX_THREADS * sizeof(ListBase), "thread stack array"); for (node = exec->nodetree->nodes.first; node; node = node->next) node->need_exec = 1; @@ -271,7 +270,7 @@ static void tex_free_delegates(bNodeTreeExec *exec) bNodeStack *ns; int th, a; - for (th = 0; th < exec->tot_thread; th++) + for (th = 0; th < BLENDER_MAX_THREADS; th++) for (nts = exec->threadstack[th].first; nts; nts = nts->next) for (ns = nts->stack, a = 0; a < exec->stacksize; a++, ns++) if (ns->data && !ns->is_copy) @@ -286,7 +285,7 @@ void ntreeTexEndExecTree_internal(bNodeTreeExec *exec) if (exec->threadstack) { tex_free_delegates(exec); - for (a = 0; a < exec->tot_thread; a++) { + for (a = 0; a < BLENDER_MAX_THREADS; a++) { for (nts = exec->threadstack[a].first; nts; nts = nts->next) if (nts->stack) MEM_freeN(nts->stack); BLI_freelistN(&exec->threadstack[a]); |