diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_scene.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index a10a3f3f59f..972db36d5a6 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -137,6 +137,8 @@ bool BKE_scene_check_rigidbody_active(const struct Scene *scene); int BKE_scene_num_threads(const struct Scene *scene); int BKE_render_num_threads(const struct RenderData *r); +int BKE_scene_num_omp_threads(const struct Scene *scene); +void BKE_scene_omp_threads_update(const struct Scene *scene); #ifdef __cplusplus } #endif diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 28cc4305da8..02bc1fcb699 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -638,6 +638,9 @@ Scene *BKE_scene_add(Main *bmain, const char *name) sce->gm.exitkey = 218; // Blender key code for ESC + sce->omp_mode = SCE_OMP_AUTO; + sce->omp_num_threads = 1; + sound_create_scene(sce); /* color management */ @@ -1868,3 +1871,10 @@ int BKE_scene_num_threads(const Scene *scene) return BKE_render_num_threads(&scene->r); } +int BKE_scene_num_omp_threads(const struct Scene *scene) +{ + if (scene->omp_mode == SCE_OMP_AUTO) + return BLI_omp_thread_count(); + else + return scene->omp_num_threads; +} |