Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mesh_evaluate.c
| Show First 20 Lines • Show All 1,549 Lines • ▼ Show 20 Lines | #endif | ||||
| if (lnors_spacearr) { | if (lnors_spacearr) { | ||||
| data->lnor_space = BKE_lnor_space_create(lnors_spacearr); | data->lnor_space = BKE_lnor_space_create(lnors_spacearr); | ||||
| } | } | ||||
| } | } | ||||
| if (pool) { | if (pool) { | ||||
| data_idx++; | data_idx++; | ||||
| if (data_idx == LOOP_SPLIT_TASK_BLOCK_SIZE) { | if (data_idx == LOOP_SPLIT_TASK_BLOCK_SIZE) { | ||||
| BLI_task_pool_push(pool, loop_split_worker, data_buff, true, TASK_PRIORITY_LOW); | BLI_task_pool_push(pool, loop_split_worker, data_buff, true, NULL); | ||||
| data_idx = 0; | data_idx = 0; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| loop_split_worker_do(common_data, data, edge_vectors); | loop_split_worker_do(common_data, data, edge_vectors); | ||||
| } | } | ||||
| } | } | ||||
| ml_prev = ml_curr; | ml_prev = ml_curr; | ||||
| ml_prev_index = ml_curr_index; | ml_prev_index = ml_curr_index; | ||||
| } | } | ||||
| } | } | ||||
| /* Last block of data... Since it is calloc'ed and we use first NULL item as stopper, | /* Last block of data... Since it is calloc'ed and we use first NULL item as stopper, | ||||
| * everything is fine. */ | * everything is fine. */ | ||||
| if (pool && data_idx) { | if (pool && data_idx) { | ||||
| BLI_task_pool_push(pool, loop_split_worker, data_buff, true, TASK_PRIORITY_LOW); | BLI_task_pool_push(pool, loop_split_worker, data_buff, true, NULL); | ||||
| } | } | ||||
| if (edge_vectors) { | if (edge_vectors) { | ||||
| BLI_stack_free(edge_vectors); | BLI_stack_free(edge_vectors); | ||||
| } | } | ||||
| MEM_freeN(skip_loops); | MEM_freeN(skip_loops); | ||||
| #ifdef DEBUG_TIME | #ifdef DEBUG_TIME | ||||
| ▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | if (numLoops < LOOP_SPLIT_TASK_BLOCK_SIZE * 8) { | ||||
| /* Not enough loops to be worth the whole threading overhead... */ | /* Not enough loops to be worth the whole threading overhead... */ | ||||
| loop_split_generator(NULL, &common_data); | loop_split_generator(NULL, &common_data); | ||||
| } | } | ||||
| else { | else { | ||||
| TaskScheduler *task_scheduler; | TaskScheduler *task_scheduler; | ||||
| TaskPool *task_pool; | TaskPool *task_pool; | ||||
| task_scheduler = BLI_task_scheduler_get(); | task_scheduler = BLI_task_scheduler_get(); | ||||
| task_pool = BLI_task_pool_create(task_scheduler, &common_data); | task_pool = BLI_task_pool_create(task_scheduler, &common_data, TASK_PRIORITY_HIGH); | ||||
| loop_split_generator(task_pool, &common_data); | loop_split_generator(task_pool, &common_data); | ||||
| BLI_task_pool_work_and_wait(task_pool); | BLI_task_pool_work_and_wait(task_pool); | ||||
| BLI_task_pool_free(task_pool); | BLI_task_pool_free(task_pool); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 2,300 Lines • Show Last 20 Lines | |||||