Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/ocean.c
| Show First 20 Lines • Show All 657 Lines • ▼ Show 20 Lines | void BKE_ocean_simulate(struct Ocean *o, float t, float scale, float chop_amount) | ||||
| scale *= o->normalize_factor; | scale *= o->normalize_factor; | ||||
| osd.o = o; | osd.o = o; | ||||
| osd.t = t; | osd.t = t; | ||||
| osd.scale = scale; | osd.scale = scale; | ||||
| osd.chop_amount = chop_amount; | osd.chop_amount = chop_amount; | ||||
| pool = BLI_task_pool_create(&osd, TASK_PRIORITY_HIGH); | pool = BLI_task_pool_create(&osd, TASK_PRIORITY_HIGH, TASK_ISOLATION_ON); | ||||
| BLI_rw_mutex_lock(&o->oceanmutex, THREAD_LOCK_WRITE); | BLI_rw_mutex_lock(&o->oceanmutex, THREAD_LOCK_WRITE); | ||||
| /* Note about multi-threading here: we have to run a first set of computations (htilda one) | /* Note about multi-threading here: we have to run a first set of computations (htilda one) | ||||
| * before we can run all others, since they all depend on it. | * before we can run all others, since they all depend on it. | ||||
| * So we make a first parallelized forloop run for htilda, | * So we make a first parallelized forloop run for htilda, | ||||
| * and then pack all other computations into a set of parallel tasks. | * and then pack all other computations into a set of parallel tasks. | ||||
| * This is not optimal in all cases, | * This is not optimal in all cases, | ||||
| ▲ Show 20 Lines • Show All 1,042 Lines • Show Last 20 Lines | |||||