Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/softbody.c
| Show First 20 Lines • Show All 1,533 Lines • ▼ Show 20 Lines | static void sb_sfesf_threads_run(struct Depsgraph *depsgraph, | ||||
| ListBase threads; | ListBase threads; | ||||
| SB_thread_context *sb_threads; | SB_thread_context *sb_threads; | ||||
| int i, totthread, left, dec; | int i, totthread, left, dec; | ||||
| /* wild guess .. may increase with better thread management 'above' | /* wild guess .. may increase with better thread management 'above' | ||||
| * or even be UI option sb->spawn_cf_threads_nopts */ | * or even be UI option sb->spawn_cf_threads_nopts */ | ||||
| int lowsprings = 100; | int lowsprings = 100; | ||||
| ListBase *effectors = BKE_effectors_create(depsgraph, ob, NULL, ob->soft->effector_weights); | ListBase *effectors = BKE_effectors_create( | ||||
| depsgraph, ob, NULL, ob->soft->effector_weights, false); | |||||
| /* figure the number of threads while preventing pretty pointless threading overhead */ | /* figure the number of threads while preventing pretty pointless threading overhead */ | ||||
| totthread = BKE_scene_num_threads(scene); | totthread = BKE_scene_num_threads(scene); | ||||
| /* what if we got zillions of CPUs running but less to spread*/ | /* what if we got zillions of CPUs running but less to spread*/ | ||||
| while ((totsprings / totthread < lowsprings) && (totthread > 1)) { | while ((totsprings / totthread < lowsprings) && (totthread > 1)) { | ||||
| totthread--; | totthread--; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 744 Lines • ▼ Show 20 Lines | #endif | ||||
| /* iks = 1.0f/(1.0f-sb->inspring)-1.0f; */ /* inner spring constants function */ /* UNUSED */ | /* iks = 1.0f/(1.0f-sb->inspring)-1.0f; */ /* inner spring constants function */ /* UNUSED */ | ||||
| /* bproot= sb->bpoint; */ /* need this for proper spring addressing */ /* UNUSED */ | /* bproot= sb->bpoint; */ /* need this for proper spring addressing */ /* UNUSED */ | ||||
| if (do_springcollision || do_aero) { | if (do_springcollision || do_aero) { | ||||
| sb_sfesf_threads_run(depsgraph, scene, ob, timenow, sb->totspring, NULL); | sb_sfesf_threads_run(depsgraph, scene, ob, timenow, sb->totspring, NULL); | ||||
| } | } | ||||
| /* after spring scan because it uses Effoctors too */ | /* after spring scan because it uses Effoctors too */ | ||||
| ListBase *effectors = BKE_effectors_create(depsgraph, ob, NULL, sb->effector_weights); | ListBase *effectors = BKE_effectors_create(depsgraph, ob, NULL, sb->effector_weights, false); | ||||
| if (do_deflector) { | if (do_deflector) { | ||||
| float defforce[3]; | float defforce[3]; | ||||
| do_deflector = sb_detect_aabb_collisionCached(defforce, ob, timenow); | do_deflector = sb_detect_aabb_collisionCached(defforce, ob, timenow); | ||||
| } | } | ||||
| sb_cf_threads_run(scene, | sb_cf_threads_run(scene, | ||||
| ob, | ob, | ||||
| ▲ Show 20 Lines • Show All 1,362 Lines • Show Last 20 Lines | |||||