diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-05-08 17:23:17 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-05-08 17:23:17 +0400 |
commit | a07dcd67ebf63fad08536b1e78bbb61e18fa51e6 (patch) | |
tree | 7c96f23349f005187e87d19d23248bb40d4d2e91 /source/blender/editors | |
parent | 3e763d7e4dbbc4acb3deb7afb95e936ce950ebb5 (diff) |
Fix #35240: command line -t number of threads option did not work for cycles.
Now it works for blender internal, cycles and other multithreading code in
Blender in both background and UI mode.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/armature/editarmature_retarget.c | 9 | ||||
-rw-r--r-- | source/blender/editors/object/object_bake.c | 5 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 8 |
3 files changed, 7 insertions, 15 deletions
diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index a6ee2a2acad..687455495a1 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -40,6 +40,7 @@ #include "BKE_constraint.h" #include "BKE_armature.h" #include "BKE_context.h" +#include "BKE_scene.h" #include "ED_armature.h" #include "ED_util.h" @@ -283,14 +284,8 @@ static RigGraph *newRigGraph(void) rg->free_node = NULL; #ifdef USE_THREADS -// if (G.scene->r.mode & R_FIXED_THREADS) -// { -// totthread = G.scene->r.threads; -// } -// else -// { + //totthread = BKE_scene_num_threads(G.scene); totthread = BLI_system_thread_count(); -// } rg->worker = BLI_create_worker(exec_retargetArctoArc, totthread, 20); /* fix number of threads */ #endif diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 01e614fef41..d02e58913e4 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -63,6 +63,7 @@ #include "BKE_subsurf.h" #include "BKE_depsgraph.h" #include "BKE_mesh.h" +#include "BKE_scene.h" #include "RE_pipeline.h" #include "RE_shader_ext.h" @@ -339,7 +340,7 @@ static int multiresbake_image_exec_locked(bContext *C, wmOperator *op) bkr.number_of_rays = scene->r.bake_samples; bkr.raytrace_structure = scene->r.raytrace_structure; bkr.octree_resolution = scene->r.ocres; - bkr.threads = scene->r.mode & R_FIXED_THREADS ? scene->r.threads : 0; + bkr.threads = BKE_scene_num_threads(scene); /* create low-resolution DM (to bake to) and hi-resolution DM (to bake from) */ bkr.hires_dm = multiresbake_create_hiresdm(scene, ob, &bkr.tot_lvl, &bkr.simple); @@ -377,7 +378,7 @@ static void init_multiresbake_job(bContext *C, MultiresBakeJob *bkj) bkj->number_of_rays = scene->r.bake_samples; bkj->raytrace_structure = scene->r.raytrace_structure; bkj->octree_resolution = scene->r.ocres; - bkj->threads = scene->r.mode & R_FIXED_THREADS ? scene->r.threads : 0; + bkj->threads = BKE_scene_num_threads(scene); CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) { diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 3dff3c7846a..7523d10996a 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -3047,12 +3047,8 @@ static void project_paint_begin(ProjPaintState *ps) * threads is being able to fill in multiple buckets at once. * Only use threads for bigger brushes. */ - if (ps->scene->r.mode & R_FIXED_THREADS) { - ps->thread_tot = ps->scene->r.threads; - } - else { - ps->thread_tot = BLI_system_thread_count(); - } + ps->thread_tot = BKE_scene_num_threads(ps->scene); + for (a = 0; a < ps->thread_tot; a++) { ps->arena_mt[a] = BLI_memarena_new(1 << 16, "project paint arena"); } |