diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-12-06 20:59:20 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-12-06 20:59:20 +0300 |
commit | 1eed354e530f395c14b290b4b504a1bcc9299fcb (patch) | |
tree | 65864d0228688341cd3cbfad632309cb113eccb9 /source/blender/blenkernel/intern/ocean.c | |
parent | e1698860ad76cc4043e7e61cbb464b026fe8f828 (diff) |
Switch Ocean modifier's geometry generation from OMP to BLI_task.
Compared to previous revision, this gives 20% speedup on the whole modifier evaluation!
Wondering a bit how improvement can be so impressive here, would have expected very
small increases given how simple is the code here... Maybe it's the fact we get rid
of many additional OMP threads (tests are done with ten Ocean mod evaluated in parallel)?
Diffstat (limited to 'source/blender/blenkernel/intern/ocean.c')
-rw-r--r-- | source/blender/blenkernel/intern/ocean.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c index b1720d4b27a..5a755058963 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -502,7 +502,7 @@ typedef struct OceanSimulateData { float chop_amount; } OceanSimulateData; -static void ocean_compute_htilda_cb(void *userdata, void *UNUSED(userdata_chunk), int i) +static void ocean_compute_htilda(void *userdata, void *UNUSED(userdata_chunk), int i) { OceanSimulateData *osd = userdata; const Ocean *o = osd->o; @@ -748,7 +748,7 @@ void BKE_ocean_simulate(struct Ocean *o, float t, float scale, float chop_amount * This is not optimal in all cases, but remains reasonably simple and should be OK most of the time. */ /* compute a new htilda */ - BLI_task_parallel_range(0, o->_M, &osd, ocean_compute_htilda_cb); + BLI_task_parallel_range(0, o->_M, &osd, ocean_compute_htilda); if (o->_do_disp_y) { BLI_task_pool_push(pool, ocean_compute_displacement_y, NULL, false, TASK_PRIORITY_HIGH); |