Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenkernel/intern/particle_system.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index cba15aed55f..568b0d3531e 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -471,8 +471,6 @@ void psys_thread_context_init(ParticleThreadContext *ctx, ParticleSimulationData
ctx->ma = give_current_material(sim->ob, sim->psys->part->omat);
}
-#define MAX_PARTICLES_PER_TASK \
- 256 /* XXX arbitrary - maybe use at least number of points instead for better balancing? */
BLI_INLINE int ceil_ii(int a, int b)
{
@@ -486,7 +484,7 @@ void psys_tasks_create(ParticleThreadContext *ctx,
int *r_numtasks)
{
ParticleTask *tasks;
- int numtasks = ceil_ii((endpart - startpart), MAX_PARTICLES_PER_TASK);
+ int numtasks = min_ii(BLI_system_thread_count() * 4, endpart - startpart);
float particles_per_task = (float)(endpart - startpart) / (float)numtasks, p, pnext;
int i;