Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mesh_evaluate.c
| Show First 20 Lines • Show All 1,294 Lines • ▼ Show 20 Lines | if (data->e2l_prev) { | ||||
| split_loop_nor_fan_do(common_data, data); | split_loop_nor_fan_do(common_data, data); | ||||
| } | } | ||||
| else { | else { | ||||
| /* No need for edge_vectors for 'single' case! */ | /* No need for edge_vectors for 'single' case! */ | ||||
| split_loop_nor_single_do(common_data, data); | split_loop_nor_single_do(common_data, data); | ||||
| } | } | ||||
| } | } | ||||
| static void loop_split_worker(TaskPool *__restrict pool, void *taskdata, int UNUSED(threadid)) | static void loop_split_worker(TaskPool *__restrict pool, void *taskdata) | ||||
| { | { | ||||
| LoopSplitTaskDataCommon *common_data = BLI_task_pool_user_data(pool); | LoopSplitTaskDataCommon *common_data = BLI_task_pool_user_data(pool); | ||||
| LoopSplitTaskData *data = taskdata; | LoopSplitTaskData *data = taskdata; | ||||
| /* Temp edge vectors stack, only used when computing lnor spacearr. */ | /* Temp edge vectors stack, only used when computing lnor spacearr. */ | ||||
| BLI_Stack *edge_vectors = common_data->lnors_spacearr ? | BLI_Stack *edge_vectors = common_data->lnors_spacearr ? | ||||
| BLI_stack_new(sizeof(float[3]), __func__) : | BLI_stack_new(sizeof(float[3]), __func__) : | ||||
| NULL; | NULL; | ||||
| ▲ Show 20 Lines • Show All 387 Lines • ▼ Show 20 Lines | #endif | ||||
| /* This first loop check which edges are actually smooth, and compute edge vectors. */ | /* This first loop check which edges are actually smooth, and compute edge vectors. */ | ||||
| mesh_edges_sharp_tag(&common_data, check_angle, split_angle, false); | mesh_edges_sharp_tag(&common_data, check_angle, split_angle, false); | ||||
| if (numLoops < LOOP_SPLIT_TASK_BLOCK_SIZE * 8) { | 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; | TaskPool *task_pool = BLI_task_pool_create(&common_data, TASK_PRIORITY_HIGH); | ||||
| TaskPool *task_pool; | |||||
| task_scheduler = BLI_task_scheduler_get(); | |||||
| 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 | |||||